From 5a2df81967162333f0e3ffccdde22bea3182dc01 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Thu, 18 Nov 2021 00:01:55 +0100 Subject: Import node-carto_1.2.0-1.debian.tar.xz [dgit import tarball node-carto 1.2.0-1 node-carto_1.2.0-1.debian.tar.xz] --- changelog | 96 ++++++++++++++++++++++++++++++++++++++++++++ control | 51 +++++++++++++++++++++++ copyright | 29 +++++++++++++ docs | 2 + gbp.conf | 5 +++ links | 1 + manpages | 1 + patches/disable-eslint.patch | 16 ++++++++ patches/fix-tests.patch | 20 +++++++++ patches/series | 2 + rules | 28 +++++++++++++ salsa-ci.yml | 8 ++++ source/format | 1 + source/lintian-overrides | 1 + tests/pkg-js/test | 19 +++++++++ upstream/metadata | 7 ++++ watch | 5 +++ 17 files changed, 292 insertions(+) create mode 100644 changelog create mode 100644 control create mode 100644 copyright create mode 100644 docs create mode 100644 gbp.conf create mode 100644 links create mode 100644 manpages create mode 100644 patches/disable-eslint.patch create mode 100644 patches/fix-tests.patch create mode 100644 patches/series create mode 100755 rules create mode 100644 salsa-ci.yml create mode 100644 source/format create mode 100644 source/lintian-overrides create mode 100644 tests/pkg-js/test create mode 100644 upstream/metadata create mode 100644 watch diff --git a/changelog b/changelog new file mode 100644 index 0000000..f367443 --- /dev/null +++ b/changelog @@ -0,0 +1,96 @@ +node-carto (1.2.0-1) unstable; urgency=medium + + [ Jérémy Lal ] + * debhelper 9 + * Standards-Version 3.9.8 + * Secure Vcs url + * Source is not missing really, override lintian error + + [ Bas Couwenberg ] + * Restructure control file with cme. + * Update Vcs-* URLs for Salsa. + * Add node-{chroma-js,husl,lodash,semver} to dependencies. + * Drop node-{optimist,underscore,xml2js} from dependencies. + * Use mocha in dh_auto_test override. + * Add build dependencies for tests. + + [ Johannes Schauer Marin Rodrigues ] + * New upstream version 1.2.0 (Closes: #998813) + * dh compat 13 + * build docs with sphinx + * regenerate man page with help2man + * update Standards-Version + * add Rules-Requires-Root: no + * update package dependencies + * drop mml2json + * add patches to fix tests + + -- Johannes Schauer Marin Rodrigues Thu, 18 Nov 2021 00:01:55 +0100 + +node-carto (0.9.5-2) unstable; urgency=low + + * Breaks and replaces carto (<< 0.9.5) (Closes: #728561) + + -- Jérémy Lal Sun, 03 Nov 2013 17:34:37 +0100 + +node-carto (0.9.5-1) unstable; urgency=low + + * New upstream version + * Drop repackaging, not needed + * Add a manpage for mml2json.js + * Canonicalize Vcs fields + * Build-Depends nodejs, so it's available where installable + * Depends node-optimist, mapnik-reference + * Loosen nodejs dependency + * Watch github + * Remove unneeded patches (all), rewrite node shebang on install + + -- Jérémy Lal Sat, 26 Oct 2013 01:04:03 +0200 + +node-carto (0.4.6+ds1-3) unstable; urgency=low + + * Add missing Recommends on node-millstone + * Fix wrong dependency on nodejs + + -- David Paleino Thu, 20 Sep 2012 10:58:13 +0200 + +node-carto (0.4.6+ds1-2) unstable; urgency=low + + * Migrate from node to nodejs (Closes: #686897) + * Standards-Version bump to 3.9.4, no changes needed + + -- David Paleino Thu, 20 Sep 2012 10:49:12 +0200 + +node-carto (0.4.6+ds1-1) unstable; urgency=low + + * New upstream version + * Standards-Version bump to 3.9.3, no changes needed + * Fix Homepage link (Closes: #655725) + * Update debian/copyright + + -- David Paleino Thu, 22 Mar 2012 19:51:09 +0100 + +node-carto (0.4.5+ds1-1) unstable; urgency=low + + * New upstream version + + -- David Paleino Fri, 30 Dec 2011 13:00:26 +0100 + +node-carto (0.4.3+ds1-2) unstable; urgency=low + + [ Andrew Harvey ] + * Added carto man page. + + -- David Paleino Fri, 18 Nov 2011 18:12:03 +0100 + +node-carto (0.4.3+ds1-1) unstable; urgency=low + + * New upstream version + + -- David Paleino Wed, 16 Nov 2011 22:02:47 +0100 + +node-carto (0.4.2+ds1-1) unstable; urgency=low + + * Initial release (Closes: #646401) + + -- David Paleino Sun, 23 Oct 2011 23:45:25 +0200 diff --git a/control b/control new file mode 100644 index 0000000..ae0863d --- /dev/null +++ b/control @@ -0,0 +1,51 @@ +Source: node-carto +Maintainer: Debian Javascript Maintainers +Uploaders: David Paleino , + Jérémy Lal , + Johannes Schauer Marin Rodrigues +Section: javascript +Priority: optional +Build-Depends: + debhelper-compat (= 13), + , nodejs (>= 6) + , dh-sequence-nodejs + , dh-sequence-sphinxdoc + , mocha, + , node-chroma-js + , node-hsluv + , node-js-yaml + , node-lodash + , mapnik-reference + , node-sax + , node-semver + , help2man + , python3-sphinx + , python3-sphinx-rtd-theme +Standards-Version: 4.6.0 +Vcs-Browser: https://salsa.debian.org/js-team/node-carto +Vcs-Git: https://salsa.debian.org/js-team/node-carto.git +Homepage: https://github.com/mapbox/carto +Testsuite: autopkgtest-pkg-nodejs +Rules-Requires-Root: no + +Package: node-carto +Architecture: all +Depends: + ${misc:Depends} + , nodejs (>= 6) + , node-chroma-js (>= 1.3.5) + , node-hsluv (>= 0.0.1) + , node-js-yaml (>= 3.12.0) + , node-lodash (>= 4.17.10) + , mapnik-reference (>= 8.10.0) + , node-semver (>= 5.6.0) + , node-yargs (>= 12.0.1) +Recommends: node-millstone +Breaks: carto (<< 0.9.5) +Replaces: carto (<< 0.9.5) +Description: Mapnik stylesheet compiler + Carto is a stylesheet renderer for Mapnik. + It's an evolution of the Cascadenik idea and language, + with an emphasis on speed and flexibility. + . + Node.js is an event-based server-side javascript engine. diff --git a/copyright b/copyright new file mode 100644 index 0000000..0e94063 --- /dev/null +++ b/copyright @@ -0,0 +1,29 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: carto +Upstream-Contact: https://github.com/mapbox/carto/issues +Source: https://github.com/mapbox/carto#readme + +Files: * +Copyright: © MapBox +License: Apache-2.0 + +Files: debian/* +Copyright: © 2011-2012, David Paleino + 2021, Johannes Schauer Marin Rodrigues +License: Apache-2.0 + +License: Apache-2.0 + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + . + On Debian systems, the complete text of the Apache version 2.0 license + can be found in "/usr/share/common-licenses/Apache-2.0". diff --git a/docs b/docs new file mode 100644 index 0000000..75e4e6a --- /dev/null +++ b/docs @@ -0,0 +1,2 @@ +README.md +docs/_build/html diff --git a/gbp.conf b/gbp.conf new file mode 100644 index 0000000..b713356 --- /dev/null +++ b/gbp.conf @@ -0,0 +1,5 @@ +[DEFAULT] +pristine-tar = True + +[import-orig] +filter = [ '.gitignore', '.travis.yml', '.git*' ] diff --git a/links b/links new file mode 100644 index 0000000..4e311cc --- /dev/null +++ b/links @@ -0,0 +1 @@ +usr/share/nodejs/carto/bin/carto usr/bin/carto diff --git a/manpages b/manpages new file mode 100644 index 0000000..affebe8 --- /dev/null +++ b/manpages @@ -0,0 +1 @@ +man/carto.1 diff --git a/patches/disable-eslint.patch b/patches/disable-eslint.patch new file mode 100644 index 0000000..034e701 --- /dev/null +++ b/patches/disable-eslint.patch @@ -0,0 +1,16 @@ +Author: Johannes Schauer Marin Rodrigues +Description: disable test because mocha-eslint is not packaged +Forwarded: not-needed + +--- a/test/eclint.test.js ++++ b/test/eclint.test.js +@@ -1,3 +1,4 @@ ++/* + var lint = require('mocha-eslint'); + + describe('jslint', function() { +@@ -11,3 +12,4 @@ describe('jslint', function() { + options.formatter = 'compact'; + lint(paths, options); + }); ++*/ diff --git a/patches/fix-tests.patch b/patches/fix-tests.patch new file mode 100644 index 0000000..bf8d125 --- /dev/null +++ b/patches/fix-tests.patch @@ -0,0 +1,20 @@ +--- a/test/rendering/zoomlevels.result ++++ b/test/rendering/zoomlevels.result +@@ -75,13 +75,13 @@ + + + +- 50000000 +- 25000000 ++ 100000000 ++ 50000000 + + + +- 100000000 +- 50000000 ++ 50000000 ++ 25000000 + + + diff --git a/patches/series b/patches/series new file mode 100644 index 0000000..c66bb56 --- /dev/null +++ b/patches/series @@ -0,0 +1,2 @@ +disable-eslint.patch +fix-tests.patch diff --git a/rules b/rules new file mode 100755 index 0000000..3dc15e0 --- /dev/null +++ b/rules @@ -0,0 +1,28 @@ +#!/usr/bin/make -f +# -*- makefile -*- + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +%: + dh $@ + +execute_after_dh_install: + mkdir -p $(CURDIR)/debian/node-carto/usr/share/vim/addons/syntax/ + cp build/vim-carto/syntax/carto.vim $(CURDIR)/debian/node-carto/usr/share/vim/addons/syntax/ + mkdir -p $(CURDIR)/debian/node-carto/usr/share/vim/addons/ftdetect/ + cp build/vim-carto/ftdetect/carto.vim $(CURDIR)/debian/node-carto/usr/share/vim/addons/ftdetect/ + rm -r $(CURDIR)/debian/node-carto/usr/share/nodejs/carto/build + rm -r $(CURDIR)/debian/node-carto/usr/share/nodejs/carto/man + +override_dh_installchangelogs: + dh_installchangelogs -- CHANGELOG.md + +override_dh_auto_build: + help2man ./bin/carto > man/carto.1 + $(MAKE) -C docs html + +override_dh_auto_test: + # for unknown reason, the fontset-duplication test fails + rm ./test/rendering/fontset-duplication.mml + mocha diff --git a/salsa-ci.yml b/salsa-ci.yml new file mode 100644 index 0000000..e748f6f --- /dev/null +++ b/salsa-ci.yml @@ -0,0 +1,8 @@ +--- +include: + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/recipes/debian.yml + +before_script: + - echo "deb [trusted=yes] https://salsa.debian.org/js-team/node-chroma-js/-/jobs/2190648/artifacts/raw/aptly unstable main" | tee /etc/apt/sources.list.d/node-chroma-js.list + - echo "deb [trusted=yes] https://salsa.debian.org/js-team/node-hsluv/-/jobs/2190661/artifacts/raw/aptly unstable main" | tee /etc/apt/sources.list.d/node-hsluv.list + - apt-get update diff --git a/source/format b/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/source/lintian-overrides b/source/lintian-overrides new file mode 100644 index 0000000..38f0edf --- /dev/null +++ b/source/lintian-overrides @@ -0,0 +1 @@ +node-carto source: source-is-missing test/support/diff.js diff --git a/tests/pkg-js/test b/tests/pkg-js/test new file mode 100644 index 0000000..28c84c5 --- /dev/null +++ b/tests/pkg-js/test @@ -0,0 +1,19 @@ +cat << END > expected + + + + + + + + + +END + +carto test/rendering/layer_nodatasource.mml | diff - expected +rm expected diff --git a/upstream/metadata b/upstream/metadata new file mode 100644 index 0000000..5d8167c --- /dev/null +++ b/upstream/metadata @@ -0,0 +1,7 @@ +--- +Archive: GitHub +Bug-Database: https://github.com/mapbox/carto/issues +Contact: https://github.com/mapbox/carto/issues +Name: carto +Repository: https://github.com/mapbox/carto.git +Repository-Browse: https://github.com/mapbox/carto diff --git a/watch b/watch new file mode 100644 index 0000000..5d64b8a --- /dev/null +++ b/watch @@ -0,0 +1,5 @@ +version=4 +opts=\ +dversionmangle=auto,\ +filenamemangle=s/.*\/v?([\d\.-]+)\.tar\.gz/node-carto-$1.tar.gz/ \ + https://github.com/mapbox/carto/releases .*/archive.*/v?([\d\.]+).tar.gz -- cgit v1.2.3 From 87c44255886a01c37e5f0816269f167febdaab63 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Thu, 18 Nov 2021 00:01:55 +0100 Subject: Import node-carto_1.2.0.orig.tar.gz [dgit import orig node-carto_1.2.0.orig.tar.gz] --- .eslintrc.yml | 195 + .gitignore | 6 + .npmignore | 3 + .travis.yml | 13 + CHANGELOG.md | 365 ++ CONTRIBUTING.md | 35 + LICENSE | 179 + README.md | 129 + appveyor.yml | 24 + bin/carto | 150 + build/carto.tmbundle/Commands/preview.tmCommand | 40 + build/carto.tmbundle/Syntaxes/carto.tmLanguage | 351 ++ build/carto.tmbundle/Syntaxes/mml.tmLanguage | 287 ++ build/carto.tmbundle/info.plist | 15 + build/syntaxgenerate | 47 + build/tmlanguage_template.js | 133 + build/vim-carto/ftdetect/carto.vim | 1 + build/vim-carto/syntax/carto.vim | 160 + build/vimsyntax_template.js | 160 + docs/Makefile | 20 + docs/api/mapnik/2.0.0.rst | 1912 +++++++ docs/api/mapnik/2.0.1.rst | 1912 +++++++ docs/api/mapnik/2.0.2.rst | 1912 +++++++ docs/api/mapnik/2.1.0.rst | 2527 ++++++++++ docs/api/mapnik/2.1.1.rst | 2544 ++++++++++ docs/api/mapnik/2.2.0.rst | 3045 ++++++++++++ docs/api/mapnik/2.3.0.rst | 3131 ++++++++++++ docs/api/mapnik/3.0.0.rst | 3778 ++++++++++++++ docs/api/mapnik/3.0.20.rst | 3846 ++++++++++++++ docs/api/mapnik/3.0.3.rst | 3778 ++++++++++++++ docs/api/mapnik/3.0.6.rst | 3778 ++++++++++++++ docs/conf.py | 157 + docs/generate.js | 38 + docs/index.rst | 19 + docs/installation_usage.rst | 275 + docs/language_elements.rst | 205 + docs/mapnik_api._ | 10 + docs/mapnik_api.rst | 20 + docs/mml.rst | 470 ++ docs/styling_concepts.rst | 141 + docs/symbolizers._ | 52 + lib/carto/functions.js | 335 ++ lib/carto/index.js | 106 + lib/carto/mml.js | 95 + lib/carto/parser.js | 783 +++ lib/carto/renderer.js | 662 +++ lib/carto/tree.js | 10 + lib/carto/tree/call.js | 111 + lib/carto/tree/color.js | 155 + lib/carto/tree/comment.js | 15 + lib/carto/tree/definition.js | 290 ++ lib/carto/tree/dimension.js | 102 + lib/carto/tree/element.js | 30 + lib/carto/tree/expression.js | 39 + lib/carto/tree/field.js | 17 + lib/carto/tree/filter.js | 70 + lib/carto/tree/filterset.js | 290 ++ lib/carto/tree/fontset.js | 51 + lib/carto/tree/imagefilter.js | 22 + lib/carto/tree/invalid.js | 25 + lib/carto/tree/keyword.js | 17 + lib/carto/tree/layer.js | 70 + lib/carto/tree/literal.js | 20 + lib/carto/tree/operation.js | 102 + lib/carto/tree/quoted.js | 30 + lib/carto/tree/reference.js | 314 ++ lib/carto/tree/rule.js | 173 + lib/carto/tree/ruleset.js | 178 + lib/carto/tree/selector.js | 26 + lib/carto/tree/style.js | 96 + lib/carto/tree/url.js | 18 + lib/carto/tree/value.js | 45 + lib/carto/tree/variable.js | 38 + lib/carto/tree/zoom.js | 128 + lib/carto/util.js | 178 + man/carto.1 | 52 + package-lock.json | 2309 +++++++++ package.json | 56 + test/benchmark/opened.mml | 15 + test/benchmark/opened.mss | 2392 +++++++++ test/benchmark/opened.result | 2014 ++++++++ test/bincarto.test.js | 55 + test/color.test.js | 25 + test/comment.test.js | 14 + test/eclint.test.js | 13 + test/errorhandling.test.js | 66 + test/errorhandling/bad_filter.mml | 10 + test/errorhandling/bad_filter.mss | 3 + test/errorhandling/bad_filter.result | 1 + test/errorhandling/bad_op.mml | 14 + test/errorhandling/bad_op.mss | 3 + test/errorhandling/bad_op.result | 1 + test/errorhandling/bad_op_2.mml | 14 + test/errorhandling/bad_op_2.mss | 3 + test/errorhandling/bad_op_2.result | 1 + test/errorhandling/color_functions.mml | 14 + test/errorhandling/color_functions.mss | 4 + test/errorhandling/color_functions.result | 1 + test/errorhandling/contradiction.mml | 15 + test/errorhandling/contradiction.mss | 3 + test/errorhandling/contradiction.result | 1 + test/errorhandling/contradiction_2.mss | 3 + test/errorhandling/contradiction_2.result | 1 + test/errorhandling/function_args.mml | 14 + test/errorhandling/function_args.mss | 4 + test/errorhandling/function_args.result | 1 + test/errorhandling/invalid_attachment.mml | 14 + test/errorhandling/invalid_attachment.mss | 3 + test/errorhandling/invalid_attachment.result | 1 + test/errorhandling/invalid_color_in_fn.mss | 3 + test/errorhandling/invalid_color_in_fn.result | 1 + test/errorhandling/invalid_property.mml | 14 + test/errorhandling/invalid_property.mss | 4 + test/errorhandling/invalid_property.result | 1 + test/errorhandling/invalid_value.mml | 14 + test/errorhandling/invalid_value.mss | 4 + test/errorhandling/invalid_value.result | 1 + test/errorhandling/invaliddimension.mml | 14 + test/errorhandling/invaliddimension.mss | 3 + test/errorhandling/invaliddimension.result | 1 + test/errorhandling/issue119.mml | 14 + test/errorhandling/issue119.mss | 3 + test/errorhandling/issue119.result | 1 + test/errorhandling/issue123.mml | 14 + test/errorhandling/issue123.mss | 8 + test/errorhandling/issue123.result | 1 + test/errorhandling/issue124.mml | 14 + test/errorhandling/issue124.mss | 5 + test/errorhandling/issue124.result | 1 + test/errorhandling/issue165.mml | 12 + test/errorhandling/issue165.result | 1 + test/errorhandling/issue297.mml | 8 + test/errorhandling/issue297.mss | 4 + test/errorhandling/issue297.result | 1 + test/errorhandling/issue_204_a.mss | 3 + test/errorhandling/issue_204_a.result | 1 + test/errorhandling/issue_204_b.mss | 3 + test/errorhandling/issue_204_b.result | 1 + test/errorhandling/issue_204_c.mss | 3 + test/errorhandling/issue_204_c.result | 1 + test/errorhandling/issue_218.mss | 5 + test/errorhandling/issue_218.result | 1 + test/errorhandling/issue_29.mml | 12 + test/errorhandling/issue_29.mss | 3 + test/errorhandling/issue_29.result | 2 + test/errorhandling/issue_462.mss | 6 + test/errorhandling/issue_462.result | 8 + test/errorhandling/issue_474.mss | 7 + test/errorhandling/issue_474.result | 3 + test/errorhandling/mapnik_keyword.mml | 14 + test/errorhandling/mapnik_keyword.mss | 3 + test/errorhandling/mapnik_keyword.result | 1 + test/errorhandling/missing_close.mml | 14 + test/errorhandling/missing_close.mss | 4 + test/errorhandling/missing_close.result | 1 + test/errorhandling/multi_stylesheets.mml | 15 + test/errorhandling/multi_stylesheets.result | 1 + test/errorhandling/multi_stylesheets_a.mss | 6 + test/errorhandling/multi_stylesheets_b.mss | 3 + test/errorhandling/multi_stylesheets_b.result | 1 + test/errorhandling/no_stylesheet.mml | 7 + test/errorhandling/no_stylesheet.result | 1 + test/errorhandling/nopound.mml | 14 + test/errorhandling/nopound.mss | 8 + test/errorhandling/nopound.result | 1 + test/errorhandling/notenoughargs.mml | 14 + test/errorhandling/notenoughargs.mss | 8 + test/errorhandling/notenoughargs.result | 1 + test/errorhandling/stylesheet_absolute_file.mml | 5 + test/errorhandling/stylesheet_absolute_file.result | 1 + .../stylesheet_absolute_file_syswin.result | 1 + test/errorhandling/stylesheet_no_data.mml | 10 + test/errorhandling/stylesheet_no_data.result | 1 + test/errorhandling/stylesheet_no_id.mml | 10 + test/errorhandling/stylesheet_no_id.result | 1 + test/errorhandling/undefined_variable.mml | 14 + test/errorhandling/undefined_variable.mss | 5 + test/errorhandling/undefined_variable.result | 3 + test/errorhandling/zoom_as_var.mml | 14 + test/errorhandling/zoom_as_var.mss | 3 + test/errorhandling/zoom_as_var.result | 1 + test/errorhandling/zoommax.mml | 14 + test/errorhandling/zoommax.mss | 3 + test/errorhandling/zoommax.result | 1 + test/field.test.js | 18 + test/filter.test.js | 26 + test/filterset.test.js | 280 ++ test/operation.test.js | 45 + test/quoted.test.js | 23 + test/reference.test.js | 87 + test/rendering-mss.test.js | 46 + test/rendering-mss/basic_attachment_internal.mss | 9 + test/rendering-mss/basic_attachment_internal.xml | 10 + .../basic_attachment_internal_before.mss | 9 + .../basic_attachment_internal_before.xml | 10 + .../basic_attachment_internal_before_and_after.mss | 12 + .../basic_attachment_internal_before_and_after.xml | 15 + .../basic_attachment_internal_double.mss | 10 + .../basic_attachment_internal_double.xml | 10 + .../basic_attachment_internal_with_label.mss | 11 + .../basic_attachment_internal_with_label.xml | 10 + test/rendering-mss/basic_attachment_separate.mss | 9 + test/rendering-mss/basic_attachment_separate.xml | 10 + .../basic_attachment_separate_before.mss | 9 + .../basic_attachment_separate_before.xml | 10 + .../basic_attachment_separate_before_and_after.mss | 12 + .../basic_attachment_separate_before_and_after.xml | 15 + .../basic_attachment_separate_double.mss | 8 + .../basic_attachment_separate_double.xml | 10 + .../basic_attachment_separate_with_label.mss | 11 + .../basic_attachment_separate_with_label.xml | 10 + test/rendering-mss/color_functions.mss | 68 + test/rendering-mss/color_functions.xml | 59 + test/rendering-mss/empty_name.mss | 6 + test/rendering-mss/empty_name.xml | 5 + test/rendering-mss/image-filters.mss | 5 + test/rendering-mss/image-filters.xml | 1 + test/rendering-mss/issue_121.mss | 3 + test/rendering-mss/issue_121.xml | 6 + test/rendering-mss/issue_197.mss | 5 + test/rendering-mss/issue_197.xml | 11 + test/rendering-mss/issue_214.mss | 83 + test/rendering-mss/issue_214.xml | 14 + test/rendering-mss/issue_232.mss | 14 + test/rendering-mss/issue_232.xml | 26 + test/rendering-mss/issue_247_1.mss | 12 + test/rendering-mss/issue_247_1.xml | 10 + test/rendering-mss/issue_247_2.mss | 12 + test/rendering-mss/issue_247_2.xml | 15 + test/rendering-mss/issue_284.mss | 17 + test/rendering-mss/issue_284.xml | 28 + test/rendering-mss/issue_284_b.mss | 18 + test/rendering-mss/issue_284_b.xml | 28 + test/rendering-mss/issue_284_c.mss | 18 + test/rendering-mss/issue_284_c.xml | 14 + test/rendering-mss/issue_303.mss | 4 + test/rendering-mss/issue_303.xml | 6 + test/rendering-mss/issue_339.mss | 1 + test/rendering-mss/issue_339.xml | 1 + test/rendering-mss/issue_339b.mss | 4 + test/rendering-mss/issue_339b.xml | 0 test/rendering-mss/issue_370.mss | 3 + test/rendering-mss/issue_370.xml | 6 + test/rendering-mss/issue_370_b.mss | 3 + test/rendering-mss/issue_370_b.xml | 6 + test/rendering-mss/issue_377.mss | 3 + test/rendering-mss/issue_377.xml | 6 + test/rendering-mss/issue_443.mss | 5 + test/rendering-mss/issue_443.xml | 5 + test/rendering-mss/issue_462.mss | 10 + test/rendering-mss/issue_462.xml | 10 + test/rendering-mss/issue_462a.mss | 9 + test/rendering-mss/issue_462a.xml | 13 + test/rendering-mss/issue_462b.mss | 15 + test/rendering-mss/issue_462b.xml | 10 + test/rendering-mss/line-width-zoom.mss | 3 + test/rendering-mss/line-width-zoom.xml | 5 + test/rendering-mss/quoted_attr.mss | 3 + test/rendering-mss/quoted_attr.xml | 6 + test/rendering-mss/scale-hsla-filter.mss | 5 + test/rendering-mss/scale-hsla-filter.xml | 5 + .../should-discard-empty-style-and-attach.mss | 4 + .../should-discard-empty-style-and-attach.xml | 1 + test/rendering-mss/should-discard-empty-style.mss | 2 + test/rendering-mss/should-discard-empty-style.xml | 0 test/rendering-mss/should-discard-empty-style2.mss | 8 + test/rendering-mss/should-discard-empty-style2.xml | 2 + test/rendering-mss/style-level-prop-only.mss | 3 + test/rendering-mss/style-level-prop-only.xml | 1 + test/rendering-mss/style-level-prop-only2.mss | 3 + test/rendering-mss/style-level-prop-only2.xml | 1 + test/rendering-mss/style-level-prop-only3.mss | 3 + test/rendering-mss/style-level-prop-only3.xml | 1 + test/rendering-mss/text-face-name-escaping.mss | 4 + test/rendering-mss/text-face-name-escaping.xml | 5 + test/rendering-mss/variable-quoting-of-enum.mss | 5 + test/rendering-mss/variable-quoting-of-enum.xml | 5 + test/rendering-mss/zoom-like-field-name.mss | 3 + test/rendering-mss/zoom-like-field-name.xml | 6 + test/rendering-mss/zoom_space.mss | 3 + test/rendering-mss/zoom_space.xml | 6 + test/rendering.test.js | 102 + test/rendering/afghanistan_votes.mml | 15 + test/rendering/afghanistan_votes.mss | 69 + test/rendering/afghanistan_votes.result | 39 + test/rendering/background_attributes.mml | 7 + test/rendering/background_attributes.mss | 3 + test/rendering/background_attributes.result | 3 + test/rendering/buffersize.mml | 14 + test/rendering/buffersize.mss | 10 + test/rendering/buffersize.result | 22 + test/rendering/building_height.mml | 14 + test/rendering/building_height.mss | 4 + test/rendering/building_height.result | 20 + test/rendering/combined_class.mml | 26 + test/rendering/combined_class.mss | 11 + test/rendering/combined_class.result | 36 + test/rendering/complex_cascades.mml | 23 + test/rendering/complex_cascades.mss | 31 + test/rendering/complex_cascades.result | 71 + test/rendering/complexfontset.mml | 23 + test/rendering/complexfontset.mss | 11 + test/rendering/complexfontset.result | 37 + test/rendering/cross_stylesheet_variable.mml | 15 + test/rendering/cross_stylesheet_variable.result | 21 + test/rendering/cross_stylesheet_variable_a.mss | 1 + test/rendering/cross_stylesheet_variable_b.mss | 3 + test/rendering/data_only.mml | 12 + test/rendering/data_only.result | 14 + test/rendering/empty_style.mml | 14 + test/rendering/empty_style.mss | 8 + test/rendering/empty_style.result | 26 + test/rendering/empty_url.mml | 14 + test/rendering/empty_url.mss | 3 + test/rendering/empty_url.result | 20 + test/rendering/external_image.mml | 14 + test/rendering/external_image.mss | 3 + test/rendering/external_image.result | 21 + test/rendering/fadeout.mml | 14 + test/rendering/fadeout.mss | 3 + test/rendering/fadeout.result | 20 + test/rendering/field.mml | 14 + test/rendering/field.mss | 6 + test/rendering/field.result | 23 + test/rendering/field_advanced.mml | 14 + test/rendering/field_advanced.mss | 6 + test/rendering/field_advanced.result | 23 + test/rendering/filter_comparing_fields.mml | 15 + test/rendering/filter_comparing_fields.mss | 23 + test/rendering/filter_comparing_fields.result | 32 + test/rendering/filterexp.mml | 14 + test/rendering/filterexp.mss | 1 + test/rendering/filterexp.result | 21 + test/rendering/filterquote.mml | 14 + test/rendering/filterquote.mss | 3 + test/rendering/filterquote.result | 21 + test/rendering/filters.mml | 14 + test/rendering/filters.mss | 5 + test/rendering/filters.result | 22 + test/rendering/filtervariable.mml | 14 + test/rendering/filtervariable.mss | 9 + test/rendering/filtervariable.result | 26 + test/rendering/filtervariable2.mml | 10 + test/rendering/filtervariable2.mss | 6 + test/rendering/filtervariable2.result | 22 + test/rendering/fontset-duplication.mml | 28 + test/rendering/fontset-duplication.mss | 141 + test/rendering/fontset-duplication.result | 5228 ++++++++++++++++++++ test/rendering/gray_function.mml | 14 + test/rendering/gray_function.mss | 3 + test/rendering/gray_function.result | 20 + test/rendering/highzooms.mml | 14 + test/rendering/highzooms.mss | 9 + test/rendering/highzooms.result | 51 + test/rendering/identity.mml | 14 + test/rendering/identity.mss | 5 + test/rendering/identity.result | 21 + test/rendering/image_filters.mml | 14 + test/rendering/image_filters.mss | 8 + test/rendering/image_filters.result | 21 + test/rendering/imagefilter-duplication.mml | 14 + test/rendering/imagefilter-duplication.mss | 5 + test/rendering/imagefilter-duplication.result | 27 + test/rendering/instance_names.mml | 14 + test/rendering/instance_names.mss | 15 + test/rendering/instance_names.result | 38 + test/rendering/issue294.mml | 11 + test/rendering/issue294.result | 15 + test/rendering/issue32.mml | 15 + test/rendering/issue32.mss | 4 + test/rendering/issue32.result | 26 + test/rendering/issue32a.mss | 8 + test/rendering/issue60.mml | 14 + test/rendering/issue60.mss | 6 + test/rendering/issue60.result | 40 + test/rendering/issue_100_filters.mml | 14 + test/rendering/issue_100_filters.mss | 16 + test/rendering/issue_100_filters.result | 56 + test/rendering/issue_121.mml | 36 + test/rendering/issue_121.mss | 11 + test/rendering/issue_121.result | 39 + test/rendering/issue_239.mml | 37 + test/rendering/issue_239.result | 36 + test/rendering/issue_239_a.mss | 7 + test/rendering/issue_239_b.mss | 5 + test/rendering/issue_273.mml | 37 + test/rendering/issue_273.mss | 5 + test/rendering/issue_273.result | 30 + test/rendering/issue_291.mml | 24 + test/rendering/issue_291.mss | 6 + test/rendering/issue_291.result | 35 + test/rendering/issue_296.mml | 13 + test/rendering/issue_296.mss | 11 + test/rendering/issue_296.result | 37 + test/rendering/issue_333.mml | 10 + test/rendering/issue_333.mss | 8 + test/rendering/issue_333.result | 18 + test/rendering/issue_338.mml | 10 + test/rendering/issue_338.mss | 7 + test/rendering/issue_338.result | 13 + test/rendering/issue_348.mml | 9 + test/rendering/issue_348.result | 7 + test/rendering/issue_394.mss | 4 + test/rendering/issue_394_api2.3.0.mml | 18 + test/rendering/issue_394_api2.3.0.result | 22 + test/rendering/issue_394_api3.0.0.mml | 18 + test/rendering/issue_394_api3.0.0.result | 22 + test/rendering/issue_411.mml | 14 + test/rendering/issue_411.mss | 17 + test/rendering/issue_411.result | 34 + test/rendering/issue_450.mml | 67 + test/rendering/issue_450.result | 41 + test/rendering/issue_469.mml | 15 + test/rendering/issue_469.mss | 20 + test/rendering/issue_469.result | 18 + test/rendering/layer_nodatasource.mml | 10 + test/rendering/layer_nodatasource.mss | 4 + test/rendering/layer_nodatasource.result | 17 + test/rendering/layer_properties.mml | 17 + test/rendering/layer_properties.mss | 4 + test/rendering/layer_properties.result | 22 + test/rendering/mapnik_keyword.mml | 14 + test/rendering/mapnik_keyword.mss | 3 + test/rendering/mapnik_keyword.result | 21 + test/rendering/modulus.mml | 14 + test/rendering/modulus.mss | 6 + test/rendering/modulus.result | 23 + test/rendering/multiple_symbolizers.mml | 14 + test/rendering/multiple_symbolizers.mss | 5 + test/rendering/multiple_symbolizers.result | 23 + test/rendering/nesting_class.mml | 26 + test/rendering/nesting_class.mss | 10 + test/rendering/nesting_class.result | 36 + test/rendering/nominzoom.mml | 14 + test/rendering/nominzoom.mss | 3 + test/rendering/nominzoom.result | 21 + test/rendering/noquote_font.mml | 14 + test/rendering/noquote_font.mss | 4 + test/rendering/noquote_font.result | 20 + test/rendering/parameters.mml | 24 + test/rendering/parameters.result | 23 + test/rendering/partial_overrides.mml | 15 + test/rendering/partial_overrides.mss | 35 + test/rendering/partial_overrides.result | 106 + test/rendering/raster-mesh-size.mml | 14 + test/rendering/raster-mesh-size.mss | 4 + test/rendering/raster-mesh-size.result | 21 + test/rendering/raster.mml | 14 + test/rendering/raster.mss | 4 + test/rendering/raster.result | 21 + test/rendering/raster_colorizer.mml | 14 + test/rendering/raster_colorizer.mss | 12 + test/rendering/raster_colorizer.result | 25 + test/rendering/raster_colorizer_comma.mml | 14 + test/rendering/raster_colorizer_comma.mss | 8 + test/rendering/raster_colorizer_comma.result | 25 + test/rendering/raster_colorizer_onestop.mml | 14 + test/rendering/raster_colorizer_onestop.mss | 7 + test/rendering/raster_colorizer_onestop.result | 21 + test/rendering/rastercolorizer.mml | 14 + test/rendering/rastercolorizer.mss | 10 + test/rendering/rastercolorizer.result | 23 + test/rendering/regex.mml | 14 + test/rendering/regex.mss | 5 + test/rendering/regex.result | 22 + test/rendering/regex_nest.mml | 14 + test/rendering/regex_nest.mss | 6 + test/rendering/regex_nest.result | 21 + test/rendering/selector_comment.mml | 21 + test/rendering/selector_comment.mss | 6 + test/rendering/selector_comment.result | 34 + test/rendering/sharedclass.mml | 28 + test/rendering/sharedclass.mss | 11 + test/rendering/sharedclass.result | 36 + test/rendering/simplefontset.mml | 14 + test/rendering/simplefontset.mss | 5 + test/rendering/simplefontset.result | 25 + test/rendering/simplevariabletest.mml | 14 + test/rendering/simplevariabletest.mss | 5 + test/rendering/simplevariabletest.result | 21 + test/rendering/style_fold.mml | 10 + test/rendering/style_fold.mss | 14 + test/rendering/style_fold.result | 20 + test/rendering/style_level_opacity.mml | 14 + test/rendering/style_level_opacity.mss | 6 + test/rendering/style_level_opacity.result | 23 + test/rendering/support4504.mml | 15 + test/rendering/support4504.mss | 7 + test/rendering/support4504.result | 21 + test/rendering/symbolizer_order.mml | 14 + test/rendering/symbolizer_order.mss | 4 + test/rendering/symbolizer_order.result | 22 + test/rendering/text_property_overrides.mml | 15 + test/rendering/text_property_overrides.mss | 9 + test/rendering/text_property_overrides.result | 40 + test/rendering/transforms.mml | 14 + test/rendering/transforms.mss | 7 + test/rendering/transforms.result | 21 + test/rendering/transforms_backwards.mml | 14 + test/rendering/transforms_backwards.mss | 4 + test/rendering/transforms_backwards.result | 20 + test/rendering/transforms_field.mml | 14 + test/rendering/transforms_field.mss | 4 + test/rendering/transforms_field.result | 20 + test/rendering/transforms_single.mml | 14 + test/rendering/transforms_single.mss | 3 + test/rendering/transforms_single.result | 20 + test/rendering/units.mml | 14 + test/rendering/units.mss | 6 + test/rendering/units.result | 22 + test/rendering/unsigned.mml | 14 + test/rendering/unsigned.mss | 8 + test/rendering/unsigned.result | 20 + test/rendering/var_concat.mml | 14 + test/rendering/var_concat.mss | 6 + test/rendering/var_concat.result | 20 + test/rendering/weird_comments.mml | 14 + test/rendering/weird_comments.mss | 12 + test/rendering/weird_comments.result | 19 + test/rendering/weird_comments_2.mml | 14 + test/rendering/weird_comments_2.mss | 7 + test/rendering/weird_comments_2.result | 25 + test/rendering/weird_simple_comments.mml | 14 + test/rendering/weird_simple_comments.mss | 1 + test/rendering/weird_simple_comments.result | 23 + test/rendering/zoomlevels.mml | 22 + test/rendering/zoomlevels.mss | 30 + test/rendering/zoomlevels.result | 108 + test/rendering/zoomselector.mml | 15 + test/rendering/zoomselector.mss | 6 + test/rendering/zoomselector.result | 32 + test/specificity.test.js | 60 + test/specificity/classes.mss | 7 + test/specificity/classes.result | 9 + test/specificity/demo.mss | 24 + test/specificity/demo.result | 10 + test/specificity/filters_and_ids.mss | 7 + test/specificity/filters_and_ids.result | 8 + test/specificity/issue60.mml | 14 + test/specificity/issue60.mss | 6 + test/specificity/issue60.result | 6 + test/support/.eslintrc.yml | 2 + test/support/diff.js | 189 + test/support/helper.js | 211 + test/version.test.js | 17 + 545 files changed, 59885 insertions(+) create mode 100644 .eslintrc.yml create mode 100644 .gitignore create mode 100644 .npmignore create mode 100644 .travis.yml create mode 100644 CHANGELOG.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 appveyor.yml create mode 100755 bin/carto create mode 100644 build/carto.tmbundle/Commands/preview.tmCommand create mode 100644 build/carto.tmbundle/Syntaxes/carto.tmLanguage create mode 100644 build/carto.tmbundle/Syntaxes/mml.tmLanguage create mode 100644 build/carto.tmbundle/info.plist create mode 100755 build/syntaxgenerate create mode 100644 build/tmlanguage_template.js create mode 100644 build/vim-carto/ftdetect/carto.vim create mode 100644 build/vim-carto/syntax/carto.vim create mode 100644 build/vimsyntax_template.js create mode 100644 docs/Makefile create mode 100644 docs/api/mapnik/2.0.0.rst create mode 100644 docs/api/mapnik/2.0.1.rst create mode 100644 docs/api/mapnik/2.0.2.rst create mode 100644 docs/api/mapnik/2.1.0.rst create mode 100644 docs/api/mapnik/2.1.1.rst create mode 100644 docs/api/mapnik/2.2.0.rst create mode 100644 docs/api/mapnik/2.3.0.rst create mode 100644 docs/api/mapnik/3.0.0.rst create mode 100644 docs/api/mapnik/3.0.20.rst create mode 100644 docs/api/mapnik/3.0.3.rst create mode 100644 docs/api/mapnik/3.0.6.rst create mode 100644 docs/conf.py create mode 100644 docs/generate.js create mode 100644 docs/index.rst create mode 100644 docs/installation_usage.rst create mode 100644 docs/language_elements.rst create mode 100644 docs/mapnik_api._ create mode 100644 docs/mapnik_api.rst create mode 100644 docs/mml.rst create mode 100644 docs/styling_concepts.rst create mode 100644 docs/symbolizers._ create mode 100644 lib/carto/functions.js create mode 100644 lib/carto/index.js create mode 100644 lib/carto/mml.js create mode 100644 lib/carto/parser.js create mode 100644 lib/carto/renderer.js create mode 100644 lib/carto/tree.js create mode 100644 lib/carto/tree/call.js create mode 100644 lib/carto/tree/color.js create mode 100644 lib/carto/tree/comment.js create mode 100644 lib/carto/tree/definition.js create mode 100644 lib/carto/tree/dimension.js create mode 100644 lib/carto/tree/element.js create mode 100644 lib/carto/tree/expression.js create mode 100644 lib/carto/tree/field.js create mode 100644 lib/carto/tree/filter.js create mode 100644 lib/carto/tree/filterset.js create mode 100644 lib/carto/tree/fontset.js create mode 100644 lib/carto/tree/imagefilter.js create mode 100644 lib/carto/tree/invalid.js create mode 100644 lib/carto/tree/keyword.js create mode 100644 lib/carto/tree/layer.js create mode 100644 lib/carto/tree/literal.js create mode 100644 lib/carto/tree/operation.js create mode 100644 lib/carto/tree/quoted.js create mode 100644 lib/carto/tree/reference.js create mode 100644 lib/carto/tree/rule.js create mode 100644 lib/carto/tree/ruleset.js create mode 100644 lib/carto/tree/selector.js create mode 100644 lib/carto/tree/style.js create mode 100644 lib/carto/tree/url.js create mode 100644 lib/carto/tree/value.js create mode 100644 lib/carto/tree/variable.js create mode 100644 lib/carto/tree/zoom.js create mode 100644 lib/carto/util.js create mode 100644 man/carto.1 create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 test/benchmark/opened.mml create mode 100644 test/benchmark/opened.mss create mode 100644 test/benchmark/opened.result create mode 100644 test/bincarto.test.js create mode 100644 test/color.test.js create mode 100644 test/comment.test.js create mode 100644 test/eclint.test.js create mode 100644 test/errorhandling.test.js create mode 100644 test/errorhandling/bad_filter.mml create mode 100644 test/errorhandling/bad_filter.mss create mode 100644 test/errorhandling/bad_filter.result create mode 100644 test/errorhandling/bad_op.mml create mode 100644 test/errorhandling/bad_op.mss create mode 100644 test/errorhandling/bad_op.result create mode 100644 test/errorhandling/bad_op_2.mml create mode 100644 test/errorhandling/bad_op_2.mss create mode 100644 test/errorhandling/bad_op_2.result create mode 100644 test/errorhandling/color_functions.mml create mode 100644 test/errorhandling/color_functions.mss create mode 100644 test/errorhandling/color_functions.result create mode 100644 test/errorhandling/contradiction.mml create mode 100644 test/errorhandling/contradiction.mss create mode 100644 test/errorhandling/contradiction.result create mode 100644 test/errorhandling/contradiction_2.mss create mode 100644 test/errorhandling/contradiction_2.result create mode 100644 test/errorhandling/function_args.mml create mode 100644 test/errorhandling/function_args.mss create mode 100644 test/errorhandling/function_args.result create mode 100644 test/errorhandling/invalid_attachment.mml create mode 100644 test/errorhandling/invalid_attachment.mss create mode 100644 test/errorhandling/invalid_attachment.result create mode 100644 test/errorhandling/invalid_color_in_fn.mss create mode 100644 test/errorhandling/invalid_color_in_fn.result create mode 100644 test/errorhandling/invalid_property.mml create mode 100644 test/errorhandling/invalid_property.mss create mode 100644 test/errorhandling/invalid_property.result create mode 100644 test/errorhandling/invalid_value.mml create mode 100644 test/errorhandling/invalid_value.mss create mode 100644 test/errorhandling/invalid_value.result create mode 100644 test/errorhandling/invaliddimension.mml create mode 100644 test/errorhandling/invaliddimension.mss create mode 100644 test/errorhandling/invaliddimension.result create mode 100644 test/errorhandling/issue119.mml create mode 100644 test/errorhandling/issue119.mss create mode 100644 test/errorhandling/issue119.result create mode 100644 test/errorhandling/issue123.mml create mode 100644 test/errorhandling/issue123.mss create mode 100644 test/errorhandling/issue123.result create mode 100644 test/errorhandling/issue124.mml create mode 100644 test/errorhandling/issue124.mss create mode 100644 test/errorhandling/issue124.result create mode 100644 test/errorhandling/issue165.mml create mode 100644 test/errorhandling/issue165.result create mode 100644 test/errorhandling/issue297.mml create mode 100644 test/errorhandling/issue297.mss create mode 100644 test/errorhandling/issue297.result create mode 100644 test/errorhandling/issue_204_a.mss create mode 100644 test/errorhandling/issue_204_a.result create mode 100644 test/errorhandling/issue_204_b.mss create mode 100644 test/errorhandling/issue_204_b.result create mode 100644 test/errorhandling/issue_204_c.mss create mode 100644 test/errorhandling/issue_204_c.result create mode 100644 test/errorhandling/issue_218.mss create mode 100644 test/errorhandling/issue_218.result create mode 100644 test/errorhandling/issue_29.mml create mode 100644 test/errorhandling/issue_29.mss create mode 100644 test/errorhandling/issue_29.result create mode 100644 test/errorhandling/issue_462.mss create mode 100644 test/errorhandling/issue_462.result create mode 100644 test/errorhandling/issue_474.mss create mode 100644 test/errorhandling/issue_474.result create mode 100644 test/errorhandling/mapnik_keyword.mml create mode 100644 test/errorhandling/mapnik_keyword.mss create mode 100644 test/errorhandling/mapnik_keyword.result create mode 100644 test/errorhandling/missing_close.mml create mode 100644 test/errorhandling/missing_close.mss create mode 100644 test/errorhandling/missing_close.result create mode 100644 test/errorhandling/multi_stylesheets.mml create mode 100644 test/errorhandling/multi_stylesheets.result create mode 100644 test/errorhandling/multi_stylesheets_a.mss create mode 100644 test/errorhandling/multi_stylesheets_b.mss create mode 100644 test/errorhandling/multi_stylesheets_b.result create mode 100644 test/errorhandling/no_stylesheet.mml create mode 100644 test/errorhandling/no_stylesheet.result create mode 100644 test/errorhandling/nopound.mml create mode 100644 test/errorhandling/nopound.mss create mode 100644 test/errorhandling/nopound.result create mode 100644 test/errorhandling/notenoughargs.mml create mode 100644 test/errorhandling/notenoughargs.mss create mode 100644 test/errorhandling/notenoughargs.result create mode 100644 test/errorhandling/stylesheet_absolute_file.mml create mode 100644 test/errorhandling/stylesheet_absolute_file.result create mode 100644 test/errorhandling/stylesheet_absolute_file_syswin.result create mode 100644 test/errorhandling/stylesheet_no_data.mml create mode 100644 test/errorhandling/stylesheet_no_data.result create mode 100644 test/errorhandling/stylesheet_no_id.mml create mode 100644 test/errorhandling/stylesheet_no_id.result create mode 100644 test/errorhandling/undefined_variable.mml create mode 100644 test/errorhandling/undefined_variable.mss create mode 100644 test/errorhandling/undefined_variable.result create mode 100644 test/errorhandling/zoom_as_var.mml create mode 100644 test/errorhandling/zoom_as_var.mss create mode 100644 test/errorhandling/zoom_as_var.result create mode 100644 test/errorhandling/zoommax.mml create mode 100644 test/errorhandling/zoommax.mss create mode 100644 test/errorhandling/zoommax.result create mode 100644 test/field.test.js create mode 100644 test/filter.test.js create mode 100644 test/filterset.test.js create mode 100644 test/operation.test.js create mode 100644 test/quoted.test.js create mode 100644 test/reference.test.js create mode 100644 test/rendering-mss.test.js create mode 100644 test/rendering-mss/basic_attachment_internal.mss create mode 100644 test/rendering-mss/basic_attachment_internal.xml create mode 100644 test/rendering-mss/basic_attachment_internal_before.mss create mode 100644 test/rendering-mss/basic_attachment_internal_before.xml create mode 100644 test/rendering-mss/basic_attachment_internal_before_and_after.mss create mode 100644 test/rendering-mss/basic_attachment_internal_before_and_after.xml create mode 100644 test/rendering-mss/basic_attachment_internal_double.mss create mode 100644 test/rendering-mss/basic_attachment_internal_double.xml create mode 100644 test/rendering-mss/basic_attachment_internal_with_label.mss create mode 100644 test/rendering-mss/basic_attachment_internal_with_label.xml create mode 100644 test/rendering-mss/basic_attachment_separate.mss create mode 100644 test/rendering-mss/basic_attachment_separate.xml create mode 100644 test/rendering-mss/basic_attachment_separate_before.mss create mode 100644 test/rendering-mss/basic_attachment_separate_before.xml create mode 100644 test/rendering-mss/basic_attachment_separate_before_and_after.mss create mode 100644 test/rendering-mss/basic_attachment_separate_before_and_after.xml create mode 100644 test/rendering-mss/basic_attachment_separate_double.mss create mode 100644 test/rendering-mss/basic_attachment_separate_double.xml create mode 100644 test/rendering-mss/basic_attachment_separate_with_label.mss create mode 100644 test/rendering-mss/basic_attachment_separate_with_label.xml create mode 100644 test/rendering-mss/color_functions.mss create mode 100644 test/rendering-mss/color_functions.xml create mode 100644 test/rendering-mss/empty_name.mss create mode 100644 test/rendering-mss/empty_name.xml create mode 100644 test/rendering-mss/image-filters.mss create mode 100644 test/rendering-mss/image-filters.xml create mode 100644 test/rendering-mss/issue_121.mss create mode 100644 test/rendering-mss/issue_121.xml create mode 100644 test/rendering-mss/issue_197.mss create mode 100644 test/rendering-mss/issue_197.xml create mode 100644 test/rendering-mss/issue_214.mss create mode 100644 test/rendering-mss/issue_214.xml create mode 100644 test/rendering-mss/issue_232.mss create mode 100644 test/rendering-mss/issue_232.xml create mode 100644 test/rendering-mss/issue_247_1.mss create mode 100644 test/rendering-mss/issue_247_1.xml create mode 100644 test/rendering-mss/issue_247_2.mss create mode 100644 test/rendering-mss/issue_247_2.xml create mode 100644 test/rendering-mss/issue_284.mss create mode 100644 test/rendering-mss/issue_284.xml create mode 100644 test/rendering-mss/issue_284_b.mss create mode 100644 test/rendering-mss/issue_284_b.xml create mode 100644 test/rendering-mss/issue_284_c.mss create mode 100644 test/rendering-mss/issue_284_c.xml create mode 100644 test/rendering-mss/issue_303.mss create mode 100644 test/rendering-mss/issue_303.xml create mode 100644 test/rendering-mss/issue_339.mss create mode 100644 test/rendering-mss/issue_339.xml create mode 100644 test/rendering-mss/issue_339b.mss create mode 100644 test/rendering-mss/issue_339b.xml create mode 100644 test/rendering-mss/issue_370.mss create mode 100644 test/rendering-mss/issue_370.xml create mode 100644 test/rendering-mss/issue_370_b.mss create mode 100644 test/rendering-mss/issue_370_b.xml create mode 100644 test/rendering-mss/issue_377.mss create mode 100644 test/rendering-mss/issue_377.xml create mode 100644 test/rendering-mss/issue_443.mss create mode 100644 test/rendering-mss/issue_443.xml create mode 100644 test/rendering-mss/issue_462.mss create mode 100644 test/rendering-mss/issue_462.xml create mode 100644 test/rendering-mss/issue_462a.mss create mode 100644 test/rendering-mss/issue_462a.xml create mode 100644 test/rendering-mss/issue_462b.mss create mode 100644 test/rendering-mss/issue_462b.xml create mode 100644 test/rendering-mss/line-width-zoom.mss create mode 100644 test/rendering-mss/line-width-zoom.xml create mode 100644 test/rendering-mss/quoted_attr.mss create mode 100644 test/rendering-mss/quoted_attr.xml create mode 100644 test/rendering-mss/scale-hsla-filter.mss create mode 100644 test/rendering-mss/scale-hsla-filter.xml create mode 100644 test/rendering-mss/should-discard-empty-style-and-attach.mss create mode 100644 test/rendering-mss/should-discard-empty-style-and-attach.xml create mode 100644 test/rendering-mss/should-discard-empty-style.mss create mode 100644 test/rendering-mss/should-discard-empty-style.xml create mode 100644 test/rendering-mss/should-discard-empty-style2.mss create mode 100644 test/rendering-mss/should-discard-empty-style2.xml create mode 100644 test/rendering-mss/style-level-prop-only.mss create mode 100644 test/rendering-mss/style-level-prop-only.xml create mode 100644 test/rendering-mss/style-level-prop-only2.mss create mode 100644 test/rendering-mss/style-level-prop-only2.xml create mode 100644 test/rendering-mss/style-level-prop-only3.mss create mode 100644 test/rendering-mss/style-level-prop-only3.xml create mode 100644 test/rendering-mss/text-face-name-escaping.mss create mode 100644 test/rendering-mss/text-face-name-escaping.xml create mode 100644 test/rendering-mss/variable-quoting-of-enum.mss create mode 100644 test/rendering-mss/variable-quoting-of-enum.xml create mode 100644 test/rendering-mss/zoom-like-field-name.mss create mode 100644 test/rendering-mss/zoom-like-field-name.xml create mode 100644 test/rendering-mss/zoom_space.mss create mode 100644 test/rendering-mss/zoom_space.xml create mode 100644 test/rendering.test.js create mode 100644 test/rendering/afghanistan_votes.mml create mode 100644 test/rendering/afghanistan_votes.mss create mode 100644 test/rendering/afghanistan_votes.result create mode 100644 test/rendering/background_attributes.mml create mode 100644 test/rendering/background_attributes.mss create mode 100644 test/rendering/background_attributes.result create mode 100644 test/rendering/buffersize.mml create mode 100644 test/rendering/buffersize.mss create mode 100644 test/rendering/buffersize.result create mode 100644 test/rendering/building_height.mml create mode 100644 test/rendering/building_height.mss create mode 100644 test/rendering/building_height.result create mode 100644 test/rendering/combined_class.mml create mode 100644 test/rendering/combined_class.mss create mode 100644 test/rendering/combined_class.result create mode 100644 test/rendering/complex_cascades.mml create mode 100644 test/rendering/complex_cascades.mss create mode 100644 test/rendering/complex_cascades.result create mode 100644 test/rendering/complexfontset.mml create mode 100644 test/rendering/complexfontset.mss create mode 100644 test/rendering/complexfontset.result create mode 100644 test/rendering/cross_stylesheet_variable.mml create mode 100644 test/rendering/cross_stylesheet_variable.result create mode 100644 test/rendering/cross_stylesheet_variable_a.mss create mode 100644 test/rendering/cross_stylesheet_variable_b.mss create mode 100644 test/rendering/data_only.mml create mode 100644 test/rendering/data_only.result create mode 100644 test/rendering/empty_style.mml create mode 100644 test/rendering/empty_style.mss create mode 100644 test/rendering/empty_style.result create mode 100644 test/rendering/empty_url.mml create mode 100644 test/rendering/empty_url.mss create mode 100644 test/rendering/empty_url.result create mode 100644 test/rendering/external_image.mml create mode 100644 test/rendering/external_image.mss create mode 100644 test/rendering/external_image.result create mode 100644 test/rendering/fadeout.mml create mode 100644 test/rendering/fadeout.mss create mode 100644 test/rendering/fadeout.result create mode 100644 test/rendering/field.mml create mode 100644 test/rendering/field.mss create mode 100644 test/rendering/field.result create mode 100644 test/rendering/field_advanced.mml create mode 100644 test/rendering/field_advanced.mss create mode 100644 test/rendering/field_advanced.result create mode 100644 test/rendering/filter_comparing_fields.mml create mode 100644 test/rendering/filter_comparing_fields.mss create mode 100644 test/rendering/filter_comparing_fields.result create mode 100644 test/rendering/filterexp.mml create mode 100644 test/rendering/filterexp.mss create mode 100644 test/rendering/filterexp.result create mode 100644 test/rendering/filterquote.mml create mode 100644 test/rendering/filterquote.mss create mode 100644 test/rendering/filterquote.result create mode 100644 test/rendering/filters.mml create mode 100644 test/rendering/filters.mss create mode 100644 test/rendering/filters.result create mode 100644 test/rendering/filtervariable.mml create mode 100644 test/rendering/filtervariable.mss create mode 100644 test/rendering/filtervariable.result create mode 100644 test/rendering/filtervariable2.mml create mode 100644 test/rendering/filtervariable2.mss create mode 100644 test/rendering/filtervariable2.result create mode 100644 test/rendering/fontset-duplication.mml create mode 100644 test/rendering/fontset-duplication.mss create mode 100644 test/rendering/fontset-duplication.result create mode 100644 test/rendering/gray_function.mml create mode 100644 test/rendering/gray_function.mss create mode 100644 test/rendering/gray_function.result create mode 100644 test/rendering/highzooms.mml create mode 100644 test/rendering/highzooms.mss create mode 100644 test/rendering/highzooms.result create mode 100644 test/rendering/identity.mml create mode 100644 test/rendering/identity.mss create mode 100644 test/rendering/identity.result create mode 100644 test/rendering/image_filters.mml create mode 100644 test/rendering/image_filters.mss create mode 100644 test/rendering/image_filters.result create mode 100644 test/rendering/imagefilter-duplication.mml create mode 100644 test/rendering/imagefilter-duplication.mss create mode 100644 test/rendering/imagefilter-duplication.result create mode 100644 test/rendering/instance_names.mml create mode 100644 test/rendering/instance_names.mss create mode 100644 test/rendering/instance_names.result create mode 100644 test/rendering/issue294.mml create mode 100644 test/rendering/issue294.result create mode 100644 test/rendering/issue32.mml create mode 100644 test/rendering/issue32.mss create mode 100644 test/rendering/issue32.result create mode 100644 test/rendering/issue32a.mss create mode 100644 test/rendering/issue60.mml create mode 100644 test/rendering/issue60.mss create mode 100644 test/rendering/issue60.result create mode 100644 test/rendering/issue_100_filters.mml create mode 100644 test/rendering/issue_100_filters.mss create mode 100644 test/rendering/issue_100_filters.result create mode 100644 test/rendering/issue_121.mml create mode 100644 test/rendering/issue_121.mss create mode 100644 test/rendering/issue_121.result create mode 100644 test/rendering/issue_239.mml create mode 100644 test/rendering/issue_239.result create mode 100644 test/rendering/issue_239_a.mss create mode 100644 test/rendering/issue_239_b.mss create mode 100644 test/rendering/issue_273.mml create mode 100644 test/rendering/issue_273.mss create mode 100644 test/rendering/issue_273.result create mode 100644 test/rendering/issue_291.mml create mode 100644 test/rendering/issue_291.mss create mode 100644 test/rendering/issue_291.result create mode 100644 test/rendering/issue_296.mml create mode 100644 test/rendering/issue_296.mss create mode 100644 test/rendering/issue_296.result create mode 100644 test/rendering/issue_333.mml create mode 100644 test/rendering/issue_333.mss create mode 100644 test/rendering/issue_333.result create mode 100644 test/rendering/issue_338.mml create mode 100644 test/rendering/issue_338.mss create mode 100644 test/rendering/issue_338.result create mode 100644 test/rendering/issue_348.mml create mode 100644 test/rendering/issue_348.result create mode 100644 test/rendering/issue_394.mss create mode 100644 test/rendering/issue_394_api2.3.0.mml create mode 100644 test/rendering/issue_394_api2.3.0.result create mode 100644 test/rendering/issue_394_api3.0.0.mml create mode 100644 test/rendering/issue_394_api3.0.0.result create mode 100644 test/rendering/issue_411.mml create mode 100644 test/rendering/issue_411.mss create mode 100644 test/rendering/issue_411.result create mode 100644 test/rendering/issue_450.mml create mode 100644 test/rendering/issue_450.result create mode 100644 test/rendering/issue_469.mml create mode 100644 test/rendering/issue_469.mss create mode 100644 test/rendering/issue_469.result create mode 100644 test/rendering/layer_nodatasource.mml create mode 100644 test/rendering/layer_nodatasource.mss create mode 100644 test/rendering/layer_nodatasource.result create mode 100644 test/rendering/layer_properties.mml create mode 100644 test/rendering/layer_properties.mss create mode 100644 test/rendering/layer_properties.result create mode 100644 test/rendering/mapnik_keyword.mml create mode 100644 test/rendering/mapnik_keyword.mss create mode 100644 test/rendering/mapnik_keyword.result create mode 100644 test/rendering/modulus.mml create mode 100644 test/rendering/modulus.mss create mode 100644 test/rendering/modulus.result create mode 100644 test/rendering/multiple_symbolizers.mml create mode 100644 test/rendering/multiple_symbolizers.mss create mode 100644 test/rendering/multiple_symbolizers.result create mode 100644 test/rendering/nesting_class.mml create mode 100644 test/rendering/nesting_class.mss create mode 100644 test/rendering/nesting_class.result create mode 100644 test/rendering/nominzoom.mml create mode 100644 test/rendering/nominzoom.mss create mode 100644 test/rendering/nominzoom.result create mode 100644 test/rendering/noquote_font.mml create mode 100644 test/rendering/noquote_font.mss create mode 100644 test/rendering/noquote_font.result create mode 100644 test/rendering/parameters.mml create mode 100644 test/rendering/parameters.result create mode 100644 test/rendering/partial_overrides.mml create mode 100644 test/rendering/partial_overrides.mss create mode 100644 test/rendering/partial_overrides.result create mode 100644 test/rendering/raster-mesh-size.mml create mode 100644 test/rendering/raster-mesh-size.mss create mode 100644 test/rendering/raster-mesh-size.result create mode 100644 test/rendering/raster.mml create mode 100644 test/rendering/raster.mss create mode 100644 test/rendering/raster.result create mode 100644 test/rendering/raster_colorizer.mml create mode 100644 test/rendering/raster_colorizer.mss create mode 100644 test/rendering/raster_colorizer.result create mode 100644 test/rendering/raster_colorizer_comma.mml create mode 100644 test/rendering/raster_colorizer_comma.mss create mode 100644 test/rendering/raster_colorizer_comma.result create mode 100644 test/rendering/raster_colorizer_onestop.mml create mode 100644 test/rendering/raster_colorizer_onestop.mss create mode 100644 test/rendering/raster_colorizer_onestop.result create mode 100644 test/rendering/rastercolorizer.mml create mode 100644 test/rendering/rastercolorizer.mss create mode 100644 test/rendering/rastercolorizer.result create mode 100644 test/rendering/regex.mml create mode 100644 test/rendering/regex.mss create mode 100644 test/rendering/regex.result create mode 100644 test/rendering/regex_nest.mml create mode 100644 test/rendering/regex_nest.mss create mode 100644 test/rendering/regex_nest.result create mode 100644 test/rendering/selector_comment.mml create mode 100644 test/rendering/selector_comment.mss create mode 100644 test/rendering/selector_comment.result create mode 100644 test/rendering/sharedclass.mml create mode 100644 test/rendering/sharedclass.mss create mode 100644 test/rendering/sharedclass.result create mode 100644 test/rendering/simplefontset.mml create mode 100644 test/rendering/simplefontset.mss create mode 100644 test/rendering/simplefontset.result create mode 100644 test/rendering/simplevariabletest.mml create mode 100644 test/rendering/simplevariabletest.mss create mode 100644 test/rendering/simplevariabletest.result create mode 100644 test/rendering/style_fold.mml create mode 100644 test/rendering/style_fold.mss create mode 100644 test/rendering/style_fold.result create mode 100644 test/rendering/style_level_opacity.mml create mode 100644 test/rendering/style_level_opacity.mss create mode 100644 test/rendering/style_level_opacity.result create mode 100644 test/rendering/support4504.mml create mode 100644 test/rendering/support4504.mss create mode 100644 test/rendering/support4504.result create mode 100644 test/rendering/symbolizer_order.mml create mode 100644 test/rendering/symbolizer_order.mss create mode 100644 test/rendering/symbolizer_order.result create mode 100644 test/rendering/text_property_overrides.mml create mode 100644 test/rendering/text_property_overrides.mss create mode 100644 test/rendering/text_property_overrides.result create mode 100644 test/rendering/transforms.mml create mode 100644 test/rendering/transforms.mss create mode 100644 test/rendering/transforms.result create mode 100644 test/rendering/transforms_backwards.mml create mode 100644 test/rendering/transforms_backwards.mss create mode 100644 test/rendering/transforms_backwards.result create mode 100644 test/rendering/transforms_field.mml create mode 100644 test/rendering/transforms_field.mss create mode 100644 test/rendering/transforms_field.result create mode 100644 test/rendering/transforms_single.mml create mode 100644 test/rendering/transforms_single.mss create mode 100644 test/rendering/transforms_single.result create mode 100644 test/rendering/units.mml create mode 100644 test/rendering/units.mss create mode 100644 test/rendering/units.result create mode 100644 test/rendering/unsigned.mml create mode 100644 test/rendering/unsigned.mss create mode 100644 test/rendering/unsigned.result create mode 100644 test/rendering/var_concat.mml create mode 100644 test/rendering/var_concat.mss create mode 100644 test/rendering/var_concat.result create mode 100644 test/rendering/weird_comments.mml create mode 100644 test/rendering/weird_comments.mss create mode 100644 test/rendering/weird_comments.result create mode 100644 test/rendering/weird_comments_2.mml create mode 100644 test/rendering/weird_comments_2.mss create mode 100644 test/rendering/weird_comments_2.result create mode 100644 test/rendering/weird_simple_comments.mml create mode 100644 test/rendering/weird_simple_comments.mss create mode 100644 test/rendering/weird_simple_comments.result create mode 100644 test/rendering/zoomlevels.mml create mode 100644 test/rendering/zoomlevels.mss create mode 100644 test/rendering/zoomlevels.result create mode 100644 test/rendering/zoomselector.mml create mode 100644 test/rendering/zoomselector.mss create mode 100644 test/rendering/zoomselector.result create mode 100644 test/specificity.test.js create mode 100644 test/specificity/classes.mss create mode 100644 test/specificity/classes.result create mode 100644 test/specificity/demo.mss create mode 100644 test/specificity/demo.result create mode 100644 test/specificity/filters_and_ids.mss create mode 100644 test/specificity/filters_and_ids.result create mode 100644 test/specificity/issue60.mml create mode 100644 test/specificity/issue60.mss create mode 100644 test/specificity/issue60.result create mode 100644 test/support/.eslintrc.yml create mode 100644 test/support/diff.js create mode 100644 test/support/helper.js create mode 100644 test/version.test.js diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 0000000..6079c82 --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,195 @@ +parserOptions: + ecmaVersion: 5 + sourceType: module +env: + browser: true + node: true + mocha: true +extends: 'eslint:recommended' +rules: + accessor-pairs: 2 + array-bracket-spacing: 0 + array-callback-return: 2 + arrow-body-style: 2 + arrow-parens: 2 + arrow-spacing: 2 + block-scoped-var: 0 + block-spacing: + - 2 + - always + brace-style: 0 + callback-return: 2 + camelcase: 0 + comma-spacing: 0 + comma-style: + - 2 + - last + complexity: 0 + computed-property-spacing: 0 + consistent-return: 0 + consistent-this: 2 + curly: 0 + default-case: 0 + dot-location: + - 2 + - property + dot-notation: 0 + eol-last: 2 + eqeqeq: 0 + func-names: 0 + func-style: 0 + generator-star-spacing: 2 + global-require: 0 + guard-for-in: 0 + handle-callback-err: 2 + id-blacklist: 2 + id-length: 0 + id-match: 2 + indent: 0 + init-declarations: 0 + jsx-quotes: 2 + key-spacing: 0 + keyword-spacing: + - 2 + - after: true + before: true + linebreak-style: + - 2 + - unix + lines-around-comment: 2 + max-depth: 0 + max-len: 0 + max-nested-callbacks: 2 + max-params: 0 + new-parens: 2 + newline-after-var: 0 + newline-per-chained-call: 0 + no-alert: 2 + no-array-constructor: 2 + no-bitwise: 0 + no-caller: 2 + no-cond-assign: + - 2 + - except-parens + no-confusing-arrow: 2 + no-console: 0 + no-continue: 0 + no-div-regex: 2 + no-else-return: 0 + no-empty-function: 0 + no-eq-null: 2 + no-eval: 2 + no-extend-native: 2 + no-extra-bind: 2 + no-extra-label: 2 + no-extra-parens: 0 + no-floating-decimal: 2 + no-implicit-globals: 0 + no-implied-eval: 2 + no-inline-comments: 0 + no-inner-declarations: + - 2 + - functions + no-invalid-this: 2 + no-iterator: 2 + no-label-var: 2 + no-labels: 2 + no-lone-blocks: 2 + no-lonely-if: 0 + no-loop-func: 0 + no-magic-numbers: 0 + no-mixed-requires: 0 + no-multi-spaces: 0 + no-multi-str: 2 + no-multiple-empty-lines: + - 2 + - max: 3 + no-native-reassign: 2 + no-negated-condition: 0 + no-nested-ternary: 0 + no-new: 2 + no-new-func: 2 + no-new-object: 2 + no-new-require: 2 + no-new-wrappers: 2 + no-octal-escape: 0 + no-param-reassign: 0 + no-path-concat: 2 + no-plusplus: 0 + no-process-env: 2 + no-process-exit: 2 + no-proto: 2 + no-restricted-imports: 2 + no-restricted-modules: 2 + no-restricted-syntax: 2 + no-return-assign: 0 + no-script-url: 2 + no-self-compare: 2 + no-sequences: 0 + no-shadow: 0 + no-shadow-restricted-names: 2 + no-spaced-func: 0 + no-sync: 0 + no-ternary: 0 + no-throw-literal: 2 + no-trailing-spaces: 2 + no-undef-init: 2 + no-undefined: 0 + no-underscore-dangle: 0 + no-unmodified-loop-condition: 0 + no-unneeded-ternary: + - 2 + - defaultAssignment: true + no-unused-expressions: 0 + no-use-before-define: 0 + no-useless-call: 2 + no-useless-concat: 2 + no-useless-constructor: 2 + no-var: 0 + no-void: 2 + no-warning-comments: 0 + no-whitespace-before-property: 2 + no-with: 2 + object-curly-spacing: 0 + object-shorthand: 0 + one-var: 0 + one-var-declaration-per-line: 0 + operator-assignment: 0 + operator-linebreak: 0 + padded-blocks: 0 + prefer-arrow-callback: 0 + prefer-const: 2 + prefer-reflect: 0 + prefer-rest-params: 0 + prefer-spread: 0 + prefer-template: 0 + quote-props: 0 + quotes: 0 + radix: + - 2 + - always + require-jsdoc: 0 + require-yield: 2 + semi: 0 + semi-spacing: + - 2 + - after: true + before: false + sort-imports: 2 + sort-vars: 0 + space-before-blocks: 0 + space-before-function-paren: 0 + space-in-parens: 0 + space-infix-ops: 0 + space-unary-ops: 0 + spaced-comment: 0 + strict: + - 2 + - never + template-curly-spacing: 2 + valid-jsdoc: 0 + vars-on-top: 0 + wrap-regex: 0 + yield-star-spacing: 2 + yoda: 0 + no-useless-escape: 0 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8380543 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +**/node_modules +.DS_Store +test/rendering/layers/ +test/rendering/cache/ +test/rendering-mss/npm-debug.log +docs/_build/ diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..6a0918e --- /dev/null +++ b/.npmignore @@ -0,0 +1,3 @@ +*.swp +npm_modules/ +test/ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..a77d3b9 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,13 @@ +language: node_js + +sudo: false + +node_js: + - "11" + - "10" + - "8" + - "6" + +script: + - npm test + - if [[ ${TRAVIS_NODE_VERSION} == "8" ]]; then npm run coverage; fi; diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..fc9ba3a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,365 @@ +# Changelog + +## 1.2.0 + +* Update dependencies +* Update mapnik-reference to support new Mapnik API version ([#498](https://github.com/mapbox/carto/issues/498)) + +## 1.1.0 + +* Update dependencies +* Update mapnik-reference to support new Mapnik API version ([#494](https://github.com/mapbox/carto/issues/494)) + +## 1.0.1 + +* Fix a error in the serialization process. ([#473](https://github.com/mapbox/carto/issues/488)) + +## 1.0.0 + +* Documentation is now available on https://cartocss.readthedocs.io. ([#473](https://github.com/mapbox/carto/issues/473)) +* Warnings are emitted if properties are used that are `deprecated`, `unstable` or `experimental`. +There is a new command line / API switch (`-q / --quiet` / `quiet`) to suppress those warnings. ([#474](https://github.com/mapbox/carto/issues/474)) +* Warnings are emitted if a layer has no associated styles or styles do not match a corresponding layer selector. ([#29](https://github.com/mapbox/carto/issues/29)) +* New command line switch `-f / --file` to specify a file for output instead of `stdout`. +* carto now honors variable redefinition and uses the last defined value instead of the first one ([#338](https://github.com/mapbox/carto/issues/338)). +* All parameters of XML tags are now ouput in alphabetical order. This makes output more predictable. +* carto is now able to output a JSON variant of Mapnik XML. There is a new command line / API switch +(`-o / --output` / `outputFormat`) to choose the output format. Possible values are `mapnik` (default) +for Mapnik XML and `json` for the JSON variant (part of [#413](https://github.com/mapbox/carto/issues/413)). +For Mapnik XML all character data as tag content is now prefixed with CDATA. +* Expressions are allowed in filters e.g. `[height] % 50 = 0` or `[height] + 10 = 0`, fields have to be properly written within brackets +([#377](https://github.com/mapbox/carto/issues/377)) +* carto now accepts custom references for validating rules (part of [#413](https://github.com/mapbox/carto/issues/413)) +* The JavaScript API has been documented ([#479](https://github.com/mapbox/carto/issues/479)) +* New symbolizer rules (work on the whole symbolizer) enable control of symbolizer serialization. Write e.g. `line: none` to suppress output +of the line symbolizer for this definition. Write e.g. `marker: auto` to output a markers symbolizer with default values. Symbolizer rules +are considered an advanced features and are never inherited to other definitions ([#477](https://github.com/mapbox/carto/pull/477)). +* Remove `millstone` from optional dependencies again ([#482](https://github.com/mapbox/carto/issues/482)). + +### Breaking changes + +#### Stylesheets + +* The deprecated `name` attribute for layers is no longer supported. Use `id` instead. +* The deprecated color functions `husl` and `husla` are no longer supported. Use `hsluv` and `hsluva` instead. +* If you define a variable with the same name twice the latest defined value is now used in contrast to the first defined one as before. +* All parameters of XML tags are now ouput in alphabetical order. If you somehow depend on the order +of parameters (e.g. for tests) expect them to change. + +#### API + +* `carto.Renderer.render` and `carto.Renderer.renderMSS` now return an object `{ msg: Array, data: String }` instead of just a +string. `data` contains the output as before and `msg` now contains an array of error or warning objects. +In case of errors `data` is `null`. +* carto now only throws errors in case of program failures. All other style processing +related errors can be found in the `msg` property (see above). +* The constructor of `carto.Renderer` now only takes one options object +instead of a `env` and `options` parameter. +* The option `mapnik_version` and `validation_data` of `carto.Renderer` have +been renamed to `version` and `validationData` respectively. +* `carto.Renderer` now checks each option before forwarding them to the rendering +chain. Supported options are defined in the documentation. If you use a option that is +missing please open a issue. + +## 0.18.2 + +* Remove `millstone` from optional dependencies again + +## 0.18.1 + +* Updated `mapnik-reference` to fix an install problem for some Node.js versions +* Backported documentation updates + +## 0.18.0 + +* Compile time performance improvement by leaving out rules that do not apply to layer minzoom and maxzoom restrictions if specified ([#469](https://github.com/mapbox/carto/issues/469)) +* Confirmed that [#348](https://github.com/mapbox/carto/issues/348) does not occur (anymore) +* Updated dependencies + +## 0.17.3 + +* Fix regression with number parsing after fixing of [#411](https://github.com/mapbox/carto/issues/411) ([#471](https://github.com/mapbox/carto/issues/471)) + +## 0.17.2 + +* Remove unintended scoping of package. It is now again `carto`. The NPM requirement is dropped. +* Variables in font definitions are now processed correctly ([#333](https://github.com/mapbox/carto/issues/333)) +* Display a better error for missing fonts on font name validation ([#242](https://github.com/mapbox/carto/issues/242)) +* Some properties can now be reset to their default value by using `none` ([#214](https://github.com/mapbox/carto/issues/214)) + +## 0.17.1 + +* Revert fix for [#315](https://github.com/mapbox/carto/issues/315) due to performance problems ([#466](https://github.com/mapbox/carto/issues/466)) + +## 0.17.0 + +* Carto is now a scoped package named `@mapbox/carto`. Scoped packages require NPM >= 1.5. ([#457](https://github.com/mapbox/carto/pull/457)) +* Carto now runs in the browser too (part of [#413](https://github.com/mapbox/carto/issues/413)) +* Carto can now load MML itself and supports absolute file paths in MML stylesheet references ([#439](https://github.com/mapbox/carto/pull/439)) +* The target API default of Mapnik moved from 2.3.0 to being always the latest version (3.0.x). Take that into account if you run a Mapnik 2.x instance (see also the `-a/--api` command line option). +([#454](https://github.com/mapbox/carto/issues/454)) +* `husl()` was renamed to `hsluv()`. The HuSL variant is deprecated and will be removed in 1.0.0. ([#456](https://github.com/mapbox/carto/issues/456)) +* The `name` attribute for layers in the MML is deprecated and will be removed in 1.0.0. Use `id` instead. ([#165](https://github.com/mapbox/carto/issues/165)) +* The `_properties` object in the MML of vector tiles projects is now supported ([#450](https://github.com/mapbox/carto/issues/450)) +* Updated `mapnik-reference` to 8.6.1, which enables Browser support and support for the `transform` property of PolygonPatternSymbolizer ([#445](https://github.com/mapbox/carto/issues/445)) +* Bugfixes ([#296](https://github.com/mapbox/carto/issues/296), [#121](https://github.com/mapbox/carto/issues/121), [#315](https://github.com/mapbox/carto/issues/315), [#411](https://github.com/mapbox/carto/issues/411), [#426](https://github.com/mapbox/carto/issues/426), [#273](https://github.com/mapbox/carto/issues/273)) +* Documentation updates ([#269](https://github.com/mapbox/carto/issues/269), [#452](https://github.com/mapbox/carto/issues/452)) + +## 0.16.3 + +* Fixed outdated library reference for carto help screen ([#444](https://github.com/mapbox/carto/pull/443)) +* Fixed a regression related to color math with non-color values being interpreted as HSL instead of RGB ([#446](https://github.com/mapbox/carto/issues/446)) + +## 0.16.2 + +* Fixed a regression related to color math ([#443](https://github.com/mapbox/carto/issues/443)) + +## 0.16.1 + +* Fixed a regression related to the color mix function ([#442](https://github.com/mapbox/carto/issues/442)) + +## 0.16.0 + +* Fixed a bug related to parsing numerical selectors ([#393](https://github.com/mapbox/carto/pull/393)) +* More meaningful error messages on erroneous Stylesheet references in MML ([#438](https://github.com/mapbox/carto/pull/438)) +* Added support for YAML MML files ([#419](https://github.com/mapbox/carto/pull/419)) +* Added support for [HuSL](http://www.husl-colors.org) perceptual colors ([#422](https://github.com/mapbox/carto/pull/422)) +* Added support for targeting Mapnik API versions in `carto` command line tool ([#433](https://github.com/mapbox/carto/pull/433)) +* Added support for `minimum-/maximum-scale-denominator` ([#394](https://github.com/mapbox/carto/issues/394)) +* Updated documentation, fixed its display problems and added doc for `image-filter` ([#432](https://github.com/mapbox/carto/pull/432)) +* Moved from `underscore` to `lodash` dependency ([#431](https://github.com/mapbox/carto/pull/431)) +* Moved from `optimist` to `yargs` dependency ([#435](https://github.com/mapbox/carto/pull/435)) +* Bump `mapnik-reference` dependency to 8.5.3 (support for Mapnik 3.0.10) +* Modernized development dependencies +* Further small fixes and improvements for development. + +## 0.15.3 + +* Support for Mapnik 3.0.6 + +## 0.15.2 + +* Support for Mapnik 3.0.5 + +## 0.15.1 + +* Support for Mapnik 3.0.4 + +## 0.15.0 + +* Support for Mapnik 3.0.3 + +## 0.14.1 + +* Support latest Mapnik 3.x +* Bump `mapnik-reference` dependency to 7.x. + +## 0.14.0 + +* Support for Mapnik 3.x +* Bump `mapnik-reference` dependency to ~6.0.1. + +## 0.13.0 + +* Allows optional args in transforms. +* Bump `mapnik-reference` dependency to 5.1.x. + +## 0.12.0 + +* Drop mml2json and xml2js dependency. + +## 0.11.0 + +* Switch API to be synchronous. All errors should be caught using try/catch now. + +## 0.10.0 + +* Remove automatic inclusion of `maximum-extent` on Map element to allow geometries that are buffered past extent bounds (e.g. dateline). +* Bump `mapnik-reference` dependency to ~5.0.9 (with `shield-halo-rasterizer`) + +## 0.9.6 + +* Fixed support for `text-face-name` values with `&` like `El&Font Bubble` +* Fixed support for filtering on fields containing single quotes. Now `#layer[name="it's"] { ... }` is possible. +* Fixed support for filtering on fields containing `&`. Now `#layer["Hello&Goodbye"="yes"] { ... }` is possible. +* Added support for exponential notation in filters. Now `#layer[value = 1.2e3] { ... }` is possible. +* Bump `mapnik-reference` dependency to ~5.0.8 (with support for Mapnik v2.3.0 and 3.x) + +## 0.9.5 + +* Various speed optimizations to help address #20 (#231) +* Fixed support for fields that contain the word `zoom` in them (previous clashed with `zoom` keyword) +* Fixed support for a space in front of `zoom` keyword (#288) +* Improved error messages when color functions encounter invalid color (#309) +* The `carto` command line tool now exits cleanly when millstone is used +* The `carto` command line tool now only localized with millstone if requested (#243) +* Added man page for `carto` (#257) +* Fix repeated comments in selectors. Fixes #260 +* Fixed `image-filter` duplication (#270) +* Quote all needed XML chars. See #263. +* Added higher tolerance for various characters in field names (#230) +* Bump `mapnik-reference` dependency to ~5.0.7 (with support for Mapnik v2.2.0) +* Adds compatibility with screen units. +* Fixed ability to use carto as global module (#236) +* Now using 'console' instead of `util` for `stderr` (#217) + +## 0.9.4 + +* Fixes nesting of regex calls + +## 0.9.3 + +* Allows `text-face-name` properties to be unquoted +* Detects inline Format XML tags in `text-name` and passes such output + straight to XML for advanced text names. +* Fixes bugs around concatenation of strings in expressions +* Fixes parsing of comments in between selectors +* Fixes parsing of whitespace in calls +* Improved error messages for unknown properties - advises user on + the property name most closely matching the incorrect input. +* Improved errors for calls, advises user on number of arguments +* Fixes instance inheritance - thanks @gravitystorm! + +## 0.9.2 + +Tagged Sept 6, 2012 + +* Bump `mapnik-reference` dependency to ~5.0.0 +* Better support for unsigned types in certain Mapnik styling properties + +## 0.9.1 + +Tagged Aug 15, 2012 + +* Improved error handling for different target `mapnik-reference` versions (strk) +* Bump `mapnik-reference` dependency to ~4.0.3 +* Fixed handling of image-filter syntax as per [Mapnik changes](https://github.com/mapnik/mapnik/issues/1384) + +## 0.9.0 + +* Bump `mapnik-reference` dependency to ~4.0.0 to pull in new properties. +* Adapted to `comp-op` rename upstream in `mapnik-reference`. +* Adapted to `transform` rename upstream in `mapnik-reference` and Mapnik. + +## 0.8.1 + +* Bump `mapnik-reference` dependency to ~3.1.0 to pull in new properties. + +## 0.8.0 + +* Adds the modulus operator `%` as an option +* Adds a new field-type like `[FIELD]` instead of "[FIELD]" +* Supports function syntax for transforms, optionally with variables and arguments. + +### 0.7.1 + +* Updated mapnik-reference to `~2.2.1` +* Added support for `status` parameter on layers. +* Command line `carto` program gained `--nosymlink` option to pass to millstone to use absolute paths instead of symlinking files. +* Removed unsupported mixin code. + +### 0.7.0 + +* Updated mapnik-reference to `~2.1.0` +* Support an `opacity` property on any style that is a style-level property + +### 0.6.0 + +* Bump `mapnik-reference` dependency to 1.0.0 to allow for using `buffer-size` in the + `Map` element. + +### 0.5.0 + +* Now uses the [mapnik-reference](https://github.com/mapnik/mapnik-reference) npm module + instead of copying `reference.json` when it's updated +* Adds a second parameter to `carto.Renderer` - an object which has a key `mapnik_version` + that specifies the version of Mapnik this stylesheet should target. + +### 0.4.10 + +* Updated reference.json + +### 0.4.9 + +* Render TileJSON, Mapnik options to Mapnik XML parameters. + +### 0.4.8 + +* Updated reference.json + +### 0.4.7 + +* Removed deprecation warnings re: sys/util +* Updated reference.json +* Updated underscore dependency + +### 0.4.6 + +* Node >=v0.6.x compatibility +* Dropped cartox +* Updated reference.json + +### 0.4.5 + +* Fixes text-name with HTML entities +* Fixes function calls with incorrect number of arguments +* Fixes invalid code segments not having eval + +### 0.4.3 + +* Fixes serialization bug with invalid selectors. + +### 0.4.0 + +* Switches text-symbolizer syntax to new-style for Mapnik 2.0 + +### 0.3.0 + +* Add "name/" prefix for creating multiple instances of a symbolizer in the same + attachment +* Only output `` tag when there's at least one style +* Sort styles by location of first rule's index +* Don't support selectors that are not either `Map`, `.` or `#`-prefixed. + +### 0.2.3 + +* Fixes many bugs +* Supports arbitrary properties on layers with the `properties` key in MML +* Adds `min-path-length` +* Updates `reference.json` + +### 0.2.2 + +* Update `carto` to use `millstone` if available. + +### 0.2.1 + +* Accept valid Map properties directly from input mml object. + +### 0.2.0 + +* Removed all external handling - see http://github.com/mapbox/millstone for localizing/caching MML objects with external references. +* All errors are now handled as Error objects. + +### 0.1.14 + +* Optional-file datasources - allows string argument to OGR + +### 0.1.9 + +* Variables in filters. + +### 0.1.6 & 0.1.8 + +* Fixed bug caused by jshint testing + +### 0.1.5 + +* Using npm devDependencies in place of ndistro +* Updated package.json format +* Fixes tests + +### 0.1.4 + +* Fix bug in which SRS autodetection broke error handling +* Update carto diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..20c0afb --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,35 @@ +## Developing + +Installing: + + git clone https://github.com/mapbox/carto.git + cd carto + npm install + +Test: + + npm test + +Running the head binary: + + ./bin/carto + +## Releasing + + - Make sure all tests are passing + - Ensure CHANGELOG.md is up to date + - Test relevant applications to ensure no regressions + - `npm publish` + - Regenerate documentation (see below) + +If there's a high chance of regression, please bump to a new major version number +so that code using a semver ^ or ~ doesn't auto-upgrade anyone. + +For examples of previous releases see: https://github.com/mapbox/carto/issues/440 + +## Documentation + +This repository contains auto-generated documentation of the content of Carto +that's published on readthedocs.io. You find the relevant files in the `docs` +directory. Those files with the extension `rst` are the ones where you find +the documentation sources in reStructuredText. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..40f3b78 --- /dev/null +++ b/LICENSE @@ -0,0 +1,179 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +Copyright (c) 2009-2010 Alexis Sellier diff --git a/README.md b/README.md new file mode 100644 index 0000000..76955ee --- /dev/null +++ b/README.md @@ -0,0 +1,129 @@ +# CartoCSS + +[![Build Status](https://secure.travis-ci.org/mapbox/carto.svg)](http://travis-ci.org/mapbox/carto) [![Build status](https://ci.appveyor.com/api/projects/status/github/mapbox/carto?svg=true)](https://ci.appveyor.com/project/Mapbox/carto) [![Coverage Status](https://coveralls.io/repos/github/mapbox/carto/badge.svg?branch=master)](https://coveralls.io/github/mapbox/carto?branch=master) [![Package Version](https://img.shields.io/npm/v/carto.svg)](https://www.npmjs.com/package/carto) [![Dependencies](https://david-dm.org/mapbox/carto.svg)](https://david-dm.org/mapbox/carto) [![Documentation Status](https://readthedocs.org/projects/cartocss/badge/?version=latest)](http://cartocss.readthedocs.io/en/latest/?badge=latest) + +CartoCSS (short: Carto) is a language for map design. It is similar in syntax to CSS, but builds upon it with specific abilities to filter map data and by providing things like variables. +It targets the [Mapnik renderer](http://mapnik.org) and is able to generate Mapnik XML and a JSON variant of Mapnik XML. +It can run from the command line or in the browser. + +Carto is an evolution of the [Cascadenik](https://github.com/mapnik/Cascadenik) idea and language, with an emphasis on speed and flexibility. + +## Documentation + +The best place to start is to review the [CartoCSS documentation](https://cartocss.readthedocs.io). + +Tutorials like the [Mapbox Getting started with CartoCSS guide](https://www.mapbox.com/guides/getting-started-cartocss/) are a great place to start to learn the basics of CartoCSS. + +For more advanced topics see the [Studio style quickstart guide](https://www.mapbox.com/guides/style-quickstart/) and [Studio style manual](https://www.mapbox.com/guides/style-manual). The links below reference the Tilemill application, which preceded Mapbox Studio Classic, but still contain useful and relevant information. + + - [Details on Filtering data with CartoCSS](https://www.mapbox.com/tilemill/docs/guides/selectors/) + - [How order works in rendering](https://www.mapbox.com/tilemill/docs/guides/symbol-drawing-order/) + - [How to style labels](https://www.mapbox.com/tilemill/docs/guides/styling-labels/) + - [How to style lines](https://www.mapbox.com/tilemill/docs/guides/styling-lines/) + - [How to style polygons](https://www.mapbox.com/tilemill/docs/guides/styling-polygons/) + - See also the [Styling Concepts](#styling-concepts) for explanations of advanced features. + +## Installation + +If you are using a map design application like Kosmtik, Mapbox Studio Classic or Tilemill you already have CartoCSS installed +and might be more interested in the language reference. + +Else you can install the `carto` binary with NPM by running: + + npm install -g carto + +You should consider using a Node.js version manager like [NVM](https://github.com/creationix/nvm). +Optionally you may also want to install millstone which is required for resolving data in the same way as Mapbox Studio Classic does: + + npm install -g millstone + + +Having `millstone` installed specifically enable support for localizing external resources (URLs and local files) referenced in your mml file, and detecting projections (using [node-srs](https://github.com/mapbox/node-srs)) + +## Usage + +Now that Carto is installed you should have a `carto` command line tool available that can be run on a CartoCSS project: + + carto project.mml > mapnik.xml + +Available parameters: +* -a / --api VERSION - Specify Mapnik API version (e.g. --api 3.0.10) (default: latest Mapnik API version) +* -b / --benchmark - Outputs total compile time +* -f / --file - Outputs to the specified file instead of stdout +* -h / --help - Display help message +* -l / --localize - Use millstone to localize resources when loading an MML (default: off) +* -n / --nosymlink - Use absolute paths instead of symlinking files +* -o / --output - Specify output format, possible values are `mapnik` and `json` (default: `mapnik`) +* -ppi RESOLUTION - Pixels per inch used to convert m, mm, cm, in, pt, pc to pixels (default: 90.714) +* -q / --quiet - Do not output any warnings (default: off) +* -v / --version - Display version information + +Alternatively, Carto can be used from JavaScript. +The `Renderer` interface is the main API for developers, and it takes an MML file as a string as input. + +```javascript +// defined variables: +// - input (the name or identifier of the file being parsed) +var carto = require('carto'); + +try { + var data = fs.readFileSync(input, 'utf-8'); + var mml = new carto.MML({}); + mml.load(path.dirname(input), data, function (err, data) { + var output = {}; + + if (!err) { + output = new carto.Renderer({ + filename: input + }).render(data); + } + + if (output.msg) { + output.msg.forEach(function (v) { + if (v.type === 'error') { + console.error(carto.Util.getMessageToPrint(v)); + } + else if (v.type === 'warning') { + console.warn(carto.Util.getMessageToPrint(v)); + } + }); + } + + // output content (if no errors) + if (output.data) { + console.log(output.data); + } + }); +} catch (err) { + // program failures + ... +} +``` + +If you want to use CartoCSS within the browser you should not use MML loading via `carto.MML.load`. +Instead you should supply the JSON of the MML including the Stylesheet strings directly to `carto.Renderer.render`. + +## Vim + +To install, download or clone this repository, then copy the `vim-carto` +directory located at `build/vim-carto` to your `~/.vim` directory. + + cp build/vim-carto/* ~/.vim -R + +## Credits + +CartoCSS is based on [less.js](https://github.com/cloudhead/less.js), a CSS compiler written by Alexis Sellier. + +See also a [list of dependencies](https://david-dm.org/mapbox/carto#info=dependencies&view=list). + +## Similar projects + +* [Magnacarto](https://github.com/omniscale/magnacarto) (Go implementation of CartoCSS for Mapnik and Mapserver) + +## Authors + +* Tom MacWright (tmcw) +* Konstantin Käfer (kkaefer) +* AJ Ashton (ajashton) +* Dane Springmeyer (springmeyer) +* Michael Glanznig (nebulon42) diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..21383f8 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,24 @@ +# Test against this versions of Node.js +environment: + matrix: + - nodejs_version: 10 + - nodejs_version: 8 + - nodejs_version: 6 + +# Install scripts. (runs after repo cloning) +install: + # Get the latest stable version of Node.js or io.js + - ps: Install-Product node $env:nodejs_version + # install modules + - npm install + +# Post-install test scripts. +test_script: + # Output useful info for debugging. + - node --version + - npm --version + # run tests + - npm test + +# Don't actually build. +build: off diff --git a/bin/carto b/bin/carto new file mode 100755 index 0000000..a789781 --- /dev/null +++ b/bin/carto @@ -0,0 +1,150 @@ +#!/usr/bin/env node + +var path = require('path'), + fs = require('fs'), + carto = require('../lib/carto'), + url = require('url'), + _ = require('lodash'), + util = require('../lib/carto/util'); + +var existsSync = require('fs').existsSync || require('path').existsSync + +var yargs = require('yargs') + .usage("Usage: $0 ") + .options('h', {alias:'help', describe:'Display this help message'}) + .options('v', {alias:'version', boolean:true, describe:'Display version information'}) + .options('b', {alias:'benchmark', boolean:true, describe:'Outputs total compile time'}) + .options('l', {alias:'localize', boolean:true, default:false, describe:'Use millstone to localize resources when loading an MML'}) + .options('n', {alias:'nosymlink', boolean:true, describe:'Use absolute paths instead of symlinking files'}) + .options('a', {alias:'api', describe:'Specify Mapnik API version'}) + .options('f', {alias:'file', describe:'Outputs to the given file instead of stdout.'}) + .options('o', {alias:'output', describe:'Specify output format (mapnik, json)', default:'mapnik'}) + .options('q', {alias:'quiet', boolean:true, default:false, describe:'Do not output any warnings'}) + .options('ppi', {describe:'Pixels per inch used to convert m, mm, cm, in, pt, pc to pixels', default:90.714}); + +var options = yargs.argv; + +if (options.help) { + yargs.showHelp(); + process.exit(0); +} + +if (options.version) { + console.error("carto " + carto.version.join('.') + " (Carto map stylesheet compiler)"); + process.exit(0); +} + +var input = options._[0]; +if (input && input[0] != '/') { + input = path.join(process.cwd(), input); +} + +if (!input) { + console.error("carto: no input files ('carto -h or --help' for help)"); + process.exit(1); +} + +if (options.benchmark) { + var start = +new Date; +} + +var ext = path.extname(input); + +if (!ext) { + console.error("carto: please pass either a .mml file or .mss file"); + process.exit(1); +} + +if (!existsSync(input)) { + console.error("carto: file does not exist: '" + input + "'"); + process.exit(1); +} + +try { + var data = fs.readFileSync(input, 'utf-8'); +} catch(err) { + console.error("carto: " + err.message.replace(/^[A-Z]+, /, '')); + process.exit(1); +} + +if (ext === '.mml') { + var mml = new carto.MML(options); + mml.load(path.dirname(input), data, compile); +} else if (ext === '.mss') { + compile(null, data); +} else { + console.error("carto: please pass either a .mml file or .mss file"); +} + + +function compile(err, data) { + if (err) { + console.error(err); + process.exit(1); + } + + var renderer = new carto.Renderer({ + filename: input, + benchmark: options.benchmark, + ppi: options.ppi, + quiet: options.quiet, + outputFormat: options.output, + version: options.api + }); + try { + var output; + if (ext === '.mml') { + output = renderer.render(data); + } else if (ext === '.mss') { + output = renderer.renderMSS(data); + } + + if (_.has(output, 'msg') && _.isArray(output.msg) && + output.msg.length > 0) { + var hasError = false; + _.forEach(output.msg, function (v) { + if (v.type === 'error') { + console.error(util.getMessageToPrint(v)); + hasError = true; + } + else if (v.type === 'warning') { + console.warn(util.getMessageToPrint(v)); + } + }); + + if (hasError) { + process.exit(1); + } + } + } catch (e) { + if (e.stack) { + console.error(e.stack); + } else if (e.message) { + console.error(e.message); + } + else { + console.error(e); + } + process.exit(1); + } + if (!options.benchmark) { + if (!_.isNil(output.data)) { + if (options.file) { + try { + fs.writeFileSync(options.file, output.data); + } + catch (e) { + console.error(e); + console.error('Writing to given file ' + options.file + ' failed. Falling back to stdout output.'); + console.log(output.data); + } + } + else { + console.log(output.data); + } + } + } else { + var duration = (+new Date) - start; + console.log('TOTAL: ' + (duration) + 'ms'); + } +}; diff --git a/build/carto.tmbundle/Commands/preview.tmCommand b/build/carto.tmbundle/Commands/preview.tmCommand new file mode 100644 index 0000000..f90b241 --- /dev/null +++ b/build/carto.tmbundle/Commands/preview.tmCommand @@ -0,0 +1,40 @@ + + + + + beforeRunningCommand + nop + command + #!/usr/bin/env ruby + +nvmdir = File.expand_path('~/.nvm') +localdir = "/usr/local/bin/" +if File.directory?nvmdir then + cartos = Dir.glob(nvmdir + '/*/bin/mapnik-render.js') + carto = cartos.pop() if cartos + node = carto.gsub('/bin/mapnik-render.js', '/bin/node') +elsif File.exist?localdir + "mapnik-render.js" + carto = localdir + "mapnik-render.js" + node = localdir + "node" +end + +if carto + `#{node} #{carto} #{ENV['TM_FILEPATH']} /tmp/test.png` +else + puts 'node and mapnik-render.js could not be found' +end + + input + none + keyEquivalent + ^~@p + name + Preview + output + showAsHTML + scope + source.mml + uuid + 4A0B3C2B-5F11-4D70-AFF4-EC4A4A042D66 + + diff --git a/build/carto.tmbundle/Syntaxes/carto.tmLanguage b/build/carto.tmbundle/Syntaxes/carto.tmLanguage new file mode 100644 index 0000000..96de723 --- /dev/null +++ b/build/carto.tmbundle/Syntaxes/carto.tmLanguage @@ -0,0 +1,351 @@ + + + + + comment + Carto + fileTypes + + mss + + foldingStartMarker + /\*\*(?!\*)|\{\s*($|/\*(?!.*?\*/.*\S)) + foldingStopMarker + (?<!\*)\*\*/|^\s*\} + keyEquivalent + ^~C + name + Carto + patterns + + + match + \b(Map)\b + name + keyword.control.carto.elements + + + begin + " + end + " + name + string.quoted.double.carto + patterns + + + match + \\. + name + constant.character.escaped.carto + + + + + begin + ' + end + ' + name + string.quoted.single.carto + patterns + + + match + \\. + name + constant.character.escaped.carto + + + + + captures + + 1 + + name + punctuation.definition.entity.carto + + 2 + + name + entity.other.class.carto + + + match + (\.)([a-zA-Z0-9_-]+) + name + meta.selector.class.carto + + + captures + + 1 + + name + punctuation.definition.entity.carto + + 2 + + name + keyword.control.id.carto + + + match + (#)([a-zA-Z0-9_-]+) + name + meta.selector.id.carto + + + captures + + 1 + + name + punctuation.definition.entity.carto + + 2 + + name + entity.other.attachment.carto + + + match + (::)([a-zA-Z0-9_/-]+)\b + name + meta.selector.attachment.carto + + + captures + + 1 + + name + punctuation.definition.entity.carto + + 10 + + name + string.quoted.attribute-value.carto + + 11 + + name + punctuation.definition.string.begin.carto + + 12 + + name + punctuation.definition.string.end.carto + + 13 + + name + punctuation.definition.string.begin.carto + + 14 + + name + punctuation.definition.string.end.carto + + 15 + + name + punctuation.definition.entity.carto + + 2 + + name + meta.tag.zoomfilter.carto + + 3 + + name + variable.other.carto + + 4 + + name + punctuation.definition.string.begin.carto + + 5 + + name + punctuation.definition.string.end.carto + + 6 + + name + punctuation.definition.string.begin.carto + + 7 + + name + punctuation.definition.string.end.carto + + 8 + + name + punctuation.separator.operator.carto + + 9 + + name + constant.numeric.carto + + + match + (\[)\s*(?:(zoom)|((")(?:[^"\\]|\\.)*(")|(')(?:[^'\\]|\\.)*(')|[a-zA-Z0-9_][a-zA-Z0-9_-]*))\s*(!?=|>=?|<=?)\s*(?:(\d+)|((")(?:[^"\\]|\\.)*(")|(')(?:[^'\\]|\\.)*(')|[a-zA-Z0-9_][a-zA-Z0-9_-]*))\s*(\]) + name + meta.attribute-selector.carto + + + begin + url\( + contentName + variable.parameter.url + end + \) + name + support.function.any-method.builtin.carto + + + match + (#)([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b + name + constant.other.rgb-value.carto + + + begin + /\* + end + \*/ + name + comment.block.carto + + + match + (-|\+)?\s*[0-9]+(\.[0-9]+)? + name + constant.numeric.carto + + + match + (?<=[\d])(px)\b|% + name + keyword.unit.carto + + + captures + + 1 + + name + keyword.control.at-rule.import.carto + + 2 + + name + punctuation.definition.keyword.carto + + + match + ^\s*((@)import\b) + name + meta.at-rule.import.carto + + + captures + + 1 + + name + support.type.property-name.carto + + + match + \b(background-color|background-image|srs|buffer|font-directory|polygon-fill|polygon-gamma|polygon-opacity|polygon-meta-output|polygon-meta-writer|line-color|line-width|line-opacity|line-join|line-cap|line-gamma|line-dasharray|line-meta-output|line-meta-writer|marker-file|marker-opacity|marker-line-color|marker-line-width|marker-line-opacity|marker-placement|marker-type|marker-width|marker-height|marker-fill|marker-allow-overlap|marker-spacing|marker-max-error|marker-transform|marker-meta-output|marker-meta-writer|shield-name|shield-face-name|shield-size|shield-fill|shield-min-distance|shield-halo-fill|shield-halo-radius|shield-spacing|shield-character-spacing|shield-line-spacing|shield-file|shield-width|shield-height|shield-type|shield-text-dx|shield-text-dy|shield-dx|shield-dy|shield-meta-output|shield-meta-writer|shield-label-position-tolerance|line-pattern-file|line-pattern-width|line-pattern-height|line-pattern-type|line-pattern-meta-output|line-pattern-meta-writer|polygon-pattern-file|polygon-pattern-width|polygon-pattern-height|polygon-pattern-type|polygon-pattern-meta-output|polygon-pattern-meta-writer|raster-opacity|raster-comp-op|raster-scaling|point-file|point-width|point-height|point-type|point-allow-overlap|point-placement|point-meta-output|point-meta-writer|text-name|text-face-name|text-size|text-ratio|text-wrap-width|text-spacing|text-character-spacing|text-line-spacing|text-label-position-tolerance|text-max-char-angle-delta|text-fill|text-halo-fill|text-halo-radius|text-dx|text-dy|text-avoid-edges|text-min-distance|text-min-padding|text-allow-overlap|text-placement|text-placement-type|text-placements|text-transform|text-meta-output|text-meta-writer|building-fill|building-fill-opacity|building-height)\s*: + + + match + \b(miter|round|bevel|butt|round|square|point|line|arrow|ellipse|png|jpg|svg|normal|grain_merge|grain_merge2|multiply|multiply2|divide|divide2|screen|hard_light|near|bilinear|bilinear8|centroid|interior|point|line|vertex|interior|none|uppercase|lowercase)\b + name + meta.property-value.carto + + + comment + http://www.w3.org/TR/CSS21/syndata.html#value-def-color + match + \b(aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|grey|green|greenyellow|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|transparent)\b + name + constant.color.w3c-standard-color-name.carto + + + match + \b(saturate|desaturate|lighten|darken|grayscale)\b + name + support.function.any-method.builtin.carto + + + match + \b(rgb|rgba|hsl|hsla|url)\b + name + support.function.any-method.builtin.carto + + + captures + + 1 + + name + support.function.carto + + + match + (\.[a-zA-Z0-9_-]+)\s*(;|\() + + + begin + // + end + $\n? + name + comment.line.double-slash.carto + + + match + @[a-zA-Z0-9_-][\w-]* + name + variable.other.carto + + + match + \$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|(?<!\()/=|%=|\+=|\-=|&=|\^=|\/\b + name + keyword.operator.carto + + + match + \{|\} + name + meta.brace.curly.js + + + match + \(|\) + name + meta.brace.round.js + + + match + \[|\] + name + meta.brace.square.js + + + scopeName + source.css.carto + uuid + 43F4EF91-F880-4CE7-A4C8-02DA726BC5FF + + diff --git a/build/carto.tmbundle/Syntaxes/mml.tmLanguage b/build/carto.tmbundle/Syntaxes/mml.tmLanguage new file mode 100644 index 0000000..8acd332 --- /dev/null +++ b/build/carto.tmbundle/Syntaxes/mml.tmLanguage @@ -0,0 +1,287 @@ + + + + + fileTypes + + mml + + foldingStartMarker + (?x: # turn on extended mode + ^ # a line beginning with + \s* # some optional space + [{\[] # the start of an object or array + (?! # but not followed by + .* # whatever + [}\]] # and the close of an object or array + ,? # an optional comma + \s* # some optional space + $ # at the end of the line + ) + | # ...or... + [{\[] # the start of an object or array + \s* # some optional space + $ # at the end of the line + ) + foldingStopMarker + (?x: # turn on extended mode + ^ # a line beginning with + \s* # some optional space + [}\]] # and the close of an object or array + ) + keyEquivalent + ^~M + name + Carto MML + patterns + + + include + #value + + + repository + + array + + begin + \[ + beginCaptures + + 0 + + name + punctuation.definition.array.begin.json + + + end + \] + endCaptures + + 0 + + name + punctuation.definition.array.end.json + + + name + meta.structure.array.json + patterns + + + include + #value + + + match + , + name + punctuation.separator.array.json + + + match + [^\s\]] + name + invalid.illegal.expected-array-separator.json + + + + constant + + match + \b(?:true|false|null)\b + name + constant.language.json + + number + + comment + handles integer and decimal numbers + match + (?x: # turn on extended mode + -? # an optional minus + (?: + 0 # a zero + | # ...or... + [1-9] # a 1-9 character + \d* # followed by zero or more digits + ) + (?: + (?: + \. # a period + \d+ # followed by one or more digits + )? + (?: + [eE] # an e character + [+-]? # followed by an option +/- + \d+ # followed by one or more digits + )? # make exponent optional + )? # make decimal portion optional + ) + name + constant.numeric.json + + object + + begin + \{ + beginCaptures + + 0 + + name + punctuation.definition.dictionary.begin.json + + + comment + a JSON object + end + \} + endCaptures + + 0 + + name + punctuation.definition.dictionary.end.json + + + name + meta.structure.dictionary.json + patterns + + + comment + the JSON object key + include + #string + + + begin + : + beginCaptures + + 0 + + name + punctuation.separator.dictionary.key-value.json + + + end + (,)|(?=\}) + endCaptures + + 1 + + name + punctuation.separator.dictionary.pair.json + + + name + meta.structure.dictionary.value.json + patterns + + + comment + the JSON object value + include + #value + + + match + [^\s,] + name + invalid.illegal.expected-dictionary-separator.json + + + + + match + [^\s\}] + name + invalid.illegal.expected-dictionary-separator.json + + + + string + + begin + " + beginCaptures + + 0 + + name + punctuation.definition.string.begin.json + + + end + " + endCaptures + + 0 + + name + punctuation.definition.string.end.json + + + name + string.quoted.double.json + patterns + + + match + (?x: # turn on extended mode + \\ # a literal backslash + (?: # ...followed by... + ["\\/bfnrt] # one of these characters + | # ...or... + u # a u + [0-9a-fA-F]{4} # and four hex digits + ) + ) + name + constant.character.escape.json + + + match + \\. + name + invalid.illegal.unrecognized-string-escape.json + + + + value + + comment + the 'value' diagram at http://json.org + patterns + + + include + #constant + + + include + #number + + + include + #string + + + include + #array + + + include + #object + + + + + scopeName + source.mml + uuid + 74FEE366-FF0A-4AAA-B8C5-1C66CECA7F86 + + diff --git a/build/carto.tmbundle/info.plist b/build/carto.tmbundle/info.plist new file mode 100644 index 0000000..c6445d9 --- /dev/null +++ b/build/carto.tmbundle/info.plist @@ -0,0 +1,15 @@ + + + + + name + Carto + ordering + + 43F4EF91-F880-4CE7-A4C8-02DA726BC5FF + 4A0B3C2B-5F11-4D70-AFF4-EC4A4A042D66 + + uuid + 3D813315-4B2E-4537-8E22-BD1A75AB84A9 + + diff --git a/build/syntaxgenerate b/build/syntaxgenerate new file mode 100755 index 0000000..7c76ef3 --- /dev/null +++ b/build/syntaxgenerate @@ -0,0 +1,47 @@ +#!/usr/bin/env node + +var path = require('path'), + fs = require('fs'), + _ = require('underscore')._; + +var carto = require('../lib/carto'); + +var color_names = _.keys(carto.tree.Reference.data.colors); +var property_names = carto.tree.Reference.selectors; +var keyword_names = _.reduce(carto.tree.Reference.data.symbolizers, + function(memo, s) { + for (var i in s) { + if (_.isArray(s[i].type)) { + memo = memo.concat(s[i].type); + } + } + return memo; +}, []); + +// TextMate +// -------- +// Generate TextMate tmLanguage file for use in bundle +var tm_tmpl = fs.readFileSync(path.join(__dirname, 'tmlanguage_template.js'), 'utf-8'); +fs.writeFile('carto.tmLanguage', _.template(tm_tmpl, { + color_names: color_names.filter(function(a) { return a; }).join('|'), + keyword_names: keyword_names.filter(function(a) { return a; }).join('|'), + property_names: property_names.filter(function(a) { return a; }).join('|') +}), function(err) { + if (!err) console.log('tmLanguage created'); +}); + +// VIM +// --- +// Generate carto.syntax +var tm_tmpl = fs.readFileSync(path.join(__dirname, 'vimsyntax_template.js'), 'utf-8'); +fs.writeFile('vim-carto/syntax/carto.vim', _.template(tm_tmpl, { + color_names: color_names.filter(function(a) { return a; }).join('\\|'), + keyword_names: keyword_names.filter(function(a) { return a; }).join('\\|'), + property_names: property_names.filter(function(a) { + return a; + }).map(function(a) { + return a.replace(/\-/g, '\\-'); + }).join('\\|') +}), function(err) { + if (!err) console.log('carto.vim created'); +}); diff --git a/build/tmlanguage_template.js b/build/tmlanguage_template.js new file mode 100644 index 0000000..dc930cf --- /dev/null +++ b/build/tmlanguage_template.js @@ -0,0 +1,133 @@ +{ scopeName = 'source.css.carto'; + comment = 'Carto'; + fileTypes = ( 'mss' ); + foldingStartMarker = '/\*\*(?!\*)|\{\s*($|/\*(?!.*?\*/.*\S))'; + foldingStopMarker = '(?=?|<=?)\s*(?:(\d+)|((")(?:[^"\\]|\\.)*(")|('')(?:[^''\\]|\\.)*('')|[a-zA-Z0-9_][a-zA-Z0-9_-]*))\s*(\])'; + captures = { + 1 = { name = 'punctuation.definition.entity.carto'; }; + 2 = { name = 'meta.tag.zoomfilter.carto'; }; + 3 = { name = 'variable.other.carto'; }; + 4 = { name = 'punctuation.definition.string.begin.carto'; }; + 5 = { name = 'punctuation.definition.string.end.carto'; }; + 6 = { name = 'punctuation.definition.string.begin.carto'; }; + 7 = { name = 'punctuation.definition.string.end.carto'; }; + 8 = { name = 'punctuation.separator.operator.carto'; }; + 9 = { name = 'constant.numeric.carto'; }; + 10 = { name = 'string.quoted.attribute-value.carto'; }; + 11 = { name = 'punctuation.definition.string.begin.carto'; }; + 12 = { name = 'punctuation.definition.string.end.carto'; }; + 13 = { name = 'punctuation.definition.string.begin.carto'; }; + 14 = { name = 'punctuation.definition.string.end.carto'; }; + 15 = { name = 'punctuation.definition.entity.carto'; }; + }; + }, + { name = 'support.function.any-method.builtin.carto'; + contentName = 'variable.parameter.url'; + begin = 'url\('; + end = '\)'; + }, + { name = 'constant.other.rgb-value.carto'; + match = '(#)([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b'; + }, + { name = 'comment.block.carto'; + begin = '/\*'; + end = '\*/'; + }, + { name = 'constant.numeric.carto'; + match = '(-|\+)?\s*[0-9]+(\.[0-9]+)?'; + }, + { name = 'keyword.unit.carto'; + match = '(?<=[\d])(px)\b|%'; + }, + { name = 'meta.at-rule.import.carto'; + match = '^\s*((@)import\b)'; + captures = { + 1 = { name = 'keyword.control.at-rule.import.carto'; }; + 2 = { name = 'punctuation.definition.keyword.carto'; }; + }; + }, + { match = '\b(<%= property_names %>)\s*:'; + captures = { 1 = { name = 'support.type.property-name.carto'; }; }; + }, + { name = 'meta.property-value.carto'; + match = '\b(<%= keyword_names %>)\b'; + }, + { name = 'constant.color.w3c-standard-color-name.carto'; + comment = 'http://www.w3.org/TR/CSS21/syndata.html#value-def-color'; + match = '\b(<%= color_names %>)\b'; + }, + { name = 'support.function.any-method.builtin.carto'; + match = '\b(saturate|desaturate|lighten|darken|grayscale)\b'; + }, + { name = 'support.function.any-method.builtin.carto'; + match = '\b(rgb|rgba|hsl|hsla|url)\b'; + }, + { match = '(\.[a-zA-Z0-9_-]+)\s*(;|\()'; + captures = { 1 = { name = 'support.function.carto'; }; }; + }, + { name = 'comment.line.double-slash.carto'; + begin = '//'; + end = '$\n?'; + }, + { name = 'variable.other.carto'; + match = '@[a-zA-Z0-9_-][\w-]*'; + }, + { name = 'keyword.operator.carto'; + match = '\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|(? +" Original Author: Leaf Corcoran +" Modifier: Bryan J Swift +" Last Change: 2011 January 27 +" Carto by Tom MacWright +" LESS by Leaf Corcoran +" CSS2 by Nikolai Weibull +" Full CSS2, HTML4 support by Yeti + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if !exists("main_syntax") + if version < 600 + syntax clear + elseif exists("b:current_syntax") + finish +endif + let main_syntax = 'carto' +endif + +syn case ignore + +syn keyword cartoTagName Map + +syn match cartoSelectorOp "[+>.]" +syn match cartoSelectorOp2 "[~|><]\?=" contained +syn region cartoAttributeSelector matchgroup=cartoSelectorOp start="\[" end="]" transparent contains=cartoUnicodeEscape,cartoSelectorOp2,cartoStringQ,cartoStringQQ + +try +syn match cartoIdentifier "#[A-Za-zÀ-ÿ_@][A-Za-zÀ-ÿ0-9_@-]*" +catch /^.*/ +syn match cartoIdentifier "#[A-Za-z_@][A-Za-z0-9_@-]*" +endtry + +syn match cartoValueInteger "[-+]\=\d\+" +syn match cartoValueNumber "[-+]\=\d\+\(\.\d*\)\=" +syn match cartoValueLength "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\)" + +syn match cartoFontDescriptor "@font-face\>" nextgroup=cartoFontDescriptorBlock skipwhite skipnl +syn region cartoFontDescriptorBlock contained transparent matchgroup=cartoBraces start="{" end="}" contains=cartoComment,cartoError,cartoUnicodeEscape,cartoFontProp,cartoFontAttr,cartoStringQ,cartoStringQQ,cartoFontDescriptorProp,cartoValue.*,cartoFontDescriptorFunction,cartoUnicodeRange,cartoFontDescriptorAttr +syn match cartoFontDescriptorProp contained "\<\(unicode-range\|unit-per-em\|panose-1\|cap-height\|x-height\|definition-src\)\>" +syn keyword cartoFontDescriptorProp contained src stemv stemh slope ascent descent widths bbox baseline centerline mathline topline +syn keyword cartoFontDescriptorAttr contained all +syn region cartoFontDescriptorFunction contained matchgroup=cartoFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cartoStringQ,cartoStringQQ oneline keepend +syn match cartoUnicodeRange contained "U+[0-9A-Fa-f?]\+" +syn match cartoUnicodeRange contained "U+\x\+-\x\+" + +syn match cartoKeywordAttr "/\|miter\|round\|bevel\|butt\|round\|square\|point\|line\|arrow\|ellipse\|point\|line\|vertex\|interior\|local\|global\|normal\|grain_merge\|grain_merge2\|multiply\|multiply2\|divide\|divide2\|screen\|hard_light\|near\|bilinear\|bilinear8\|bicubic\|spline16\|gaussian\|lanczos\|centroid\|interior\|top\|middle\|bottom\|point\|line\|vertex\|interior\|dummy\|simple\|none\|uppercase\|lowercase\|capitalize\|/" + +" syn keyword cartoColor contained {{#colors}}{{.}} {{/colors}} +syn match cartoColor "/\|aliceblue\|antiquewhite\|aqua\|aquamarine\|azure\|beige\|bisque\|black\|blanchedalmond\|blue\|blueviolet\|brown\|burlywood\|cadetblue\|chartreuse\|chocolate\|coral\|cornflowerblue\|cornsilk\|crimson\|cyan\|darkblue\|darkcyan\|darkgoldenrod\|darkgray\|darkgreen\|darkgrey\|darkkhaki\|darkmagenta\|darkolivegreen\|darkorange\|darkorchid\|darkred\|darksalmon\|darkseagreen\|darkslateblue\|darkslategrey\|darkturquoise\|darkviolet\|deeppink\|deepskyblue\|dimgray\|dimgrey\|dodgerblue\|firebrick\|floralwhite\|forestgreen\|fuchsia\|gainsboro\|ghostwhite\|gold\|goldenrod\|gray\|grey\|green\|greenyellow\|honeydew\|hotpink\|indianred\|indigo\|ivory\|khaki\|lavender\|lavenderblush\|lawngreen\|lemonchiffon\|lightblue\|lightcoral\|lightcyan\|lightgoldenrodyellow\|lightgray\|lightgreen\|lightgrey\|lightpink\|lightsalmon\|lightseagreen\|lightskyblue\|lightslategray\|lightslategrey\|lightsteelblue\|lightyellow\|lime\|limegreen\|linen\|magenta\|maroon\|mediumaquamarine\|mediumblue\|mediumorchid\|mediumpurple\|mediumseagreen\|mediumslateblue\|mediumspringgreen\|mediumturquoise\|mediumvioletred\|midnightblue\|mintcream\|mistyrose\|moccasin\|navajowhite\|navy\|oldlace\|olive\|olivedrab\|orange\|orangered\|orchid\|palegoldenrod\|palegreen\|paleturquoise\|palevioletred\|papayawhip\|peachpuff\|peru\|pink\|plum\|powderblue\|purple\|red\|rosybrown\|royalblue\|saddlebrown\|salmon\|sandybrown\|seagreen\|seashell\|sienna\|silver\|skyblue\|slateblue\|slategray\|slategrey\|snow\|springgreen\|steelblue\|tan\|teal\|thistle\|tomato\|turquoise\|violet\|wheat\|white\|whitesmoke\|yellow\|yellowgreen\|transparent\|/" + +" FIXME: These are actually case-insentivie too, but (a) specs recommend using +" mixed-case (b) it's hard to highlight the word `Background' correctly in +" all situations +syn case match +syn keyword cartoColor contained ActiveBorder ActiveCaption AppWorkspace ButtonFace ButtonHighlight ButtonShadow ButtonText CaptionText GrayText Highlight HighlightText InactiveBorder InactiveCaption InactiveCaptionText InfoBackground InfoText Menu MenuText Scrollbar ThreeDDarkShadow ThreeDFace ThreeDHighlight ThreeDLightShadow ThreeDShadow Window WindowFrame WindowText Background +syn case ignore +syn match cartoColor contained "\" +syn match cartoColor contained "\" +syn match cartoColor contained "#[0-9A-Fa-f]\{3\}\>" +syn match cartoColor contained "#[0-9A-Fa-f]\{6\}\>" +"syn match cartoColor contained "\" +syn region cartoDefinition transparent matchgroup=cartoBraces start='{' end='}' contains=carto.*Attr,cartoProp,cartoComment,cartoValue.*,cartoColor,cartoColor,cartoURL,cartoImportant,cartoStringQ,cartoStringQQ,cartoFunction,cartoUnicodeEscape,cartoDefinition,cartoClassName,cartoTagName,cartoIdentifier,cartoComment,cartoVariable,cartoFunction +" syn match cartoBraceError "}" + +syn match cartoPseudoClass ":\S*" contains=cartoPseudoClassId,cartoUnicodeEscape +syn keyword cartoPseudoClassId contained link visited active hover focus before after left right +syn match cartoPseudoClassId contained "\" +syn region cartoPseudoClassLang matchgroup=cartoPseudoClassId start=":lang(" end=")" oneline + +syn region cartoComment start="/\*" end="\*/" contains=@Spell + +syn match cartoUnicodeEscape "\\\x\{1,6}\s\?" +syn match cartoSpecialCharQQ +\\"+ contained +syn match cartoSpecialCharQ +\\'+ contained +syn region cartoStringQQ start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=cartoUnicodeEscape,cartoSpecialCharQQ +syn region cartoStringQ start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=cartoUnicodeEscape,cartoSpecialCharQ +syn match cartoClassName "\.[A-Za-z][A-Za-z0-9_-]\+" + +if main_syntax == "carto" + syn sync minlines=10 + syntax sync match cartoHighlight grouphere cartoDefinition /{/ +endif + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_carto_syn_inits") + if version < 508 + let did_carto_syn_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + HiLink cartoComment Comment + HiLink cartoVariable Identifier + HiLink cartoFuncDef Function + HiLink cartoComment Comment + HiLink cartoTagName Statement + HiLink cartoSelectorOp Special + HiLink cartoSelectorOp2 Special + HiLink cartoAttributeSelector Conditional + HiLink cartoProp StorageClass + HiLink cartoFontAttr Type + HiLink cartoColorAttr Type + HiLink cartoKeywordAttr Constant + HiLink cartoPseudoClassId PreProc + HiLink cartoPseudoClassLang Constant + HiLink cartoValueLength Number + HiLink cartoValueInteger Number + HiLink cartoValueNumber Number + HiLink cartoFunction Constant + HiLink cartoURL String + HiLink cartoFunctionName Function + HiLink cartoColor Constant + HiLink cartoColor Constant + HiLink cartoIdentifier Function + HiLink cartoInclude Include + HiLink cartoBraces SpecialChar + HiLink cartoBraceError Error + HiLink cartoError Error + HiLink cartoInclude Include + HiLink cartoUnicodeEscape Special + HiLink cartoStringQQ String + HiLink cartoStringQ String + HiLink cartoFontDescriptor Special + HiLink cartoFontDescriptorFunction Constant + HiLink cartoFontDescriptorProp StorageClass + HiLink cartoFontDescriptorAttr Type + HiLink cartoUnicodeRange Constant + HiLink cartoClassName Function + delcommand HiLink +endif + +let b:current_syntax = "carto" + +if main_syntax == 'carto' + unlet main_syntax +endif + + +" vim: ts=8 diff --git a/build/vimsyntax_template.js b/build/vimsyntax_template.js new file mode 100644 index 0000000..0cbb677 --- /dev/null +++ b/build/vimsyntax_template.js @@ -0,0 +1,160 @@ +" Vim syntax file +" Language: Carto +" Maintainer: Tom MacWright +" Original Author: Leaf Corcoran +" Modifier: Bryan J Swift +" Last Change: 2011 January 27 +" Carto by Tom MacWright +" LESS by Leaf Corcoran +" CSS2 by Nikolai Weibull +" Full CSS2, HTML4 support by Yeti + +" For version 5.x: Clear all syntax items +" For version 6.x: Quit when a syntax file was already loaded +if !exists("main_syntax") + if version < 600 + syntax clear + elseif exists("b:current_syntax") + finish +endif + let main_syntax = 'carto' +endif + +syn case ignore + +syn keyword cartoTagName Map + +syn match cartoSelectorOp "[+>.]" +syn match cartoSelectorOp2 "[~|><]\?=" contained +syn region cartoAttributeSelector matchgroup=cartoSelectorOp start="\[" end="]" transparent contains=cartoUnicodeEscape,cartoSelectorOp2,cartoStringQ,cartoStringQQ + +try +syn match cartoIdentifier "#[A-Za-zÀ-ÿ_@][A-Za-zÀ-ÿ0-9_@-]*" +catch /^.*/ +syn match cartoIdentifier "#[A-Za-z_@][A-Za-z0-9_@-]*" +endtry + +syn match cartoValueInteger "[-+]\=\d\+" +syn match cartoValueNumber "[-+]\=\d\+\(\.\d*\)\=" +syn match cartoValueLength "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\)" + +syn match cartoFontDescriptor "@font-face\>" nextgroup=cartoFontDescriptorBlock skipwhite skipnl +syn region cartoFontDescriptorBlock contained transparent matchgroup=cartoBraces start="{" end="}" contains=cartoComment,cartoError,cartoUnicodeEscape,cartoFontProp,cartoFontAttr,cartoStringQ,cartoStringQQ,cartoFontDescriptorProp,cartoValue.*,cartoFontDescriptorFunction,cartoUnicodeRange,cartoFontDescriptorAttr +syn match cartoFontDescriptorProp contained "\<\(unicode-range\|unit-per-em\|panose-1\|cap-height\|x-height\|definition-src\)\>" +syn keyword cartoFontDescriptorProp contained src stemv stemh slope ascent descent widths bbox baseline centerline mathline topline +syn keyword cartoFontDescriptorAttr contained all +syn region cartoFontDescriptorFunction contained matchgroup=cartoFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cartoStringQ,cartoStringQQ oneline keepend +syn match cartoUnicodeRange contained "U+[0-9A-Fa-f?]\+" +syn match cartoUnicodeRange contained "U+\x\+-\x\+" + +syn match cartoKeywordAttr "/\|<%= keyword_names %>\|/" + +" syn keyword cartoColor contained {{#colors}}{{.}} {{/colors}} +syn match cartoColor "/\|<%= color_names %>\|/" + +" FIXME: These are actually case-insentivie too, but (a) specs recommend using +" mixed-case (b) it's hard to highlight the word `Background' correctly in +" all situations +syn case match +syn keyword cartoColor contained ActiveBorder ActiveCaption AppWorkspace ButtonFace ButtonHighlight ButtonShadow ButtonText CaptionText GrayText Highlight HighlightText InactiveBorder InactiveCaption InactiveCaptionText InfoBackground InfoText Menu MenuText Scrollbar ThreeDDarkShadow ThreeDFace ThreeDHighlight ThreeDLightShadow ThreeDShadow Window WindowFrame WindowText Background +syn case ignore +syn match cartoColor contained "\" +syn match cartoColor contained "\" +syn match cartoColor contained "#[0-9A-Fa-f]\{3\}\>" +syn match cartoColor contained "#[0-9A-Fa-f]\{6\}\>" +"syn match cartoColor contained "\\|/" + +syn match cartoComment "//.*$" contains=@Spell +syn match cartoVariable "@[A-Za-z_-][A-Za-z0-9_-]*" contained +syn region cartoVariableDefinition start="^@" end=";" contains=carto.*Attr,carto.*Prop,cartoComment,cartoValue.*,cartoColor,cartoURL,cartoImportant,cartoStringQ,cartoStringQQ,cartoFunction,cartoUnicodeEscape,cartoDefinition,cartoClassName,cartoTagName,cartoIdentifier,cartoComment,cartoVariable,cartoFunction + +" captures both the definition and the call +syn region cartoFunction matchgroup=cartoFuncDef start="@[A-Za-z_-][A-Za-z0-9_-]*(" end=")" contains=carto.*Attr,carto.*Prop,cartoComment,cartoValue.*,cartoColor,cartoURL,cartoImportant,cartoStringQ,cartoStringQQ,cartoFunction,cartoUnicodeEscape,cartoDefinition,cartoClassName,cartoTagName,cartoIdentifier,cartoComment,cartoVariable,cartoFunction + +syn match cartoBraces contained "[{}]" +syn match cartoError contained "{@<>" +syn region cartoDefinition transparent matchgroup=cartoBraces start='{' end='}' contains=carto.*Attr,cartoProp,cartoComment,cartoValue.*,cartoColor,cartoColor,cartoURL,cartoImportant,cartoStringQ,cartoStringQQ,cartoFunction,cartoUnicodeEscape,cartoDefinition,cartoClassName,cartoTagName,cartoIdentifier,cartoComment,cartoVariable,cartoFunction +" syn match cartoBraceError "}" + +syn match cartoPseudoClass ":\S*" contains=cartoPseudoClassId,cartoUnicodeEscape +syn keyword cartoPseudoClassId contained link visited active hover focus before after left right +syn match cartoPseudoClassId contained "\" +syn region cartoPseudoClassLang matchgroup=cartoPseudoClassId start=":lang(" end=")" oneline + +syn region cartoComment start="/\*" end="\*/" contains=@Spell + +syn match cartoUnicodeEscape "\\\x\{1,6}\s\?" +syn match cartoSpecialCharQQ +\\"+ contained +syn match cartoSpecialCharQ +\\'+ contained +syn region cartoStringQQ start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=cartoUnicodeEscape,cartoSpecialCharQQ +syn region cartoStringQ start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=cartoUnicodeEscape,cartoSpecialCharQ +syn match cartoClassName "\.[A-Za-z][A-Za-z0-9_-]\+" + +if main_syntax == "carto" + syn sync minlines=10 + syntax sync match cartoHighlight grouphere cartoDefinition /{/ +endif + +" Define the default highlighting. +" For version 5.7 and earlier: only when not done already +" For version 5.8 and later: only when an item doesn't have highlighting yet +if version >= 508 || !exists("did_carto_syn_inits") + if version < 508 + let did_carto_syn_inits = 1 + command -nargs=+ HiLink hi link + else + command -nargs=+ HiLink hi def link + endif + + HiLink cartoComment Comment + HiLink cartoVariable Identifier + HiLink cartoFuncDef Function + HiLink cartoComment Comment + HiLink cartoTagName Statement + HiLink cartoSelectorOp Special + HiLink cartoSelectorOp2 Special + HiLink cartoAttributeSelector Conditional + HiLink cartoProp StorageClass + HiLink cartoFontAttr Type + HiLink cartoColorAttr Type + HiLink cartoKeywordAttr Constant + HiLink cartoPseudoClassId PreProc + HiLink cartoPseudoClassLang Constant + HiLink cartoValueLength Number + HiLink cartoValueInteger Number + HiLink cartoValueNumber Number + HiLink cartoFunction Constant + HiLink cartoURL String + HiLink cartoFunctionName Function + HiLink cartoColor Constant + HiLink cartoColor Constant + HiLink cartoIdentifier Function + HiLink cartoInclude Include + HiLink cartoBraces SpecialChar + HiLink cartoBraceError Error + HiLink cartoError Error + HiLink cartoInclude Include + HiLink cartoUnicodeEscape Special + HiLink cartoStringQQ String + HiLink cartoStringQ String + HiLink cartoFontDescriptor Special + HiLink cartoFontDescriptorFunction Constant + HiLink cartoFontDescriptorProp StorageClass + HiLink cartoFontDescriptorAttr Type + HiLink cartoUnicodeRange Constant + HiLink cartoClassName Function + delcommand HiLink +endif + +let b:current_syntax = "carto" + +if main_syntax == 'carto' + unlet main_syntax +endif + + +" vim: ts=8 diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..a7ca4aa --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +SPHINXPROJ = carto +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/api/mapnik/2.0.0.rst b/docs/api/mapnik/2.0.0.rst new file mode 100644 index 0000000..ee15eec --- /dev/null +++ b/docs/api/mapnik/2.0.0.rst @@ -0,0 +1,1912 @@ +2.0.0 +===== +Style +----- + + + + + +Symbolizers +----------- + + +map +^^^ + +background-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: none +*(transparent)* + +Map Background color + +------------ + + +background-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: +*(transparent)* + +An image that is repeated below all features on a map as a background. + +------------ + + +srs +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +*(The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space)* + +Map spatial reference (proj4 string) + +------------ + + +buffer-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No buffer will be used)* + +Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges". + +------------ + + +base +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.)* + +Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet. + +------------ + + +font-directory +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none +*(No map-specific fonts will be registered)* + +Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered). + +------------ + + + +polygon +^^^^^^^ + +polygon-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: rgba(128,128,128,1) +*(gray and fully opaque (alpha = 1), same as rgb(128,128,128))* + +Fill color to assign to a polygon + +------------ + + +polygon-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of polygon edges + +------------ + + +polygon-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of the polygon + +------------ + + +polygon-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Amount of smoothing applied + +------------ + + + +line +^^^^ + +line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: rgba(0,0,0,1) +*(black and fully opaque (alpha = 1), same as rgb(0,0,0))* + +The color of a drawn line + +------------ + + +line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +The width of a line in pixels + +------------ + + +line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of a line + +------------ + + +line-join +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``miter`` ``round`` ``bevel`` + + +Default Value: miter + + +The behavior of lines when joining + +------------ + + +line-cap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``butt`` ``round`` ``square`` + + +Default Value: butt + + +The display of line endings + +------------ + + +line-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of stroke line + +------------ + + +line-dasharray +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(solid line)* + +A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns. + +------------ + + +line-dash-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(solid line)* + +valid parameter but not currently used in renderers + +------------ + + +line-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full + + +Exposes an alternate AGG rendering method that sacrifices some accuracy for speed. + +------------ + + + +markers +^^^^^^^ + +marker-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: +*(An ellipse or circle, if width equals height)* + +An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse. + +------------ + + +marker-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The overall opacity of the marker + +------------ + + +marker-line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black + + +The color of the stroke around a marker shape. + +------------ + + +marker-line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.5 + + +The width of the stroke around the marker, in pixels. This is positioned on the boundary, so high values can cover the area itself. + +------------ + + +marker-line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of a line + +------------ + + +marker-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` + + +Default Value: line + + +Attempt to place markers on a point once or on a line repeatedly + +------------ + + +marker-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``arrow`` ``ellipse`` + + +Default Value: ellipse + + +The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width) + +------------ + + +marker-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +The width of the marker, if using one of the default types. + +------------ + + +marker-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +The height of the marker, if using one of the default types. + +------------ + + +marker-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: blue + + +The color of the area of the marker. + +------------ + + +marker-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow makers to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping markers are shown or hidden. + +------------ + + +marker-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache)* + +value to control whether the placement of the feature will prevent the placement of other features + +------------ + + +marker-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 100 + + +Space between repeated labels + +------------ + + +marker-max-error +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.2 + + +The maximum difference between actual marker placement and the marker-spacing parameter. Setting a high value can allow the renderer to try to resolve placement conflicts with other symbolizers. + +------------ + + +marker-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(no transformation)* + +An SVG transformation definition + +------------ + + + +shield +^^^^^^ + +shield-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Value to use for a shield"s text label. Data columns are specified using brackets like [column_name] + +------------ + + +shield-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Font name and style to use for the shield text + +------------ + + +shield-unlock-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(text alignment relative to the shield image uses the center of the image as the anchor for text positioning.)* + +This parameter should be set to true if you are trying to position text beside rather than on top of the shield image + +------------ + + +shield-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +The size of the shield text in pixels + +------------ + + +shield-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black + + +The color of the shield text + +------------ + + +shield-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` + + +Default Value: point + + +How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons. + +------------ + + +shield-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Tell positioning algorithm to avoid labeling near intersection edges. + +------------ + + +shield-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Minimum distance to the next shield symbol, not necessarily the same shield. + +------------ + + +shield-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +The spacing between repeated occurrences of the same shield on a line + +------------ + + +shield-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Determines the minimum amount of padding that a shield gets relative to other shields + +------------ + + +shield-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Length before wrapping long names. + +------------ + + +shield-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Use this character instead of a space to wrap long names. + +------------ + + +shield-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF +*(white)* + +Specifies the color of the halo around the text. + +------------ + + +shield-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo)* + +Specify the radius of the halo in pixels + +------------ + + +shield-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement. + +------------ + + +shield-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Vertical spacing between lines of multiline labels (in pixels) + +------------ + + +shield-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image file to render behind the shield text + +------------ + + +shield-text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right + +------------ + + +shield-text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down + +------------ + + +shield-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right + +------------ + + +shield-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down + +------------ + + +shield-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +(Default 1.0) - opacity of the image used for the shield + +------------ + + +shield-text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +(Default 1.0) - opacity of the text placed on top of the shield + +------------ + + +shield-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` + + +Default Value: middle + + +The shield's horizontal alignment from its centerpoint + +------------ + + +shield-text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` + + +Default Value: none + + +Transform the case of the characters + +------------ + + +shield-no-text +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Whether the shield should make room for a text label. + +------------ + + +shield-justify-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: middle + + +Define how text in a shield's label is justified + +------------ + + + +line-pattern +^^^^^^^^^^^^ + +line-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +An image file to be repeated and warped along a line + +------------ + + + +polygon-pattern +^^^^^^^^^^^^^^^ + +polygon-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image to use as a repeated pattern fill within a polygon + +------------ + + +polygon-pattern-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``local`` ``global`` + + +Default Value: local + + +Specify whether to align pattern fills to the layer or to the map. + +------------ + + +polygon-pattern-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of polygon pattern edges + +------------ + + + +raster +^^^^^^ + +raster-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of the raster symbolizer on top of other symbolizers. + +------------ + + +raster-mode +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``normal`` ``grain_merge`` ``grain_merge2`` ``multiply`` ``multiply2`` ``divide`` ``divide2`` ``screen`` ``hard_light`` + + +Default Value: normal + + +The blending technique used to overlay this raster image on the layer below. Normal simply covers the layer. Grain merge adds the two layers together and subtracts 128 from the value, making the resulting area sometimes high-contrast. Screen often gives a lighter, washed-out appearance. Multiply multiplies the pixels, giving a high-contrast result. Divide divides the upper layer by the lower layer, making a lighter version. + +------------ + + +raster-filter-factor +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: -1 +*(Allow the datasource to choose appropriate downscaling.)* + +This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed. + +------------ + + +raster-scaling +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``fast`` ``bilinear`` ``bilinear8`` ``bicubic`` ``spline16`` ``gaussian`` ``lanczos`` + + +Default Value: fast + + +The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality. + +------------ + + +raster-mesh-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``integer`` + + + + + +Default Value: 16 +*(Reprojection mesh will be 1/16 of the resolution of the source image)* + +A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion. + +------------ + + + +point +^^^^^ + +point-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image file to represent a point + +------------ + + +point-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow points to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping points are shown or hidden. + +------------ + + +point-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache)* + +value to control whether the placement of the feature will prevent the placement of other features + +------------ + + +point-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque)* + +A value from 0 to 1 to control the opacity of the point + +------------ + + +point-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``centroid`` ``interior`` + + +Default Value: centroid + + +How this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon. + +------------ + + +point-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(No transformation)* + +SVG transformation definition + +------------ + + + +text +^^^^ + +text-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Value to use for a text label. Data columns are specified using brackets like [column_name] + +------------ + + +text-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Font name and style to render a label in + +------------ + + +text-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +Text size in pixels + +------------ + + +text-ratio +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Define the amount of text (of the total) present on successive lines when wrapping occurs + +------------ + + +text-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Length of a chunk of text in characters before wrapping text + +------------ + + +text-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Use this character instead of a space to wrap long text. + +------------ + + +text-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Distance between repeated text labels on a line + +------------ + + +text-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Horizontal spacing adjustment between characters in pixels + +------------ + + +text-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Vertical spacing adjustment between lines in pixels + +------------ + + +text-label-position-tolerance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Allows the label to be displaced from its ideal position by a number of pixels + +------------ + + +text-max-char-angle-delta +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: none + + +If present, the maximum angle change, in degrees, allowed between adjacent characters in a label. This will stop label placement around sharp corners. + +------------ + + +text-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #000000 + + +Specifies the color for the text + +------------ + + +text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque)* + +A number from 0 to 1 specifying the opacity for the text + +------------ + + +text-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF +*(white)* + +Specifies the color of the halo around the text. + +------------ + + +text-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo)* + +Specify the radius of the halo in pixels + +------------ + + +text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right + +------------ + + +text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down + +------------ + + +text-vertical-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``top`` ``middle`` ``bottom`` + + +Default Value: middle +*(Default affected by value of dy; "bottom" for dy>0, "top" for dy<0.)* + +Position of label relative to point position. + +------------ + + +text-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Tell positioning algorithm to avoid labeling near intersection edges. + +------------ + + +text-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Minimum permitted distance to the next text symbolizer. + +------------ + + +text-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Determines the minimum amount of padding that a text symbolizer gets relative to other text + +------------ + + +text-min-path-length +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(place labels on all paths)* + +Place labels only on paths longer than this value. + +------------ + + +text-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow text to overlap with other text - overlapping markers will not be shown.)* + +Control whether overlapping text is shown or hidden. + +------------ + + +text-orientation +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Rotate the text. + +------------ + + +text-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` + + +Default Value: point + + +Control the style of placement of a point versus the geometry it is attached to. + +------------ + + +text-placement-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``dummy`` ``simple`` + + +Default Value: dummy + + +Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off. + +------------ + + +text-placements +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. See TextSymbolizer docs for format. + +------------ + + +text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` + + +Default Value: none + + +Transform the case of the characters + +------------ + + +text-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` + + +Default Value: middle + + +The text's horizontal alignment from its centerpoint + +------------ + + +text-align +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``right`` ``center`` + + +Default Value: center + + +Set the text alignment. + +------------ + + + +building +^^^^^^^^ + +building-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF + + +The color of the buildings walls. + +------------ + + +building-fill-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +The opacity of the building as a whole, including all walls. + +------------ + + +building-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +The height of the building in pixels. + +------------ + + + + + diff --git a/docs/api/mapnik/2.0.1.rst b/docs/api/mapnik/2.0.1.rst new file mode 100644 index 0000000..e12d36b --- /dev/null +++ b/docs/api/mapnik/2.0.1.rst @@ -0,0 +1,1912 @@ +2.0.1 +===== +Style +----- + + + + + +Symbolizers +----------- + + +map +^^^ + +background-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: none +*(transparent)* + +Map Background color + +------------ + + +background-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: +*(transparent)* + +An image that is repeated below all features on a map as a background. + +------------ + + +srs +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +*(The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space)* + +Map spatial reference (proj4 string) + +------------ + + +buffer-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No buffer will be used)* + +Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges". + +------------ + + +base +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.)* + +Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet. + +------------ + + +font-directory +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none +*(No map-specific fonts will be registered)* + +Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered). + +------------ + + + +polygon +^^^^^^^ + +polygon-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: rgba(128,128,128,1) +*(gray and fully opaque (alpha = 1), same as rgb(128,128,128))* + +Fill color to assign to a polygon + +------------ + + +polygon-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of polygon edges + +------------ + + +polygon-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of the polygon + +------------ + + +polygon-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Amount of smoothing applied + +------------ + + + +line +^^^^ + +line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: rgba(0,0,0,1) +*(black and fully opaque (alpha = 1), same as rgb(0,0,0))* + +The color of a drawn line + +------------ + + +line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +The width of a line in pixels + +------------ + + +line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of a line + +------------ + + +line-join +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``miter`` ``round`` ``bevel`` + + +Default Value: miter + + +The behavior of lines when joining + +------------ + + +line-cap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``butt`` ``round`` ``square`` + + +Default Value: butt + + +The display of line endings + +------------ + + +line-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of stroke line + +------------ + + +line-dasharray +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(solid line)* + +A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns. + +------------ + + +line-dash-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(solid line)* + +valid parameter but not currently used in renderers + +------------ + + +line-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full + + +Exposes an alternate AGG rendering method that sacrifices some accuracy for speed. + +------------ + + + +markers +^^^^^^^ + +marker-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: +*(An ellipse or circle, if width equals height)* + +An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse. + +------------ + + +marker-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The overall opacity of the marker + +------------ + + +marker-line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black + + +The color of the stroke around a marker shape. + +------------ + + +marker-line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.5 + + +The width of the stroke around the marker, in pixels. This is positioned on the boundary, so high values can cover the area itself. + +------------ + + +marker-line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of a line + +------------ + + +marker-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` + + +Default Value: line + + +Attempt to place markers on a point once or on a line repeatedly + +------------ + + +marker-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``arrow`` ``ellipse`` + + +Default Value: ellipse + + +The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width) + +------------ + + +marker-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +The width of the marker, if using one of the default types. + +------------ + + +marker-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +The height of the marker, if using one of the default types. + +------------ + + +marker-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: blue + + +The color of the area of the marker. + +------------ + + +marker-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow makers to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping markers are shown or hidden. + +------------ + + +marker-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache)* + +value to control whether the placement of the feature will prevent the placement of other features + +------------ + + +marker-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 100 + + +Space between repeated labels + +------------ + + +marker-max-error +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.2 + + +The maximum difference between actual marker placement and the marker-spacing parameter. Setting a high value can allow the renderer to try to resolve placement conflicts with other symbolizers. + +------------ + + +marker-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(no transformation)* + +An SVG transformation definition + +------------ + + + +shield +^^^^^^ + +shield-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Value to use for a shield"s text label. Data columns are specified using brackets like [column_name] + +------------ + + +shield-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Font name and style to use for the shield text + +------------ + + +shield-unlock-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(text alignment relative to the shield image uses the center of the image as the anchor for text positioning.)* + +This parameter should be set to true if you are trying to position text beside rather than on top of the shield image + +------------ + + +shield-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +The size of the shield text in pixels + +------------ + + +shield-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black + + +The color of the shield text + +------------ + + +shield-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` + + +Default Value: point + + +How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons. + +------------ + + +shield-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Tell positioning algorithm to avoid labeling near intersection edges. + +------------ + + +shield-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Minimum distance to the next shield symbol, not necessarily the same shield. + +------------ + + +shield-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +The spacing between repeated occurrences of the same shield on a line + +------------ + + +shield-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Determines the minimum amount of padding that a shield gets relative to other shields + +------------ + + +shield-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Length before wrapping long names. + +------------ + + +shield-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Use this character instead of a space to wrap long names. + +------------ + + +shield-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF +*(white)* + +Specifies the color of the halo around the text. + +------------ + + +shield-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo)* + +Specify the radius of the halo in pixels + +------------ + + +shield-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement. + +------------ + + +shield-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Vertical spacing between lines of multiline labels (in pixels) + +------------ + + +shield-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image file to render behind the shield text + +------------ + + +shield-text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right + +------------ + + +shield-text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down + +------------ + + +shield-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right + +------------ + + +shield-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down + +------------ + + +shield-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +(Default 1.0) - opacity of the image used for the shield + +------------ + + +shield-text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +(Default 1.0) - opacity of the text placed on top of the shield + +------------ + + +shield-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` + + +Default Value: middle + + +The shield's horizontal alignment from its centerpoint + +------------ + + +shield-text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` + + +Default Value: none + + +Transform the case of the characters + +------------ + + +shield-no-text +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Whether the shield should make room for a text label. + +------------ + + +shield-justify-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: middle + + +Define how text in a shield's label is justified + +------------ + + + +line-pattern +^^^^^^^^^^^^ + +line-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +An image file to be repeated and warped along a line + +------------ + + + +polygon-pattern +^^^^^^^^^^^^^^^ + +polygon-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image to use as a repeated pattern fill within a polygon + +------------ + + +polygon-pattern-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``local`` ``global`` + + +Default Value: local + + +Specify whether to align pattern fills to the layer or to the map. + +------------ + + +polygon-pattern-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of polygon pattern edges + +------------ + + + +raster +^^^^^^ + +raster-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of the raster symbolizer on top of other symbolizers. + +------------ + + +raster-mode +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``normal`` ``grain_merge`` ``grain_merge2`` ``multiply`` ``multiply2`` ``divide`` ``divide2`` ``screen`` ``hard_light`` + + +Default Value: normal + + +The blending technique used to overlay this raster image on the layer below. Normal simply covers the layer. Grain merge adds the two layers together and subtracts 128 from the value, making the resulting area sometimes high-contrast. Screen often gives a lighter, washed-out appearance. Multiply multiplies the pixels, giving a high-contrast result. Divide divides the upper layer by the lower layer, making a lighter version. + +------------ + + +raster-filter-factor +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: -1 +*(Allow the datasource to choose appropriate downscaling.)* + +This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed. + +------------ + + +raster-scaling +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``fast`` ``bilinear`` ``bilinear8`` ``bicubic`` ``spline16`` ``gaussian`` ``lanczos`` + + +Default Value: fast + + +The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality. + +------------ + + +raster-mesh-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``integer`` + + + + + +Default Value: 16 +*(Reprojection mesh will be 1/16 of the resolution of the source image)* + +A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion. + +------------ + + + +point +^^^^^ + +point-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image file to represent a point + +------------ + + +point-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow points to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping points are shown or hidden. + +------------ + + +point-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache)* + +value to control whether the placement of the feature will prevent the placement of other features + +------------ + + +point-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque)* + +A value from 0 to 1 to control the opacity of the point + +------------ + + +point-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``centroid`` ``interior`` + + +Default Value: centroid + + +How this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon. + +------------ + + +point-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(No transformation)* + +SVG transformation definition + +------------ + + + +text +^^^^ + +text-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Value to use for a text label. Data columns are specified using brackets like [column_name] + +------------ + + +text-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Font name and style to render a label in + +------------ + + +text-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +Text size in pixels + +------------ + + +text-ratio +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Define the amount of text (of the total) present on successive lines when wrapping occurs + +------------ + + +text-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Length of a chunk of text in characters before wrapping text + +------------ + + +text-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Use this character instead of a space to wrap long text. + +------------ + + +text-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Distance between repeated text labels on a line + +------------ + + +text-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Horizontal spacing adjustment between characters in pixels + +------------ + + +text-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Vertical spacing adjustment between lines in pixels + +------------ + + +text-label-position-tolerance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Allows the label to be displaced from its ideal position by a number of pixels + +------------ + + +text-max-char-angle-delta +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: none + + +If present, the maximum angle change, in degrees, allowed between adjacent characters in a label. This will stop label placement around sharp corners. + +------------ + + +text-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #000000 + + +Specifies the color for the text + +------------ + + +text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque)* + +A number from 0 to 1 specifying the opacity for the text + +------------ + + +text-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF +*(white)* + +Specifies the color of the halo around the text. + +------------ + + +text-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo)* + +Specify the radius of the halo in pixels + +------------ + + +text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right + +------------ + + +text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down + +------------ + + +text-vertical-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``top`` ``middle`` ``bottom`` + + +Default Value: middle +*(Default affected by value of dy; "bottom" for dy>0, "top" for dy<0.)* + +Position of label relative to point position. + +------------ + + +text-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Tell positioning algorithm to avoid labeling near intersection edges. + +------------ + + +text-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Minimum permitted distance to the next text symbolizer. + +------------ + + +text-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Determines the minimum amount of padding that a text symbolizer gets relative to other text + +------------ + + +text-min-path-length +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(place labels on all paths)* + +Place labels only on paths longer than this value. + +------------ + + +text-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow text to overlap with other text - overlapping markers will not be shown.)* + +Control whether overlapping text is shown or hidden. + +------------ + + +text-orientation +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Rotate the text. + +------------ + + +text-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` + + +Default Value: point + + +Control the style of placement of a point versus the geometry it is attached to. + +------------ + + +text-placement-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``dummy`` ``simple`` + + +Default Value: dummy + + +Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off. + +------------ + + +text-placements +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. See TextSymbolizer docs for format. + +------------ + + +text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` + + +Default Value: none + + +Transform the case of the characters + +------------ + + +text-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` + + +Default Value: middle + + +The text's horizontal alignment from its centerpoint + +------------ + + +text-align +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``right`` ``center`` + + +Default Value: center + + +Set the text alignment. + +------------ + + + +building +^^^^^^^^ + +building-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF + + +The color of the buildings walls. + +------------ + + +building-fill-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +The opacity of the building as a whole, including all walls. + +------------ + + +building-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +The height of the building in pixels. + +------------ + + + + + diff --git a/docs/api/mapnik/2.0.2.rst b/docs/api/mapnik/2.0.2.rst new file mode 100644 index 0000000..e9cb006 --- /dev/null +++ b/docs/api/mapnik/2.0.2.rst @@ -0,0 +1,1912 @@ +2.0.2 +===== +Style +----- + + + + + +Symbolizers +----------- + + +map +^^^ + +background-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: none +*(transparent)* + +Map Background color + +------------ + + +background-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: +*(transparent)* + +An image that is repeated below all features on a map as a background. + +------------ + + +srs +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +*(The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space)* + +Map spatial reference (proj4 string) + +------------ + + +buffer-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No buffer will be used)* + +Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges". + +------------ + + +base +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.)* + +Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet. + +------------ + + +font-directory +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none +*(No map-specific fonts will be registered)* + +Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered). + +------------ + + + +polygon +^^^^^^^ + +polygon-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: rgba(128,128,128,1) +*(gray and fully opaque (alpha = 1), same as rgb(128,128,128))* + +Fill color to assign to a polygon + +------------ + + +polygon-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of polygon edges + +------------ + + +polygon-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of the polygon + +------------ + + +polygon-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Amount of smoothing applied + +------------ + + + +line +^^^^ + +line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: rgba(0,0,0,1) +*(black and fully opaque (alpha = 1), same as rgb(0,0,0))* + +The color of a drawn line + +------------ + + +line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +The width of a line in pixels + +------------ + + +line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of a line + +------------ + + +line-join +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``miter`` ``round`` ``bevel`` + + +Default Value: miter + + +The behavior of lines when joining + +------------ + + +line-cap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``butt`` ``round`` ``square`` + + +Default Value: butt + + +The display of line endings + +------------ + + +line-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of stroke line + +------------ + + +line-dasharray +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(solid line)* + +A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns. + +------------ + + +line-dash-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(solid line)* + +valid parameter but not currently used in renderers + +------------ + + +line-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full + + +Exposes an alternate AGG rendering method that sacrifices some accuracy for speed. + +------------ + + + +markers +^^^^^^^ + +marker-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: +*(An ellipse or circle, if width equals height)* + +An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse. + +------------ + + +marker-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The overall opacity of the marker + +------------ + + +marker-line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black + + +The color of the stroke around a marker shape. + +------------ + + +marker-line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.5 + + +The width of the stroke around the marker, in pixels. This is positioned on the boundary, so high values can cover the area itself. + +------------ + + +marker-line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of a line + +------------ + + +marker-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` + + +Default Value: line + + +Attempt to place markers on a point once or on a line repeatedly + +------------ + + +marker-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``arrow`` ``ellipse`` + + +Default Value: ellipse + + +The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width) + +------------ + + +marker-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +The width of the marker, if using one of the default types. + +------------ + + +marker-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +The height of the marker, if using one of the default types. + +------------ + + +marker-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: blue + + +The color of the area of the marker. + +------------ + + +marker-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow makers to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping markers are shown or hidden. + +------------ + + +marker-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache)* + +value to control whether the placement of the feature will prevent the placement of other features + +------------ + + +marker-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 100 + + +Space between repeated labels + +------------ + + +marker-max-error +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.2 + + +The maximum difference between actual marker placement and the marker-spacing parameter. Setting a high value can allow the renderer to try to resolve placement conflicts with other symbolizers. + +------------ + + +marker-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(no transformation)* + +An SVG transformation definition + +------------ + + + +shield +^^^^^^ + +shield-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Value to use for a shield"s text label. Data columns are specified using brackets like [column_name] + +------------ + + +shield-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Font name and style to use for the shield text + +------------ + + +shield-unlock-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(text alignment relative to the shield image uses the center of the image as the anchor for text positioning.)* + +This parameter should be set to true if you are trying to position text beside rather than on top of the shield image + +------------ + + +shield-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +The size of the shield text in pixels + +------------ + + +shield-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black + + +The color of the shield text + +------------ + + +shield-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` + + +Default Value: point + + +How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons. + +------------ + + +shield-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Tell positioning algorithm to avoid labeling near intersection edges. + +------------ + + +shield-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Minimum distance to the next shield symbol, not necessarily the same shield. + +------------ + + +shield-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +The spacing between repeated occurrences of the same shield on a line + +------------ + + +shield-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Determines the minimum amount of padding that a shield gets relative to other shields + +------------ + + +shield-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Length before wrapping long names. + +------------ + + +shield-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Use this character instead of a space to wrap long names. + +------------ + + +shield-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF +*(white)* + +Specifies the color of the halo around the text. + +------------ + + +shield-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo)* + +Specify the radius of the halo in pixels + +------------ + + +shield-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement. + +------------ + + +shield-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Vertical spacing between lines of multiline labels (in pixels) + +------------ + + +shield-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image file to render behind the shield text + +------------ + + +shield-text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right + +------------ + + +shield-text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down + +------------ + + +shield-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right + +------------ + + +shield-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down + +------------ + + +shield-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +(Default 1.0) - opacity of the image used for the shield + +------------ + + +shield-text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +(Default 1.0) - opacity of the text placed on top of the shield + +------------ + + +shield-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` + + +Default Value: middle + + +The shield's horizontal alignment from its centerpoint + +------------ + + +shield-text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` + + +Default Value: none + + +Transform the case of the characters + +------------ + + +shield-no-text +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Whether the shield should make room for a text label. + +------------ + + +shield-justify-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: middle + + +Define how text in a shield's label is justified + +------------ + + + +line-pattern +^^^^^^^^^^^^ + +line-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +An image file to be repeated and warped along a line + +------------ + + + +polygon-pattern +^^^^^^^^^^^^^^^ + +polygon-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image to use as a repeated pattern fill within a polygon + +------------ + + +polygon-pattern-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``local`` ``global`` + + +Default Value: local + + +Specify whether to align pattern fills to the layer or to the map. + +------------ + + +polygon-pattern-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of polygon pattern edges + +------------ + + + +raster +^^^^^^ + +raster-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of the raster symbolizer on top of other symbolizers. + +------------ + + +raster-mode +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``normal`` ``grain_merge`` ``grain_merge2`` ``multiply`` ``multiply2`` ``divide`` ``divide2`` ``screen`` ``hard_light`` + + +Default Value: normal + + +The blending technique used to overlay this raster image on the layer below. Normal simply covers the layer. Grain merge adds the two layers together and subtracts 128 from the value, making the resulting area sometimes high-contrast. Screen often gives a lighter, washed-out appearance. Multiply multiplies the pixels, giving a high-contrast result. Divide divides the upper layer by the lower layer, making a lighter version. + +------------ + + +raster-filter-factor +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: -1 +*(Allow the datasource to choose appropriate downscaling.)* + +This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed. + +------------ + + +raster-scaling +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``fast`` ``bilinear`` ``bilinear8`` ``bicubic`` ``spline16`` ``gaussian`` ``lanczos`` + + +Default Value: fast + + +The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality. + +------------ + + +raster-mesh-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``integer`` + + + + + +Default Value: 16 +*(Reprojection mesh will be 1/16 of the resolution of the source image)* + +A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion. + +------------ + + + +point +^^^^^ + +point-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image file to represent a point + +------------ + + +point-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow points to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping points are shown or hidden. + +------------ + + +point-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache)* + +value to control whether the placement of the feature will prevent the placement of other features + +------------ + + +point-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque)* + +A value from 0 to 1 to control the opacity of the point + +------------ + + +point-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``centroid`` ``interior`` + + +Default Value: centroid + + +How this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon. + +------------ + + +point-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(No transformation)* + +SVG transformation definition + +------------ + + + +text +^^^^ + +text-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Value to use for a text label. Data columns are specified using brackets like [column_name] + +------------ + + +text-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Font name and style to render a label in + +------------ + + +text-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +Text size in pixels + +------------ + + +text-ratio +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Define the amount of text (of the total) present on successive lines when wrapping occurs + +------------ + + +text-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Length of a chunk of text in characters before wrapping text + +------------ + + +text-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Use this character instead of a space to wrap long text. + +------------ + + +text-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Distance between repeated text labels on a line + +------------ + + +text-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Horizontal spacing adjustment between characters in pixels + +------------ + + +text-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Vertical spacing adjustment between lines in pixels + +------------ + + +text-label-position-tolerance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Allows the label to be displaced from its ideal position by a number of pixels + +------------ + + +text-max-char-angle-delta +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: none + + +If present, the maximum angle change, in degrees, allowed between adjacent characters in a label. This will stop label placement around sharp corners. + +------------ + + +text-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #000000 + + +Specifies the color for the text + +------------ + + +text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque)* + +A number from 0 to 1 specifying the opacity for the text + +------------ + + +text-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF +*(white)* + +Specifies the color of the halo around the text. + +------------ + + +text-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo)* + +Specify the radius of the halo in pixels + +------------ + + +text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right + +------------ + + +text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down + +------------ + + +text-vertical-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``top`` ``middle`` ``bottom`` + + +Default Value: middle +*(Default affected by value of dy; "bottom" for dy>0, "top" for dy<0.)* + +Position of label relative to point position. + +------------ + + +text-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Tell positioning algorithm to avoid labeling near intersection edges. + +------------ + + +text-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Minimum permitted distance to the next text symbolizer. + +------------ + + +text-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Determines the minimum amount of padding that a text symbolizer gets relative to other text + +------------ + + +text-min-path-length +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(place labels on all paths)* + +Place labels only on paths longer than this value. + +------------ + + +text-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow text to overlap with other text - overlapping markers will not be shown.)* + +Control whether overlapping text is shown or hidden. + +------------ + + +text-orientation +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Rotate the text. + +------------ + + +text-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` + + +Default Value: point + + +Control the style of placement of a point versus the geometry it is attached to. + +------------ + + +text-placement-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``dummy`` ``simple`` + + +Default Value: dummy + + +Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off. + +------------ + + +text-placements +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. See TextSymbolizer docs for format. + +------------ + + +text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` + + +Default Value: none + + +Transform the case of the characters + +------------ + + +text-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` + + +Default Value: middle + + +The text's horizontal alignment from its centerpoint + +------------ + + +text-align +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``right`` ``center`` + + +Default Value: center + + +Set the text alignment. + +------------ + + + +building +^^^^^^^^ + +building-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF + + +The color of the buildings walls. + +------------ + + +building-fill-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +The opacity of the building as a whole, including all walls. + +------------ + + +building-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +The height of the building in pixels. + +------------ + + + + + diff --git a/docs/api/mapnik/2.1.0.rst b/docs/api/mapnik/2.1.0.rst new file mode 100644 index 0000000..7767290 --- /dev/null +++ b/docs/api/mapnik/2.1.0.rst @@ -0,0 +1,2527 @@ +2.1.0 +===== +Style +----- + + + + + +image-filters +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``functions`` + + + +Possible values: ``agg-stack-blur`` ``emboss`` ``blur`` ``gray`` ``sobel`` ``edge-detect`` ``x-gradient`` ``y-gradient`` ``invert`` ``sharpen`` + +Default Value: none +*(no filters)* + +A list of image filters. + +------------ + + + +comp-op +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current layer on top of other layers)* + +Composite operation. This defines how this layer should behave relative to layers atop or below it. + +------------ + + + +opacity +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``float`` + + + + + +Default Value: 1 +*(no separate buffer will be used and no alpha will be applied to the style after rendering)* + +An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer) + +------------ + + + +Symbolizers +----------- + + +map +^^^ + +background-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: none +*(transparent)* + +Map Background color + +------------ + + +background-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: +*(transparent)* + +An image that is repeated below all features on a map as a background. + +------------ + + +srs +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +*(The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space)* + +Map spatial reference (proj4 string) + +------------ + + +buffer-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No buffer will be used)* + +Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges". + +------------ + + +base +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.)* + +Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet. + +------------ + + +font-directory +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none +*(No map-specific fonts will be registered)* + +Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered). + +------------ + + + +polygon +^^^^^^^ + +polygon-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: rgba(128,128,128,1) +*(gray and fully opaque (alpha = 1), same as rgb(128,128,128))* + +Fill color to assign to a polygon + +------------ + + +polygon-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of the polygon + +------------ + + +polygon-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of polygon edges + +------------ + + +polygon-gamma-method +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``power`` ``linear`` ``none`` ``threshold`` ``multiply`` + + +Default Value: power +*(pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA)* + +An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h + +------------ + + +polygon-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +polygon-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +polygon-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(geometry will not be transformed)* + +Allows transformation functions to be applied to the geometry. + +------------ + + +polygon-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +line +^^^^ + +line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: rgba(0,0,0,1) +*(black and fully opaque (alpha = 1), same as rgb(0,0,0))* + +The color of a drawn line + +------------ + + +line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +The width of a line in pixels + +------------ + + +line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of a line + +------------ + + +line-join +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``miter`` ``round`` ``bevel`` + + +Default Value: miter + + +The behavior of lines when joining + +------------ + + +line-cap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``butt`` ``round`` ``square`` + + +Default Value: butt + + +The display of line endings + +------------ + + +line-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of stroke line + +------------ + + +line-gamma-method +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``power`` ``linear`` ``none`` ``threshold`` ``multiply`` + + +Default Value: power +*(pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA)* + +An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h + +------------ + + +line-dasharray +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(solid line)* + +A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns. + +------------ + + +line-dash-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(solid line)* + +valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled) + +------------ + + +line-miterlimit +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 4 +*(Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )')* + +The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts. + +------------ + + +line-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +line-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +line-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no offset)* + +Offsets a line a number of pixels parallel to its actual path. Postive values move the line left, negative values move it right (relative to the directionality of the line). + +------------ + + +line-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full + + +Exposes an alternate AGG rendering method that sacrifices some accuracy for speed. + +------------ + + +line-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(geometry will not be transformed)* + +Allows transformation functions to be applied to the geometry. + +------------ + + +line-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +markers +^^^^^^^ + +marker-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: +*(An ellipse or circle, if width equals height)* + +An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse. + +------------ + + +marker-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The stroke-opacity and fill-opacity will be used)* + +The overall opacity of the marker, if set, overrides both the opacity of the fill and the opacity of the stroke. + +------------ + + +marker-fill-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The fill opacity of the marker + +------------ + + +marker-line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black + + +The color of the stroke around a marker shape. + +------------ + + +marker-line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.5 + + +The width of the stroke around a marker shape, in pixels. This is positioned on the boundary, so high values can cover the area itself. + +------------ + + +marker-line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of a line + +------------ + + +marker-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``interior`` + + +Default Value: point +*(Place markers at the center point (centroid) of the geometry)* + +Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior + +------------ + + +marker-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``arrow`` ``ellipse`` + + +Default Value: ellipse + + +The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width) + +------------ + + +marker-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +The width of the marker, if using one of the default types. + +------------ + + +marker-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +The height of the marker, if using one of the default types. + +------------ + + +marker-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: blue + + +The color of the area of the marker. + +------------ + + +marker-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow makers to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping markers are shown or hidden. + +------------ + + +marker-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache)* + +value to control whether the placement of the feature will prevent the placement of other features + +------------ + + +marker-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 100 + + +Space between repeated labels + +------------ + + +marker-max-error +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.2 + + +The maximum difference between actual marker placement and the marker-spacing parameter. Setting a high value can allow the renderer to try to resolve placement conflicts with other symbolizers. + +------------ + + +marker-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: +*(No transformation)* + +SVG transformation definition + +------------ + + +marker-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +marker-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +marker-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(geometry will not be transformed)* + +Allows transformation functions to be applied to the geometry. + +------------ + + +marker-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +shield +^^^^^^ + +shield-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Value to use for a shield"s text label. Data columns are specified using brackets like [column_name] + +------------ + + +shield-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image file to render behind the shield text + +------------ + + +shield-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Font name and style to use for the shield text + +------------ + + +shield-unlock-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(text alignment relative to the shield image uses the center of the image as the anchor for text positioning.)* + +This parameter should be set to true if you are trying to position text beside rather than on top of the shield image + +------------ + + +shield-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +The size of the shield text in pixels + +------------ + + +shield-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black + + +The color of the shield text + +------------ + + +shield-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` + + +Default Value: point + + +How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons. + +------------ + + +shield-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Tell positioning algorithm to avoid labeling near intersection edges. + +------------ + + +shield-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow shields to overlap with other map elements already placed.)* + +Control whether overlapping shields are shown or hidden. + +------------ + + +shield-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Minimum distance to the next shield symbol, not necessarily the same shield. + +------------ + + +shield-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +The spacing between repeated occurrences of the same shield on a line + +------------ + + +shield-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Determines the minimum amount of padding that a shield gets relative to other shields + +------------ + + +shield-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Length of a chunk of text in characters before wrapping text + +------------ + + +shield-wrap-before +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width. + +------------ + + +shield-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Use this character instead of a space to wrap long names. + +------------ + + +shield-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF +*(white)* + +Specifies the color of the halo around the text. + +------------ + + +shield-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo)* + +Specify the radius of the halo in pixels + +------------ + + +shield-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement. + +------------ + + +shield-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Vertical spacing between lines of multiline labels (in pixels) + +------------ + + +shield-text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right + +------------ + + +shield-text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down + +------------ + + +shield-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right + +------------ + + +shield-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down + +------------ + + +shield-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +(Default 1.0) - opacity of the image used for the shield + +------------ + + +shield-text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +(Default 1.0) - opacity of the text placed on top of the shield + +------------ + + +shield-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` + + +Default Value: auto + + +The shield's horizontal alignment from its centerpoint + +------------ + + +shield-vertical-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``top`` ``middle`` ``bottom`` ``auto`` + + +Default Value: middle + + +The shield's vertical alignment from its centerpoint + +------------ + + +shield-text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` + + +Default Value: none + + +Transform the case of the characters + +------------ + + +shield-justify-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``center`` ``right`` ``auto`` + + +Default Value: auto + + +Define how text in a shield's label is justified + +------------ + + +shield-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +shield-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +line-pattern +^^^^^^^^^^^^ + +line-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +An image file to be repeated and warped along a line + +------------ + + +line-pattern-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +line-pattern-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +line-pattern-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(geometry will not be transformed)* + +Allows transformation functions to be applied to the geometry. + +------------ + + +line-pattern-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +polygon-pattern +^^^^^^^^^^^^^^^ + +polygon-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image to use as a repeated pattern fill within a polygon + +------------ + + +polygon-pattern-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``local`` ``global`` + + +Default Value: local + + +Specify whether to align pattern fills to the layer or to the map. + +------------ + + +polygon-pattern-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of polygon pattern edges + +------------ + + +polygon-pattern-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The image is rendered without modifications)* + +(Default 1.0) - Apply an opacity level to the image used for the pattern + +------------ + + +polygon-pattern-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +polygon-pattern-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +polygon-pattern-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(geometry will not be transformed)* + +Allows transformation functions to be applied to the geometry. + +------------ + + +polygon-pattern-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +raster +^^^^^^ + +raster-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of the raster symbolizer on top of other symbolizers. + +------------ + + +raster-filter-factor +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: -1 +*(Allow the datasource to choose appropriate downscaling.)* + +This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed. + +------------ + + +raster-scaling +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``near`` ``fast`` ``bilinear`` ``bilinear8`` ``bicubic`` ``spline16`` ``spline36`` ``hanning`` ``hamming`` ``hermite`` ``kaiser`` ``quadric`` ``catrom`` ``gaussian`` ``bessel`` ``mitchell`` ``sinc`` ``lanczos`` ``blackman`` + + +Default Value: near + + +The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality. + +------------ + + +raster-mesh-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 16 +*(Reprojection mesh will be 1/16 of the resolution of the source image)* + +A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion. + +------------ + + +raster-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +point +^^^^^ + +point-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image file to represent a point + +------------ + + +point-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow points to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping points are shown or hidden. + +------------ + + +point-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache)* + +value to control whether the placement of the feature will prevent the placement of other features + +------------ + + +point-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque)* + +A value from 0 to 1 to control the opacity of the point + +------------ + + +point-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``centroid`` ``interior`` + + +Default Value: centroid + + +How this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon. + +------------ + + +point-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: +*(No transformation)* + +SVG transformation definition + +------------ + + +point-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +text +^^^^ + +text-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Value to use for a text label. Data columns are specified using brackets like [column_name] + +------------ + + +text-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Font name and style to render a label in + +------------ + + +text-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +Text size in pixels + +------------ + + +text-ratio +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Define the amount of text (of the total) present on successive lines when wrapping occurs + +------------ + + +text-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Length of a chunk of text in characters before wrapping text + +------------ + + +text-wrap-before +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width. + +------------ + + +text-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Use this character instead of a space to wrap long text. + +------------ + + +text-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Distance between repeated text labels on a line (aka. label-spacing) + +------------ + + +text-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Horizontal spacing adjustment between characters in pixels + +------------ + + +text-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Vertical spacing adjustment between lines in pixels + +------------ + + +text-label-position-tolerance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line) + +------------ + + +text-max-char-angle-delta +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 22.5 + + +The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners. + +------------ + + +text-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #000000 + + +Specifies the color for the text + +------------ + + +text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque)* + +A number from 0 to 1 specifying the opacity for the text + +------------ + + +text-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF +*(white)* + +Specifies the color of the halo around the text. + +------------ + + +text-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo)* + +Specify the radius of the halo in pixels + +------------ + + +text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right + +------------ + + +text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down + +------------ + + +text-vertical-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``top`` ``middle`` ``bottom`` ``auto`` + + +Default Value: auto +*(Default affected by value of dy; "bottom" for dy>0, "top" for dy<0.)* + +Position of label relative to point position. + +------------ + + +text-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Tell positioning algorithm to avoid labeling near intersection edges. + +------------ + + +text-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Minimum permitted distance to the next text symbolizer. + +------------ + + +text-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Determines the minimum amount of padding that a text symbolizer gets relative to other text + +------------ + + +text-min-path-length +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(place labels on all paths)* + +Place labels only on paths longer than this value. + +------------ + + +text-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow text to overlap with other text - overlapping markers will not be shown.)* + +Control whether overlapping text is shown or hidden. + +------------ + + +text-orientation +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Rotate the text. + +------------ + + +text-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` + + +Default Value: point + + +Control the style of placement of a point versus the geometry it is attached to. + +------------ + + +text-placement-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``dummy`` ``simple`` ``list`` + + +Default Value: dummy + + +Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off. + +------------ + + +text-placements +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is ``text-placements: "E,NE,SE,W,NW,SW";`` + +------------ + + +text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` + + +Default Value: none + + +Transform the case of the characters + +------------ + + +text-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` + + +Default Value: auto + + +The text's horizontal alignment from its centerpoint + +------------ + + +text-align +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``right`` ``center`` ``auto`` + + +Default Value: auto +*(Auto alignment means that text will be centered by default except when using the ``placement-type`` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the ``text-placements`` directives)* + +Define how text is justified + +------------ + + +text-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +text-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +building +^^^^^^^^ + +building-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF + + +The color of the buildings walls. + +------------ + + +building-fill-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +The opacity of the building as a whole, including all walls. + +------------ + + +building-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +The height of the building in pixels. + +------------ + + + + + diff --git a/docs/api/mapnik/2.1.1.rst b/docs/api/mapnik/2.1.1.rst new file mode 100644 index 0000000..571356c --- /dev/null +++ b/docs/api/mapnik/2.1.1.rst @@ -0,0 +1,2544 @@ +2.1.1 +===== +Style +----- + + + + + +image-filters +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``functions`` + + + +Possible values: ``agg-stack-blur`` ``emboss`` ``blur`` ``gray`` ``sobel`` ``edge-detect`` ``x-gradient`` ``y-gradient`` ``invert`` ``sharpen`` + +Default Value: none +*(no filters)* + +A list of image filters. + +------------ + + + +comp-op +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current layer on top of other layers)* + +Composite operation. This defines how this layer should behave relative to layers atop or below it. + +------------ + + + +opacity +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``float`` + + + + + +Default Value: 1 +*(no separate buffer will be used and no alpha will be applied to the style after rendering)* + +An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer) + +------------ + + + +Symbolizers +----------- + + +map +^^^ + +background-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: none +*(transparent)* + +Map Background color + +------------ + + +background-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: +*(transparent)* + +An image that is repeated below all features on a map as a background. + +------------ + + +srs +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +*(The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space)* + +Map spatial reference (proj4 string) + +------------ + + +buffer-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No buffer will be used)* + +Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges". + +------------ + + +base +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.)* + +Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet. + +------------ + + +font-directory +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none +*(No map-specific fonts will be registered)* + +Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered). + +------------ + + + +polygon +^^^^^^^ + +polygon-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: rgba(128,128,128,1) +*(gray and fully opaque (alpha = 1), same as rgb(128,128,128))* + +Fill color to assign to a polygon + +------------ + + +polygon-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of the polygon + +------------ + + +polygon-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of polygon edges + +------------ + + +polygon-gamma-method +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``power`` ``linear`` ``none`` ``threshold`` ``multiply`` + + +Default Value: power +*(pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA)* + +An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h + +------------ + + +polygon-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +polygon-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +polygon-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(geometry will not be transformed)* + +Allows transformation functions to be applied to the geometry. + +------------ + + +polygon-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +line +^^^^ + +line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: rgba(0,0,0,1) +*(black and fully opaque (alpha = 1), same as rgb(0,0,0))* + +The color of a drawn line + +------------ + + +line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +The width of a line in pixels + +------------ + + +line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of a line + +------------ + + +line-join +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``miter`` ``round`` ``bevel`` + + +Default Value: miter + + +The behavior of lines when joining + +------------ + + +line-cap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``butt`` ``round`` ``square`` + + +Default Value: butt + + +The display of line endings + +------------ + + +line-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of stroke line + +------------ + + +line-gamma-method +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``power`` ``linear`` ``none`` ``threshold`` ``multiply`` + + +Default Value: power +*(pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA)* + +An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h + +------------ + + +line-dasharray +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(solid line)* + +A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns. + +------------ + + +line-dash-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(solid line)* + +valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled) + +------------ + + +line-miterlimit +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 4 +*(Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )')* + +The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts. + +------------ + + +line-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +line-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +line-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no offset)* + +Offsets a line a number of pixels parallel to its actual path. Postive values move the line left, negative values move it right (relative to the directionality of the line). + +------------ + + +line-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full + + +Exposes an alternate AGG rendering method that sacrifices some accuracy for speed. + +------------ + + +line-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(geometry will not be transformed)* + +Allows transformation functions to be applied to the geometry. + +------------ + + +line-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +markers +^^^^^^^ + +marker-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: +*(An ellipse or circle, if width equals height)* + +An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse. + +------------ + + +marker-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The stroke-opacity and fill-opacity will be used)* + +The overall opacity of the marker, if set, overrides both the opacity of the fill and the opacity of the stroke. + +------------ + + +marker-fill-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The fill opacity of the marker + +------------ + + +marker-line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black + + +The color of the stroke around a marker shape. + +------------ + + +marker-line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.5 + + +The width of the stroke around a marker shape, in pixels. This is positioned on the boundary, so high values can cover the area itself. + +------------ + + +marker-line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of a line + +------------ + + +marker-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``interior`` + + +Default Value: point +*(Place markers at the center point (centroid) of the geometry)* + +Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior + +------------ + + +marker-multi-policy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``each`` ``whole`` ``largest`` + + +Default Value: each +*(If a feature contains multiple geometries and the placement type is either point or interior then a marker will be rendered for each)* + +A special setting to allow the user to control rendering behavior for 'multi-geometries' (when a feature contains multiple geometries). This setting does not apply to markers placed along lines. The 'each' policy is default and means all geometries will get a marker. The 'whole' policy means that the aggregate centroid between all geometries will be used. The 'largest' policy means that only the largest (by bounding box areas) feature will get a rendered marker (this is how text labeling behaves by default). + +------------ + + +marker-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``arrow`` ``ellipse`` + + +Default Value: ellipse + + +The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width) + +------------ + + +marker-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``expression`` + + + + + +Default Value: 10 + + +The width of the marker, if using one of the default types. + +------------ + + +marker-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``expression`` + + + + + +Default Value: 10 + + +The height of the marker, if using one of the default types. + +------------ + + +marker-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: blue + + +The color of the area of the marker. + +------------ + + +marker-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow makers to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping markers are shown or hidden. + +------------ + + +marker-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache)* + +value to control whether the placement of the feature will prevent the placement of other features + +------------ + + +marker-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 100 + + +Space between repeated labels + +------------ + + +marker-max-error +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.2 + + +The maximum difference between actual marker placement and the marker-spacing parameter. Setting a high value can allow the renderer to try to resolve placement conflicts with other symbolizers. + +------------ + + +marker-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: +*(No transformation)* + +SVG transformation definition + +------------ + + +marker-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +marker-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +marker-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(geometry will not be transformed)* + +Allows transformation functions to be applied to the geometry. + +------------ + + +marker-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +shield +^^^^^^ + +shield-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``expression`` + + + + + +Default Value: + + +Value to use for a shield"s text label. Data columns are specified using brackets like [column_name] + +------------ + + +shield-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image file to render behind the shield text + +------------ + + +shield-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Font name and style to use for the shield text + +------------ + + +shield-unlock-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(text alignment relative to the shield image uses the center of the image as the anchor for text positioning.)* + +This parameter should be set to true if you are trying to position text beside rather than on top of the shield image + +------------ + + +shield-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +The size of the shield text in pixels + +------------ + + +shield-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black + + +The color of the shield text + +------------ + + +shield-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` + + +Default Value: point + + +How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons. + +------------ + + +shield-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Tell positioning algorithm to avoid labeling near intersection edges. + +------------ + + +shield-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow shields to overlap with other map elements already placed.)* + +Control whether overlapping shields are shown or hidden. + +------------ + + +shield-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Minimum distance to the next shield symbol, not necessarily the same shield. + +------------ + + +shield-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +The spacing between repeated occurrences of the same shield on a line + +------------ + + +shield-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Determines the minimum amount of padding that a shield gets relative to other shields + +------------ + + +shield-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Length of a chunk of text in characters before wrapping text + +------------ + + +shield-wrap-before +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width. + +------------ + + +shield-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Use this character instead of a space to wrap long names. + +------------ + + +shield-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF +*(white)* + +Specifies the color of the halo around the text. + +------------ + + +shield-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo)* + +Specify the radius of the halo in pixels + +------------ + + +shield-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement. + +------------ + + +shield-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Vertical spacing between lines of multiline labels (in pixels) + +------------ + + +shield-text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right + +------------ + + +shield-text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down + +------------ + + +shield-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right + +------------ + + +shield-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down + +------------ + + +shield-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +(Default 1.0) - opacity of the image used for the shield + +------------ + + +shield-text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +(Default 1.0) - opacity of the text placed on top of the shield + +------------ + + +shield-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` + + +Default Value: auto + + +The shield's horizontal alignment from its centerpoint + +------------ + + +shield-vertical-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``top`` ``middle`` ``bottom`` ``auto`` + + +Default Value: middle + + +The shield's vertical alignment from its centerpoint + +------------ + + +shield-text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` + + +Default Value: none + + +Transform the case of the characters + +------------ + + +shield-justify-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``center`` ``right`` ``auto`` + + +Default Value: auto + + +Define how text in a shield's label is justified + +------------ + + +shield-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +shield-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +line-pattern +^^^^^^^^^^^^ + +line-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +An image file to be repeated and warped along a line + +------------ + + +line-pattern-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +line-pattern-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +line-pattern-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(geometry will not be transformed)* + +Allows transformation functions to be applied to the geometry. + +------------ + + +line-pattern-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +polygon-pattern +^^^^^^^^^^^^^^^ + +polygon-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image to use as a repeated pattern fill within a polygon + +------------ + + +polygon-pattern-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``local`` ``global`` + + +Default Value: local + + +Specify whether to align pattern fills to the layer or to the map. + +------------ + + +polygon-pattern-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of polygon pattern edges + +------------ + + +polygon-pattern-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The image is rendered without modifications)* + +(Default 1.0) - Apply an opacity level to the image used for the pattern + +------------ + + +polygon-pattern-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +polygon-pattern-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +polygon-pattern-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(geometry will not be transformed)* + +Allows transformation functions to be applied to the geometry. + +------------ + + +polygon-pattern-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +raster +^^^^^^ + +raster-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of the raster symbolizer on top of other symbolizers. + +------------ + + +raster-filter-factor +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: -1 +*(Allow the datasource to choose appropriate downscaling.)* + +This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed. + +------------ + + +raster-scaling +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``near`` ``fast`` ``bilinear`` ``bilinear8`` ``bicubic`` ``spline16`` ``spline36`` ``hanning`` ``hamming`` ``hermite`` ``kaiser`` ``quadric`` ``catrom`` ``gaussian`` ``bessel`` ``mitchell`` ``sinc`` ``lanczos`` ``blackman`` + + +Default Value: near + + +The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality. + +------------ + + +raster-mesh-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 16 +*(Reprojection mesh will be 1/16 of the resolution of the source image)* + +A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion. + +------------ + + +raster-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +point +^^^^^ + +point-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image file to represent a point + +------------ + + +point-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow points to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping points are shown or hidden. + +------------ + + +point-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache)* + +value to control whether the placement of the feature will prevent the placement of other features + +------------ + + +point-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque)* + +A value from 0 to 1 to control the opacity of the point + +------------ + + +point-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``centroid`` ``interior`` + + +Default Value: centroid + + +How this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon. + +------------ + + +point-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: +*(No transformation)* + +SVG transformation definition + +------------ + + +point-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +text +^^^^ + +text-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``expression`` + + + + + +Default Value: + + +Value to use for a text label. Data columns are specified using brackets like [column_name] + +------------ + + +text-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Font name and style to render a label in + +------------ + + +text-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +Text size in pixels + +------------ + + +text-ratio +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Define the amount of text (of the total) present on successive lines when wrapping occurs + +------------ + + +text-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Length of a chunk of text in characters before wrapping text + +------------ + + +text-wrap-before +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width. + +------------ + + +text-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Use this character instead of a space to wrap long text. + +------------ + + +text-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Distance between repeated text labels on a line (aka. label-spacing) + +------------ + + +text-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Horizontal spacing adjustment between characters in pixels + +------------ + + +text-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Vertical spacing adjustment between lines in pixels + +------------ + + +text-label-position-tolerance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line) + +------------ + + +text-max-char-angle-delta +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 22.5 + + +The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners. + +------------ + + +text-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #000000 + + +Specifies the color for the text + +------------ + + +text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque)* + +A number from 0 to 1 specifying the opacity for the text + +------------ + + +text-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF +*(white)* + +Specifies the color of the halo around the text. + +------------ + + +text-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo)* + +Specify the radius of the halo in pixels + +------------ + + +text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right + +------------ + + +text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down + +------------ + + +text-vertical-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``top`` ``middle`` ``bottom`` ``auto`` + + +Default Value: auto +*(Default affected by value of dy; "bottom" for dy>0, "top" for dy<0.)* + +Position of label relative to point position. + +------------ + + +text-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Tell positioning algorithm to avoid labeling near intersection edges. + +------------ + + +text-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Minimum permitted distance to the next text symbolizer. + +------------ + + +text-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Determines the minimum amount of padding that a text symbolizer gets relative to other text + +------------ + + +text-min-path-length +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(place labels on all paths)* + +Place labels only on paths longer than this value. + +------------ + + +text-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow text to overlap with other text - overlapping markers will not be shown.)* + +Control whether overlapping text is shown or hidden. + +------------ + + +text-orientation +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``expression`` + + + + + +Default Value: 0 + + +Rotate the text. + +------------ + + +text-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` + + +Default Value: point + + +Control the style of placement of a point versus the geometry it is attached to. + +------------ + + +text-placement-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``dummy`` ``simple`` ``list`` + + +Default Value: dummy + + +Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off. + +------------ + + +text-placements +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is ``text-placements: "E,NE,SE,W,NW,SW";`` + +------------ + + +text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` + + +Default Value: none + + +Transform the case of the characters + +------------ + + +text-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` + + +Default Value: auto + + +The text's horizontal alignment from its centerpoint + +------------ + + +text-align +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``right`` ``center`` ``auto`` + + +Default Value: auto +*(Auto alignment means that text will be centered by default except when using the ``placement-type`` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the ``text-placements`` directives)* + +Define how text is justified + +------------ + + +text-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +text-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +building +^^^^^^^^ + +building-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF + + +The color of the buildings walls. + +------------ + + +building-fill-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +The opacity of the building as a whole, including all walls. + +------------ + + +building-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``expression`` + + + + + +Default Value: 0 + + +The height of the building in pixels. + +------------ + + + + + diff --git a/docs/api/mapnik/2.2.0.rst b/docs/api/mapnik/2.2.0.rst new file mode 100644 index 0000000..8798cf3 --- /dev/null +++ b/docs/api/mapnik/2.2.0.rst @@ -0,0 +1,3045 @@ +2.2.0 +===== +Style +----- + + + + + +image-filters +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``functions`` + + + +Possible values: ``agg-stack-blur`` ``emboss`` ``blur`` ``gray`` ``sobel`` ``edge-detect`` ``x-gradient`` ``y-gradient`` ``invert`` ``sharpen`` ``colorize-alpha`` + +Default Value: none +*(no filters)* + +A list of image filters that will be applied to the active rendering canvas for a given style. The presence of one more more ``image-filters`` will trigger a new canvas to be created before starting to render a style and then this canvas will be composited back into the main canvas after rendering all features and after all ``image-filters`` have been applied. See ``direct-image-filters`` if you want to apply a filter directly to the main canvas. + +------------ + + + +direct-image-filters +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``functions`` + + + +Possible values: ``agg-stack-blur`` ``emboss`` ``blur`` ``gray`` ``sobel`` ``edge-detect`` ``x-gradient`` ``y-gradient`` ``invert`` ``sharpen`` ``colorize-alpha`` + +Default Value: none +*(no filters)* + +A list of image filters to apply to the main canvas (see the ``image-filters`` doc for how they work on a separate canvas) + +------------ + + + +comp-op +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current layer on top of other layers)* + +Composite operation. This defines how this layer should behave relative to layers atop or below it. + +------------ + + + +opacity +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``float`` + + + + + +Default Value: 1 +*(no separate buffer will be used and no alpha will be applied to the style after rendering)* + +An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer) + +------------ + + + +Symbolizers +----------- + + +map +^^^ + +background-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: none +*(transparent)* + +Map Background color + +------------ + + +background-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: +*(transparent)* + +An image that is repeated below all features on a map as a background. + +------------ + + +srs +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +*(The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space)* + +Map spatial reference (proj4 string) + +------------ + + +buffer-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No buffer will be used)* + +Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges". + +------------ + + +base +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.)* + +Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet. + +------------ + + +font-directory +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none +*(No map-specific fonts will be registered)* + +Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered). + +------------ + + + +polygon +^^^^^^^ + +polygon +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a polygon symbolizer rule or emitting it with default values. + +------------ + + +polygon-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: rgba(128,128,128,1) +*(gray and fully opaque (alpha = 1), same as rgb(128,128,128))* + +Fill color to assign to a polygon + +------------ + + +polygon-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of the polygon + +------------ + + +polygon-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of polygon edges + +------------ + + +polygon-gamma-method +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``power`` ``linear`` ``none`` ``threshold`` ``multiply`` + + +Default Value: power +*(pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA)* + +An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h + +------------ + + +polygon-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +polygon-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified)* + +geometries are simplified by the given tolerance + +------------ + + +polygon-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` + + +Default Value: radial-distance +*(geometry will not be simplified using the radial distance algorithm)* + +geometries are simplified by the given algorithm + +------------ + + +polygon-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +polygon-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(geometry will not be transformed)* + +Allows transformation functions to be applied to the geometry. + +------------ + + +polygon-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +line +^^^^ + +line +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a line symbolizer rule or emitting it with default values. + +------------ + + +line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: rgba(0,0,0,1) +*(black and fully opaque (alpha = 1), same as rgb(0,0,0))* + +The color of a drawn line + +------------ + + +line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +The width of a line in pixels + +------------ + + +line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of a line + +------------ + + +line-join +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``miter`` ``round`` ``bevel`` + + +Default Value: miter + + +The behavior of lines when joining + +------------ + + +line-cap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``butt`` ``round`` ``square`` + + +Default Value: butt + + +The display of line endings + +------------ + + +line-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of stroke line + +------------ + + +line-gamma-method +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``power`` ``linear`` ``none`` ``threshold`` ``multiply`` + + +Default Value: power +*(pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA)* + +An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions.h + +------------ + + +line-dasharray +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(solid line)* + +A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns. + +------------ + + +line-dash-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(solid line)* + +valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled) + +------------ + + +line-miterlimit +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 4 +*(Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )')* + +The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts. + +------------ + + +line-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +line-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified)* + +geometries are simplified by the given tolerance + +------------ + + +line-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` + + +Default Value: radial-distance +*(geometry will not be simplified using the radial distance algorithm)* + +geometries are simplified by the given algorithm + +------------ + + +line-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +line-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no offset)* + +Offsets a line a number of pixels parallel to its actual path. Positive values move the line left, negative values move it right (relative to the directionality of the line). + +------------ + + +line-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full + + +Exposes an alternate AGG rendering method that sacrifices some accuracy for speed. + +------------ + + +line-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(geometry will not be transformed)* + +Allows transformation functions to be applied to the geometry. + +------------ + + +line-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +markers +^^^^^^^ + +marker +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a marker symbolizer rule or emitting it with default values. + +------------ + + +marker-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: +*(An ellipse or circle, if width equals height)* + +An SVG file that this marker shows at each placement. If no file is given, the marker will show an ellipse. + +------------ + + +marker-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The stroke-opacity and fill-opacity will be used)* + +The overall opacity of the marker, overrides both the opacity of the fill and the opacity of the stroke. + +------------ + + +marker-fill-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The fill opacity of the marker + +------------ + + +marker-line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black + + +The color of the stroke around a marker shape. + +------------ + + +marker-line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.5 + + +The width of the stroke around a marker shape, in pixels. This is positioned on the boundary, so high values can cover the area itself. + +------------ + + +marker-line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of a line + +------------ + + +marker-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``interior`` + + +Default Value: point +*(Place markers at the center point (centroid) of the geometry)* + +Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior + +------------ + + +marker-multi-policy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``each`` ``whole`` ``largest`` + + +Default Value: each +*(If a feature contains multiple geometries and the placement type is either point or interior then a marker will be rendered for each)* + +A special setting to allow the user to control rendering behavior for 'multi-geometries' (when a feature contains multiple geometries). This setting does not apply to markers placed along lines. The 'each' policy is default and means all geometries will get a marker. The 'whole' policy means that the aggregate centroid between all geometries will be used. The 'largest' policy means that only the largest (by bounding box areas) feature will get a rendered marker (this is how text labeling behaves by default). + +------------ + + +marker-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``arrow`` ``ellipse`` + + +Default Value: ellipse + + +The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width) + +------------ + + +marker-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +The width of the marker, if using one of the default types. + +------------ + + +marker-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +The height of the marker, if using one of the default types. + +------------ + + +marker-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: blue + + +The color of the area of the marker. + +------------ + + +marker-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow makers to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping markers are shown or hidden. + +------------ + + +marker-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache)* + +value to control whether the placement of the feature will prevent the placement of other features + +------------ + + +marker-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 100 + + +Space between repeated markers in pixels. If the spacing is less than the marker size or larger than the line segment length then no marker will be placed + +------------ + + +marker-max-error +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.2 + + +The maximum difference between actual marker placement and the marker-spacing parameter. Setting a high value can allow the renderer to try to resolve placement conflicts with other symbolizers. + +------------ + + +marker-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: +*(No transformation)* + +SVG transformation definition + +------------ + + +marker-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +marker-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +marker-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(geometry will not be transformed)* + +Allows transformation functions to be applied to the geometry. + +------------ + + +marker-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +shield +^^^^^^ + +shield +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a shield symbolizer. + +------------ + + +shield-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Value to use for a shield"s text label. Data columns are specified using brackets like [column_name] + +------------ + + +shield-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image file to render behind the shield text + +------------ + + +shield-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Font name and style to use for the shield text + +------------ + + +shield-unlock-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(text alignment relative to the shield image uses the center of the image as the anchor for text positioning.)* + +This parameter should be set to true if you are trying to position text beside rather than on top of the shield image + +------------ + + +shield-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +The size of the shield text in pixels + +------------ + + +shield-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black + + +The color of the shield text + +------------ + + +shield-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` + + +Default Value: point + + +How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons. + +------------ + + +shield-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Avoid placing shields that intersect with tile boundaries. + +------------ + + +shield-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow shields to overlap with other map elements already placed.)* + +Control whether overlapping shields are shown or hidden. + +------------ + + +shield-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Minimum distance to the next shield symbol, not necessarily the same shield. + +------------ + + +shield-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +The spacing between repeated occurrences of the same shield on a line + +------------ + + +shield-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Minimum distance a shield will be placed from the edge of a metatile. + +------------ + + +shield-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Length of a chunk of text in characters before wrapping text + +------------ + + +shield-wrap-before +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width. + +------------ + + +shield-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Use this character instead of a space to wrap long names. + +------------ + + +shield-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF +*(white)* + +Specifies the color of the halo around the text. + +------------ + + +shield-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo)* + +Specify the radius of the halo in pixels + +------------ + + +shield-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement. + +------------ + + +shield-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Vertical spacing between lines of multiline labels (in pixels) + +------------ + + +shield-text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right + +------------ + + +shield-text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down + +------------ + + +shield-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right + +------------ + + +shield-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down + +------------ + + +shield-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +The opacity of the image used for the shield + +------------ + + +shield-text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +The opacity of the text placed on top of the shield + +------------ + + +shield-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` + + +Default Value: auto + + +The shield's horizontal alignment from its centerpoint + +------------ + + +shield-vertical-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``top`` ``middle`` ``bottom`` ``auto`` + + +Default Value: middle + + +The shield's vertical alignment from its centerpoint + +------------ + + +shield-placement-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``dummy`` ``simple`` + + +Default Value: dummy + + +Re-position and/or re-size shield to avoid overlaps. "simple" for basic algorithm (using shield-placements string,) "dummy" to turn this feature off. + +------------ + + +shield-placements +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is ``shield-placements: "E,NE,SE,W,NW,SW";`` + +------------ + + +shield-text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` + + +Default Value: none + + +Transform the case of the characters + +------------ + + +shield-justify-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``center`` ``right`` ``auto`` + + +Default Value: auto + + +Define how text in a shield's label is justified + +------------ + + +shield-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: +*(No transformation)* + +SVG transformation definition + +------------ + + +shield-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +shield-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +line-pattern +^^^^^^^^^^^^ + +line-pattern +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a line pattern symbolizer rule or emitting it with default values. + +------------ + + +line-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +An image file to be repeated and warped along a line + +------------ + + +line-pattern-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +line-pattern-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified)* + +geometries are simplified by the given tolerance + +------------ + + +line-pattern-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` + + +Default Value: radial-distance +*(geometry will not be simplified using the radial distance algorithm)* + +geometries are simplified by the given algorithm + +------------ + + +line-pattern-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +line-pattern-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(geometry will not be transformed)* + +Allows transformation functions to be applied to the geometry. + +------------ + + +line-pattern-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +polygon-pattern +^^^^^^^^^^^^^^^ + +polygon-pattern +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a polygon pattern symbolizer rule or emitting it with default values. + +------------ + + +polygon-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image to use as a repeated pattern fill within a polygon + +------------ + + +polygon-pattern-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``local`` ``global`` + + +Default Value: local + + +Specify whether to align pattern fills to the layer or to the map. + +------------ + + +polygon-pattern-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of polygon pattern edges + +------------ + + +polygon-pattern-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The image is rendered without modifications)* + +Apply an opacity level to the image used for the pattern + +------------ + + +polygon-pattern-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +polygon-pattern-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified)* + +geometries are simplified by the given tolerance + +------------ + + +polygon-pattern-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` + + +Default Value: radial-distance +*(geometry will not be simplified using the radial distance algorithm)* + +geometries are simplified by the given algorithm + +------------ + + +polygon-pattern-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +polygon-pattern-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(geometry will not be transformed)* + +Allows transformation functions to be applied to the geometry. + +------------ + + +polygon-pattern-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +raster +^^^^^^ + +raster +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a raster symbolizer rule or emitting it with default values. + +------------ + + +raster-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of the raster symbolizer on top of other symbolizers. + +------------ + + +raster-filter-factor +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: -1 +*(Allow the datasource to choose appropriate downscaling.)* + +This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed. + +------------ + + +raster-scaling +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``near`` ``fast`` ``bilinear`` ``bilinear8`` ``bicubic`` ``spline16`` ``spline36`` ``hanning`` ``hamming`` ``hermite`` ``kaiser`` ``quadric`` ``catrom`` ``gaussian`` ``bessel`` ``mitchell`` ``sinc`` ``lanczos`` ``blackman`` + + +Default Value: near + + +The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality. + +------------ + + +raster-mesh-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 16 +*(Reprojection mesh will be 1/16 of the resolution of the source image)* + +A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion. + +------------ + + +raster-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +raster-colorizer-default-mode +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``discrete`` ``linear`` ``exact`` + + +Default Value: linear +*(A linear interpolation is used to generate colors between the two nearest stops.)* + +This can be either ``discrete``, ``linear`` or ``exact``. If it is not specified then the default is ``linear``. + +------------ + + +raster-colorizer-default-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: transparent +*(Pixels that are not colored by the colorizer stops will be transparent)* + +This can be any color. Sets the color that is applied to all values outside of the range of the colorizer-stops. If not supplied pixels will be fully transparent + +------------ + + +raster-colorizer-epsilon +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1.1920928955078125e-07 +*(Pixels must very closely match the stop filter otherwise they will not be colored.)* + +This can be any positive floating point value and will be used as a tolerance in floating point comparisions. The higher the value the more likely a stop will match and color data. + +------------ + + +raster-colorizer-stops +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``tags`` + + + + + +Default Value: +*(No colorization will happen without supplying stops.)* + +Assigns raster data values to colors. Stops must be listed in ascending order, and contain at a minimum the value and the associated color. You can also include the color-mode as a third argument, like ``stop(100,#fff,exact)``. + +------------ + + + +point +^^^^^ + +point +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a point symbolizer rule or emitting it with default values. + +------------ + + +point-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image file to represent a point + +------------ + + +point-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow points to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping points are shown or hidden. + +------------ + + +point-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache)* + +value to control whether the placement of the feature will prevent the placement of other features + +------------ + + +point-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque)* + +A value from 0 to 1 to control the opacity of the point + +------------ + + +point-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``centroid`` ``interior`` + + +Default Value: centroid + + +How this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon. + +------------ + + +point-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: +*(No transformation)* + +SVG transformation definition + +------------ + + +point-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +text +^^^^ + +text +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a text symbolizer rule. + +------------ + + +text-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Value to use for a text label. Data columns are specified using brackets like [column_name] + +------------ + + +text-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Font name and style to render a label in + +------------ + + +text-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +Text size in pixels + +------------ + + +text-ratio +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Define the amount of text (of the total) present on successive lines when wrapping occurs + +------------ + + +text-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Length of a chunk of text in characters before wrapping text + +------------ + + +text-wrap-before +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width. + +------------ + + +text-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Use this character instead of a space to wrap long text. + +------------ + + +text-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Distance between repeated text labels on a line (aka. label-spacing) + +------------ + + +text-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Horizontal spacing adjustment between characters in pixels + +------------ + + +text-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Vertical spacing adjustment between lines in pixels + +------------ + + +text-label-position-tolerance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line) + +------------ + + +text-max-char-angle-delta +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 22.5 + + +The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners. + +------------ + + +text-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #000000 + + +Specifies the color for the text + +------------ + + +text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque)* + +A number from 0 to 1 specifying the opacity for the text + +------------ + + +text-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF +*(white)* + +Specifies the color of the halo around the text. + +------------ + + +text-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo)* + +Specify the radius of the halo in pixels + +------------ + + +text-halo-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full + + +Exposes an alternate text halo rendering method that sacrifices quality for speed. + +------------ + + +text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right + +------------ + + +text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down + +------------ + + +text-vertical-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``top`` ``middle`` ``bottom`` ``auto`` + + +Default Value: auto +*(Default affected by value of dy; "bottom" for dy>0, "top" for dy<0.)* + +Position of label relative to point position. + +------------ + + +text-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Avoid placing labels that intersect with tile boundaries. + +------------ + + +text-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Minimum permitted distance to the next text symbolizer. + +------------ + + +text-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Minimum distance a text label will be placed from the edge of a metatile. + +------------ + + +text-min-path-length +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(place labels on all paths)* + +Place labels only on paths longer than this value. + +------------ + + +text-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow text to overlap with other text - overlapping markers will not be shown.)* + +Control whether overlapping text is shown or hidden. + +------------ + + +text-orientation +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Rotate the text. + +------------ + + +text-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` + + +Default Value: point + + +Control the style of placement of a point versus the geometry it is attached to. + +------------ + + +text-placement-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``dummy`` ``simple`` + + +Default Value: dummy + + +Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off. + +------------ + + +text-placements +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is ``text-placements: "E,NE,SE,W,NW,SW";`` + +------------ + + +text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` + + +Default Value: none + + +Transform the case of the characters + +------------ + + +text-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` + + +Default Value: auto + + +The text's horizontal alignment from its centerpoint + +------------ + + +text-align +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``right`` ``center`` ``auto`` + + +Default Value: auto +*(Auto alignment means that text will be centered by default except when using the ``placement-type`` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the ``text-placements`` directives)* + +Define how text is justified + +------------ + + +text-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +text-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +building +^^^^^^^^ + +building +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a building symbolizer rule or emitting it with default values. + +------------ + + +building-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF + + +The color of the buildings walls. + +------------ + + +building-fill-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +The opacity of the building as a whole, including all walls. + +------------ + + +building-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +The height of the building in pixels. + +------------ + + + +debug +^^^^^ + +debug-mode +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``collision`` ``vertex`` + + +Default Value: collision + + +The mode for debug rendering + +------------ + + + + + diff --git a/docs/api/mapnik/2.3.0.rst b/docs/api/mapnik/2.3.0.rst new file mode 100644 index 0000000..a1d5444 --- /dev/null +++ b/docs/api/mapnik/2.3.0.rst @@ -0,0 +1,3131 @@ +2.3.0 +===== +Style +----- + + + + + +image-filters +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``functions`` + + + +Possible values: ``agg-stack-blur`` ``emboss`` ``blur`` ``gray`` ``sobel`` ``edge-detect`` ``x-gradient`` ``y-gradient`` ``invert`` ``sharpen`` ``colorize-alpha`` ``color-to-alpha`` ``scale-hsla`` + +Default Value: none +*(no filters)* + +A list of image filters that will be applied to the active rendering canvas for a given style. The presence of one more more ``image-filters`` will trigger a new canvas to be created before starting to render a style and then this canvas will be composited back into the main canvas after rendering all features and after all ``image-filters`` have been applied. See ``direct-image-filters`` if you want to apply a filter directly to the main canvas. + +------------ + + + +image-filters-inflate +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``boolean`` + + + + + +Default Value: false +*(No special handling will be done and image filters that blur data will only blur up to the edge of a tile boundary)* + +A property that can be set to true to enable using an inflated image internally for seamless blurring across tiles (requires buffered data). + +------------ + + + +direct-image-filters +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``functions`` + + + +Possible values: ``agg-stack-blur`` ``emboss`` ``blur`` ``gray`` ``sobel`` ``edge-detect`` ``x-gradient`` ``y-gradient`` ``invert`` ``sharpen`` ``colorize-alpha`` ``color-to-alpha`` ``scale-hsla`` + +Default Value: none +*(no filters)* + +A list of image filters to apply to the main canvas (see the ``image-filters`` doc for how they work on a separate canvas). + +------------ + + + +comp-op +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current layer on top of other layers)* + +Composite operation. This defines how this layer should behave relative to layers atop or below it. + +------------ + + + +opacity +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``float`` + + + + + +Default Value: 1 +*(no separate buffer will be used and no alpha will be applied to the style after rendering)* + +An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer). + +------------ + + + +Symbolizers +----------- + + +map +^^^ + +background-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: none +*(transparent)* + +Map Background color. + +------------ + + +background-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: +*(transparent)* + +An image that is repeated below all features on a map as a background. Accepted formats: JPG, PNG. + +------------ + + +background-image-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(The background-image will be blended with the background normally (placed on top of any existing background-color))* + +Set the compositing operation used to blend the image into the background. + +------------ + + +background-image-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The image opacity will not be changed when applied to the map background)* + +Set the opacity of the image. + +------------ + + +srs +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +*(The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space)* + +Map spatial reference (proj4 string). + +------------ + + +buffer-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No buffer will be used)* + +Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges". + +------------ + + +base +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.)* + +Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet. + +------------ + + +font-directory +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none +*(No map-specific fonts will be registered)* + +Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered). + +------------ + + + +polygon +^^^^^^^ + +polygon +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a polygon symbolizer rule or emitting it with default values. + +------------ + + +polygon-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: rgba(128,128,128,1) +*(gray and fully opaque (alpha = 1), same as rgb(128,128,128))* + +Fill color to assign to a polygon. + +------------ + + +polygon-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of the polygon. + +------------ + + +polygon-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of polygon edges. + +------------ + + +polygon-gamma-method +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``power`` ``linear`` ``none`` ``threshold`` ``multiply`` + + +Default Value: power +*(pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA)* + +An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions. + +------------ + + +polygon-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +Geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +polygon-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified)* + +Simplify geometries by the given tolerance. + +------------ + + +polygon-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` + + +Default Value: radial-distance +*(geometry will be simplified using the radial distance algorithm)* + +Simplify gemoetries by the given algorithm. + +------------ + + +polygon-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +polygon-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(geometry will not be transformed)* + +Allows transformation functions to be applied to the geometry. + +------------ + + +polygon-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +line +^^^^ + +line +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a line symbolizer rule or emitting it with default values. + +------------ + + +line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: rgba(0,0,0,1) +*(black and fully opaque (alpha = 1), same as rgb(0,0,0))* + +The color of a drawn line. + +------------ + + +line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +The width of a line in pixels. + +------------ + + +line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of a line. + +------------ + + +line-join +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``miter`` ``round`` ``bevel`` + + +Default Value: miter + + +The behavior of lines when joining. + +------------ + + +line-cap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``butt`` ``round`` ``square`` + + +Default Value: butt + + +The display of line endings. + +------------ + + +line-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of stroke line. + +------------ + + +line-gamma-method +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``power`` ``linear`` ``none`` ``threshold`` ``multiply`` + + +Default Value: power +*(pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA)* + +An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions. + +------------ + + +line-dasharray +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(solid line)* + +A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns. + +------------ + + +line-dash-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(solid line)* + +Valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled). + +------------ + + +line-miterlimit +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 4 +*(Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )')* + +The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts. + +------------ + + +line-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +Geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +line-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified)* + +Simplify gemoetries by the given tolerance + +------------ + + +line-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` + + +Default Value: radial-distance +*(geometry will be simplified using the radial distance algorithm)* + +Simplify gemoetries by the given algorithm. + +------------ + + +line-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +line-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no offset)* + +Offsets a line a number of pixels parallel to its actual path. Positive values move the line left, negative values move it right (relative to the directionality of the line). + +------------ + + +line-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full + + +Exposes an alternate AGG rendering method that sacrifices some accuracy for speed. + +------------ + + +line-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(geometry will not be transformed)* + +Allows transformation functions to be applied to the geometry. + +------------ + + +line-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +markers +^^^^^^^ + +marker +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a marker symbolizer rule or emitting it with default values. + +------------ + + +marker-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none +*(An ellipse or circle, if width equals height.)* + +A file that this marker shows at each placement. If no file is given, the marker will show an ellipse. Accepted formats: SVG, JPG, PNG. + +------------ + + +marker-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The stroke-opacity and fill-opacity of the marker.)* + +The overall opacity of the marker, if set, overrides both the opacity of the fill and the opacity of the stroke. + +------------ + + +marker-fill-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The fill opacity of the marker. + +------------ + + +marker-line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black + + +The color of the stroke around the marker. + +------------ + + +marker-line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.5 + + +The width of the stroke around the marker, in pixels. This is positioned on the boundary, so high values can cover the area itself. + +------------ + + +marker-line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of the line. + +------------ + + +marker-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``interior`` + + +Default Value: point +*(Place markers at the center point (centroid) of the geometry)* + +Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior. + +------------ + + +marker-multi-policy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``each`` ``whole`` ``largest`` + + +Default Value: each +*(If a feature contains multiple geometries and the placement type is either point or interior then a marker will be rendered for each)* + +A special setting to allow the user to control rendering behavior for 'multi-geometries' (when a feature contains multiple geometries). This setting does not apply to markers placed along lines. The 'each' policy is default and means all geometries will get a marker. The 'whole' policy means that the aggregate centroid between all geometries will be used. The 'largest' policy means that only the largest (by bounding box areas) feature will get a rendered marker (this is how text labeling behaves by default). + +------------ + + +marker-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``arrow`` ``ellipse`` + + +Default Value: ellipse + + +The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width). + +------------ + + +marker-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +The width of the marker, if using one of the default types. + +------------ + + +marker-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +The height of the marker, if using one of the default types. + +------------ + + +marker-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: blue + + +The color of the area of the marker. + +------------ + + +marker-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow makers to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping markers are shown or hidden. + +------------ + + +marker-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache)* + +Value to control whether the placement of the feature will prevent the placement of other features. + +------------ + + +marker-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 100 + + +Space between repeated markers in pixels. If the spacing is less than the marker size or larger than the line segment length then no marker will be placed. + +------------ + + +marker-max-error +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.2 + + +The maximum difference between actual marker placement and the marker-spacing parameter. Setting a high value can allow the renderer to try to resolve placement conflicts with other symbolizers. + +------------ + + +marker-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation)* + +SVG transformation definition. + +------------ + + +marker-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +marker-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +marker-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(geometry will not be transformed)* + +Allows transformation functions to be applied to the geometry. + +------------ + + +marker-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +shield +^^^^^^ + +shield +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a shield symbolizer. + +------------ + + +shield-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Value to use for a shield"s text label. Data columns are specified using brackets like [column_name]. + +------------ + + +shield-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image file to render behind the shield text. Accepted formats: SVG, JPG, PNG. + +------------ + + +shield-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Font name and style to use for the shield text + +------------ + + +shield-unlock-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(text alignment relative to the shield image uses the center of the image as the anchor for text positioning.)* + +This parameter should be set to true if you are trying to position text beside rather than on top of the shield image + +------------ + + +shield-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +The size of the shield text in pixels. + +------------ + + +shield-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black + + +The color of the shield text. + +------------ + + +shield-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` + + +Default Value: point + + +How this shield should be placed. Point placement attempts to place it on top of points, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of polygons. + +------------ + + +shield-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Avoid placing shields that intersect with tile boundaries. + +------------ + + +shield-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow shields to overlap with other map elements already placed.)* + +Control whether overlapping shields are shown or hidden. + +------------ + + +shield-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Minimum distance to the next shield symbol, not necessarily the same shield. + +------------ + + +shield-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +The spacing between repeated occurrences of the same shield on a line. + +------------ + + +shield-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Minimum distance a shield will be placed from the edge of a metatile. This option is similar to shield-avoid-edges:true except that the extra margin is used to discard cases where the shield+margin are not fully inside the metatile. + +------------ + + +shield-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Length of a chunk of text in pixels before wrapping text. If set to zero, text doesn't wrap. + +------------ + + +shield-wrap-before +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width. + +------------ + + +shield-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: " " + + +Use this character instead of a space to wrap long names. + +------------ + + +shield-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF +*(white)* + +Specifies the color of the halo around the text. + +------------ + + +shield-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo)* + +Specify the radius of the halo in pixels. + +------------ + + +shield-halo-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full + + +Exposes an alternate text halo rendering method that sacrifices quality for speed. + +------------ + + +shield-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement. + +------------ + + +shield-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Vertical spacing between lines of multiline labels (in pixels). + +------------ + + +shield-text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the shield right. + +------------ + + +shield-text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the shield down. + +------------ + + +shield-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right. + +------------ + + +shield-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down. + +------------ + + +shield-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +The opacity of the image used for the shield + +------------ + + +shield-text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +The opacity of the text placed on top of the shield + +------------ + + +shield-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` + + +Default Value: auto + + +The shield's horizontal alignment from its centerpoint + +------------ + + +shield-vertical-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``top`` ``middle`` ``bottom`` ``auto`` + + +Default Value: middle + + +The shield's vertical alignment from its centerpoint + +------------ + + +shield-placement-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``dummy`` ``simple`` ``list`` + + +Default Value: dummy + + +Re-position and/or re-size shield to avoid overlaps. "simple" for basic algorithm (using shield-placements string,) "dummy" to turn this feature off. + +------------ + + +shield-placements +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is ``shield-placements: "E,NE,SE,W,NW,SW";`` + +------------ + + +shield-text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` + + +Default Value: none + + +Transform the case of the characters. + +------------ + + +shield-justify-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``center`` ``right`` ``auto`` + + +Default Value: auto + + +Define how text in a shield's label is justified. + +------------ + + +shield-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation)* + +SVG transformation definition. + +------------ + + +shield-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +shield-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +line-pattern +^^^^^^^^^^^^ + +line-pattern +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a line pattern symbolizer rule or emitting it with default values. + +------------ + + +line-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +An image file to be repeated and warped along a line. Accepted formats: JPG, PNG. + +------------ + + +line-pattern-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +line-pattern-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified)* + +geometries are simplified by the given tolerance + +------------ + + +line-pattern-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` + + +Default Value: radial-distance +*(geometry will be simplified using the radial distance algorithm)* + +geometries are simplified by the given algorithm. + +------------ + + +line-pattern-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +line-pattern-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no offset)* + +Offsets a line a number of pixels parallel to its actual path. Positive values move the line left, negative values move it right (relative to the directionality of the line). + +------------ + + +line-pattern-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(geometry will not be transformed)* + +Allows transformation functions to be applied to the geometry. + +------------ + + +line-pattern-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +polygon-pattern +^^^^^^^^^^^^^^^ + +polygon-pattern +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a polygon pattern symbolizer rule or emitting it with default values. + +------------ + + +polygon-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image to use as a repeated pattern fill within a polygon. Accepted formats: JPG, PNG. + +------------ + + +polygon-pattern-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``local`` ``global`` + + +Default Value: local + + +Specify whether to align pattern fills to the layer or to the map. + +------------ + + +polygon-pattern-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(fully antialiased)* +Range: 0-1 +Level of antialiasing of polygon pattern edges + +------------ + + +polygon-pattern-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The image is rendered without modifications)* + +Apply an opacity level to the image used for the pattern + +------------ + + +polygon-pattern-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +polygon-pattern-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified)* + +geometries are simplified by the given tolerance + +------------ + + +polygon-pattern-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` + + +Default Value: radial-distance +*(geometry will be simplified using the radial distance algorithm)* + +geometries are simplified by the given algorithm + +------------ + + +polygon-pattern-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no smoothing)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +polygon-pattern-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(geometry will not be transformed)* + +Allows transformation functions to be applied to the geometry. + +------------ + + +polygon-pattern-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +raster +^^^^^^ + +raster +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a raster symbolizer rule or emitting it with default values. + +------------ + + +raster-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(opaque)* + +The opacity of the raster symbolizer on top of other symbolizers. + +------------ + + +raster-filter-factor +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: -1 +*(Allow the datasource to choose appropriate downscaling.)* + +This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed. + +------------ + + +raster-scaling +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``near`` ``fast`` ``bilinear`` ``bicubic`` ``spline16`` ``spline36`` ``hanning`` ``hamming`` ``hermite`` ``kaiser`` ``quadric`` ``catrom`` ``gaussian`` ``bessel`` ``mitchell`` ``sinc`` ``lanczos`` ``blackman`` + + +Default Value: near + + +The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality. + +------------ + + +raster-mesh-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 16 +*(Reprojection mesh will be 1/16 of the resolution of the source image)* + +A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion. + +------------ + + +raster-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +raster-colorizer-default-mode +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``discrete`` ``linear`` ``exact`` + + +Default Value: linear +*(A linear interpolation is used to generate colors between the two nearest stops.)* + +This can be either ``discrete``, ``linear`` or ``exact``. If it is not specified then the default is ``linear``. + +------------ + + +raster-colorizer-default-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: transparent +*(Pixels that are not colored by the colorizer stops will be transparent)* + +This can be any color. Sets the color that is applied to all values outside of the range of the colorizer-stops. If not supplied pixels will be fully transparent + +------------ + + +raster-colorizer-epsilon +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1.1920928955078125e-07 +*(Pixels must very closely match the stop filter otherwise they will not be colored.)* + +This can be any positive floating point value and will be used as a tolerance in floating point comparisions. The higher the value the more likely a stop will match and color data. + +------------ + + +raster-colorizer-stops +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``tags`` + + + + + +Default Value: +*(No colorization will happen without supplying stops.)* + +Assigns raster data values to colors. Stops must be listed in ascending order, and contain at a minimum the value and the associated color. You can also include the color-mode as a third argument, like ``stop(100,#fff,exact)``. + +------------ + + + +point +^^^^^ + +point +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a point symbolizer rule or emitting it with default values. + +------------ + + +point-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image file to represent a point. Accepted formats: SVG, PNG, JPG. + +------------ + + +point-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow points to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping points are shown or hidden. + +------------ + + +point-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache)* + +Control whether the placement of the feature will prevent the placement of other features. + +------------ + + +point-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque)* + +A value from 0 to 1 to control the opacity of the point. + +------------ + + +point-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``centroid`` ``interior`` + + +Default Value: centroid + + +Control how this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon. + +------------ + + +point-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation)* + +SVG transformation definition. + +------------ + + +point-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +text +^^^^ + +text +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a text symbolizer rule. + +------------ + + +text-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Value to use for a text label. Data columns are specified using brackets like [column_name] + +------------ + + +text-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +Font name and style to render a label in + +------------ + + +text-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 + + +Text size in pixels + +------------ + + +text-ratio +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Define the amount of text (of the total) present on successive lines when wrapping occurs + +------------ + + +text-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Length of a chunk of text in pixels before wrapping text. If set to zero, text doesn't wrap. + +------------ + + +text-wrap-before +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width. + +------------ + + +text-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: " " + + +Use this character instead of a space to wrap long text. + +------------ + + +text-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 + + +Distance between repeated text labels on a line (aka. label-spacing). + +------------ + + +text-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Horizontal spacing adjustment between characters in pixels. + +------------ + + +text-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Vertical spacing adjustment between lines in pixels. + +------------ + + +text-label-position-tolerance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line). + +------------ + + +text-max-char-angle-delta +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 22.5 + + +The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners. + +------------ + + +text-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #000000 + + +Specifies the color for the text + +------------ + + +text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque)* + +A number from 0 to 1 specifying the opacity for the text + +------------ + + +text-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF +*(white)* + +Specifies the color of the halo around the text. + +------------ + + +text-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo)* + +Specify the radius of the halo in pixels + +------------ + + +text-halo-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full + + +Exposes an alternate text halo rendering method that sacrifices quality for speed. + +------------ + + +text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right. + +------------ + + +text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Displace text by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text up. + +------------ + + +text-vertical-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``top`` ``middle`` ``bottom`` ``auto`` + + +Default Value: auto +*(Default affected by value of dy; "top" for dy>0, "bottom" for dy<0.)* + +Position of label relative to point position. + +------------ + + +text-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false + + +Avoid placing labels that intersect with tile boundaries. + +------------ + + +text-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Minimum permitted distance to the next text symbolizer. + +------------ + + +text-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Minimum distance a text label will be placed from the edge of a metatile. This option is similar to shield-avoid-edges:true except that the extra margin is used to discard cases where the shield+margin are not fully inside the metatile. + +------------ + + +text-min-path-length +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(place labels on all paths)* + +Place labels only on paths longer than this value. + +------------ + + +text-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow text to overlap with other text - overlapping markers will not be shown.)* + +Control whether overlapping text is shown or hidden. + +------------ + + +text-orientation +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +Rotate the text. + +------------ + + +text-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` + + +Default Value: point + + +Control the style of placement of a point versus the geometry it is attached to. + +------------ + + +text-placement-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``dummy`` ``simple`` ``list`` + + +Default Value: dummy + + +Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off. + +------------ + + +text-placements +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: + + +If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is ``text-placements: "E,NE,SE,W,NW,SW";`` + +------------ + + +text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` + + +Default Value: none + + +Transform the case of the characters. + +------------ + + +text-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` + + +Default Value: auto + + +The text's horizontal alignment from its centerpoint. + +------------ + + +text-align +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``right`` ``center`` ``auto`` + + +Default Value: auto +*(Auto alignment means that text will be centered by default except when using the ``placement-type`` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the ``text-placements`` directives.)* + +Define how text is justified + +------------ + + +text-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: true +*(geometry will be clipped to map bounds before rendering)* + +Geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts. + +------------ + + +text-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current symbolizer on top of other symbolizer)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +building +^^^^^^^^ + +building +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a building symbolizer rule or emitting it with default values. + +------------ + + +building-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: #FFFFFF + + +The color of the buildings walls. + +------------ + + +building-fill-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 + + +The opacity of the building as a whole, including all walls. + +------------ + + +building-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 + + +The height of the building in pixels. + +------------ + + + +debug +^^^^^ + +debug-mode +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``collision`` ``vertex`` + + +Default Value: collision + + +The mode for debug rendering. + +------------ + + + + + diff --git a/docs/api/mapnik/3.0.0.rst b/docs/api/mapnik/3.0.0.rst new file mode 100644 index 0000000..9818635 --- /dev/null +++ b/docs/api/mapnik/3.0.0.rst @@ -0,0 +1,3778 @@ +3.0.0 +===== +Style +----- + + + + + +image-filters +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``functions`` + + + +Possible values: ``agg-stack-blur`` ``emboss`` ``blur`` ``gray`` ``sobel`` ``edge-detect`` ``x-gradient`` ``y-gradient`` ``invert`` ``sharpen`` ``colorize-alpha`` ``color-to-alpha`` ``scale-hsla`` + +Default Value: none +*(no filters)* + +A list of image filters that will be applied to the active rendering canvas for a given style. The presence of one more ``image-filters`` will trigger a new canvas to be created before starting to render a style and then this canvas will be composited back into the main canvas after rendering all features and after all ``image-filters`` have been applied. See ``direct-image-filters`` if you want to apply a filter directly to the main canvas. + +------------ + + + +image-filters-inflate +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``boolean`` + + + + + +Default Value: false +*(No special handling will be done and image filters that blur data will only blur up to the edge of a tile boundary)* + +A property that can be set to true to enable using an inflated image internally for seamless blurring across tiles (requires buffered data). + +------------ + + + +direct-image-filters +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``functions`` + + + +Possible values: ``agg-stack-blur`` ``emboss`` ``blur`` ``gray`` ``sobel`` ``edge-detect`` ``x-gradient`` ``y-gradient`` ``invert`` ``sharpen`` ``colorize-alpha`` ``color-to-alpha`` ``scale-hsla`` + +Default Value: none +*(no filters)* + +A list of image filters to apply to the main canvas (see the ``image-filters`` doc for how they work on a separate canvas). + +------------ + + + +comp-op +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current layer on top of other layers)* + +Composite operation. This defines how this layer should behave relative to layers atop or below it. + +------------ + + + +opacity +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``float`` + + + + + +Default Value: 1 +*(No separate buffer will be used and no alpha will be applied to the style after rendering.)* + +An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer). + +------------ + + + +Symbolizers +----------- + + +map +^^^ + +background-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: none +*(Will be rendered transparent.)* + +Map Background color. + +------------ + + +background-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: +*(No background image will be used.)* + +An image that is repeated below all features on a map as a background. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +background-image-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(The background-image will be blended with the background normally (placed on top of any existing background-color).)* + +Set the compositing operation used to blend the image into the background. + +------------ + + +background-image-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The image opacity will not be changed when applied to the map background.)* + +Set the opacity of the image. + +------------ + + +srs +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +*(The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space.)* + +Map spatial reference (proj4 string). + +------------ + + +buffer-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No buffer will be used.)* + +Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges". + +------------ + + +maximum-extent +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: -20037508.34,-20037508.34,20037508.34,20037508.34 +*(All data will be clipped to global mercator extent (default is applied in Carto.js).)* + +An extent to be used to limit the bounds used to query all layers during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Map. + +------------ + + +base +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.)* + +Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet. + +------------ + + +font-directory +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none +*(No map-specific fonts will be registered.)* + +Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered). + +------------ + + + +polygon +^^^^^^^ + +polygon +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a polygon symbolizer rule or emitting it with default values. + +------------ + + +polygon-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: The color gray will be used for fill. +*(Gray and fully opaque (alpha = 1), same as rgb(128,128,128) or rgba(128,128,128,1).)* + +Fill color to assign to a polygon. + +------------ + + +polygon-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of the polygon. + +------------ + + +polygon-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully antialiased.)* +Range: 0-1 +Level of antialiasing of polygon edges. + +------------ + + +polygon-gamma-method +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``power`` ``linear`` ``none`` ``threshold`` ``multiply`` + + +Default Value: power +*(pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA.)* + +An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions. + +------------ + + +polygon-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extend outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +polygon-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +Simplify geometries by the given tolerance. + +------------ + + +polygon-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +Simplify geometries by the given algorithm. + +------------ + + +polygon-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +polygon-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(The geometry will not be transformed.)* + +Transform polygon geometry with specified function. + +------------ + + +polygon-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +line +^^^^ + +line +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a line symbolizer rule or emitting it with default values. + +------------ + + +line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black +*(black and fully opaque (alpha = 1), same as rgb(0,0,0) or rgba(0,0,0,1).)* + +The color of a drawn line. + +------------ + + +line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The line will be rendered 1 pixel wide.)* + +The width of a line in pixels. + +------------ + + +line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of a line. + +------------ + + +line-join +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``miter`` ``miter-revert`` ``round`` ``bevel`` + + +Default Value: miter +*(The line joins will be rendered using a miter look.)* + +The behavior of lines when joining. + +------------ + + +line-cap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``butt`` ``round`` ``square`` + + +Default Value: butt +*(The line endings will be rendered using a butt look.)* + +The display of line endings. + +------------ + + +line-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully antialiased.)* +Range: 0-1 +Level of antialiasing of stroke line. + +------------ + + +line-gamma-method +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``power`` ``linear`` ``none`` ``threshold`` ``multiply`` + + +Default Value: power +*(pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA.)* + +An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions. + +------------ + + +line-dasharray +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(The line will be drawn without dashes.)* + +A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns. + +------------ + + +line-dash-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(The line will be drawn without dashes.)* + +Valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled). + +------------ + + +line-miterlimit +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 4 +*(Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )'.)* + +The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts. + +------------ + + +line-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +line-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +Simplify geometries by the given tolerance. + +------------ + + +line-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +Simplify geometries by the given algorithm. + +------------ + + +line-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +line-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + +**Status: unstable** + + + + + +Default Value: 0 +*(Will not be offset.)* + +Offsets a line a number of pixels parallel to its actual path. Positive values move the line left, negative values move it right (relative to the directionality of the line). + +------------ + + +line-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full +*(The line will be rendered using the highest quality method rather than the fastest.)* + +Exposes an alternate AGG rendering method that sacrifices some accuracy for speed. + +------------ + + +line-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(The geometry will not be transformed.)* + +Transform line geometry with specified function. + +------------ + + +line-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +markers +^^^^^^^ + +marker +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a marker symbolizer rule or emitting it with default values. + +------------ + + +marker-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none +*(An ellipse or circle, if width equals height.)* + +A file that this marker shows at each placement. If no file is given, the marker will show an ellipse. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +marker-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The stroke-opacity and fill-opacity of the marker.)* + +The overall opacity of the marker, if set, overrides both the opacity of the fill and the opacity of the stroke. + +------------ + + +marker-fill-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The fill opacity of the marker. This property will also set the ``fill-opacity`` of elements in an SVG loaded from a file. + +------------ + + +marker-line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black +*(The marker will be drawn with a black outline.)* + +The color of the stroke around the marker. This property will also set the ``stroke`` of elements in an SVG loaded from a file. + +------------ + + +marker-line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.5 +*(The marker will be drawn with an outline of .5 pixels wide.)* + +The width of the stroke around the marker, in pixels. This is positioned on the boundary, so high values can cover the area itself. This property will also set the ``stroke-width`` of elements in an SVG loaded from a file. + +------------ + + +marker-line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque. This property will also set the ``stroke-opacity`` of elements in an SVG loaded from a file.)* + +The opacity of a line. + +------------ + + +marker-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``interior`` ``vertex-first`` ``vertex-last`` + + +Default Value: point +*(Place markers at the center point (centroid) of the geometry.)* + +Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior. The 'vertex-first' and 'vertex-last' options can be used to place markers at the first or last vertex of lines or polygons. + +------------ + + +marker-multi-policy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``each`` ``whole`` ``largest`` + + +Default Value: each +*(If a feature contains multiple geometries and the placement type is either point or interior then a marker will be rendered for each.)* + +A special setting to allow the user to control rendering behavior for 'multi-geometries' (when a feature contains multiple geometries). This setting does not apply to markers placed along lines. The 'each' policy is default and means all geometries will get a marker. The 'whole' policy means that the aggregate centroid between all geometries will be used. The 'largest' policy means that only the largest (by bounding box areas) feature will get a rendered marker (this is how text labeling behaves by default). + +------------ + + +marker-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: deprecated** + + +Possible values: ``arrow`` ``ellipse`` + + +Default Value: ellipse +*(The marker shape is an ellipse.)* + +The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width). + +------------ + + +marker-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 +*(The marker width is 10 pixels.)* + +The width of the marker, if using one of the default types. + +------------ + + +marker-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 +*(The marker height is 10 pixels.)* + +The height of the marker, if using one of the default types. + +------------ + + +marker-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: blue +*(The marker fill color is blue.)* + +The color of the area of the marker. This property will also set the ``fill`` of elements in an SVG loaded from a file. + +------------ + + +marker-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow markers to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping markers are shown or hidden. + +------------ + + +marker-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Markers will be potentially placed near tile edges and therefore may look cut off unless they are rendered on each adjacent tile.)* + +Avoid placing markers that intersect with tile boundaries. + +------------ + + +marker-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache.)* + +Value to control whether the placement of the feature will prevent the placement of other features. + +------------ + + +marker-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 100 +*(In the case of marker-placement:line then draw a marker every 100 pixels along a line.)* + +Space between repeated markers in pixels. If the spacing is less than the marker size or larger than the line segment length then no marker will be placed. Any value less than 1 will be ignored and the default will be used instead. + +------------ + + +marker-max-error +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.2 +*(N/A: not intended to be changed.)* + +N/A: not intended to be changed. + +------------ + + +marker-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation.)* + +Transform marker instance with specified function. Ignores map scale factor. + +------------ + + +marker-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +marker-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Geometry will not be simplified.)* + +geometries are simplified by the given tolerance. + +------------ + + +marker-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +geometries are simplified by the given algorithm. + +------------ + + +marker-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +marker-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(The geometry will not be transformed.)* + +Transform marker geometry with specified function. + +------------ + + +marker-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Will not be offset.)* + +Offsets a marker from a line a number of pixels parallel to its actual path. Positive values move the marker left, negative values move it right (relative to the directionality of the line). + +------------ + + +marker-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +marker-direction +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``auto`` ``auto-down`` ``left`` ``right`` ``left-only`` ``right-only`` ``up`` ``down`` + + +Default Value: right +*(Markers are oriented to the right in the line direction.)* + +How markers should be placed along lines. With the "auto" setting when marker is upside down the marker is automatically rotated by 180 degrees to keep it upright. The "auto-down" value places marker in the opposite orientation to "auto". The "left" or "right" settings can be used to force marker to always be placed along a line in a given direction and therefore disables rotating if marker appears upside down. The "left-only" or "right-only" properties also force a given direction but will discard upside down markers rather than trying to flip it. The "up" and "down" settings don't adjust marker's orientation to the line direction. + +------------ + + + +shield +^^^^^^ + +shield +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a shield symbolizer. + +------------ + + +shield-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(No text label will be rendered with the shield.)* + +Value to use for a shield"s text label. Data columns are specified using brackets like [column_name]. + +------------ + + +shield-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image file to render behind the shield text. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +shield-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: none + + +Font name and style to use for the shield text. + +------------ + + +shield-unlock-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(text alignment relative to the shield image uses the center of the image as the anchor for text positioning.)* + +This parameter should be set to true if you are trying to position text beside rather than on top of the shield image. + +------------ + + +shield-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 +*(Font size of 10 will be used to render text.)* + +The size of the shield text in pixels. + +------------ + + +shield-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black +*(The shield text will be rendered black.)* + +The color of the shield text. + +------------ + + +shield-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` + + +Default Value: point +*(One shield will be placed per geometry.)* + +How this shield should be placed. Point placement places one shield on top of a point geometry and at the centroid of a polygon or the middle point of a line, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of a polygon. + +------------ + + +shield-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Shields will be potentially placed near tile edges and therefore may look cut off unless they are rendered on each adjacent tile.)* + +Avoid placing shields that intersect with tile boundaries. + +------------ + + +shield-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow shields to overlap with other map elements already placed.)* + +Control whether overlapping shields are shown or hidden. + +------------ + + +shield-margin +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No extra margin will be used to determine if a shield collides with any other text, shield, or marker.)* + +Minimum distance that a shield can be placed from any other text, shield, or marker. + +------------ + + +shield-repeat-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Shields with the same text will be rendered without restriction.)* + +Minimum distance between repeated shields. If set this will prevent shields being rendered nearby each other that contain the same text. Similar to shield-min-distance with the difference that it works the same no matter what placement strategy is used. + +------------ + + +shield-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + +**Status: deprecated** + + + + + +Default Value: 0 +*(Shields with the same text will be rendered without restriction.)* + +Minimum distance to any other collision object. Deprecated: replaced by ``text-margin``. + +------------ + + +shield-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Only one shield per line will attempt to be placed.)* + +Distance the renderer should use to try to place repeated shields on a line. + +------------ + + +shield-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No margin will be used to detect if a shield is nearby a tile boundary.)* + +Minimum distance a shield will be placed from the edge of a tile. This option is similar to shield-avoid-edges:true except that the extra margin is used to discard cases where the shield+margin are not fully inside the tile. + +------------ + + +shield-label-position-tolerance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: shield-spacing/2.0 +*(If a shield cannot be placed then the renderer will advance by shield-spacing/2.0 to try placement again.)* + +Allows the shield to be displaced from its ideal position by a number of pixels (only works with placement:line). + +------------ + + +shield-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 +*(Text will not be wrapped.)* + +Length of a chunk of text in pixels before wrapping text. If set to zero, text doesn't wrap. + +------------ + + +shield-wrap-before +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Wrapped lines will be a bit longer than wrap-width.)* + +Wrap text before wrap-width is reached. + +------------ + + +shield-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: " " +*(Lines will be wrapped conforming to the (untailored) Unicode Line Break Algorithm provided by ICU BreakIterator.)* + +Must be a single character. If you set it to other than the space character, Mapnik will wrap strictly on that character without involving any additional rules. + +------------ + + +shield-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: white +*(The shield halo text will be rendered white.)* + +Specifies the color of the halo around the text. + +------------ + + +shield-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo.)* + +Specify the radius of the halo in pixels. + +------------ + + +shield-halo-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full +*(The shield will be rendered using the highest quality method rather than the fastest.)* + +Exposes an alternate text halo rendering method that sacrifices quality for speed. + +------------ + + +shield-halo-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: +*(No transformation.)* + +Transform shield halo relative to the actual text with specified function. Allows for shadow or embossed effects. Ignores map scale factor. + +------------ + + +shield-halo-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +shield-halo-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque.)* + +A number from 0 to 1 specifying the opacity for the text halo. + +------------ + + +shield-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 +*(The default character spacing of the font will be used.)* + +Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement. + +------------ + + +shield-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(The default font spacing will be used.)* + +Vertical spacing between lines of multiline labels (in pixels). + +------------ + + +shield-text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Text will not be displaced.)* + +Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the shield right. + +------------ + + +shield-text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Text will not be displaced.)* + +Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the shield down. + +------------ + + +shield-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Shield will not be displaced.)* + +Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right. + +------------ + + +shield-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Shield will not be displaced.)* + +Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down. + +------------ + + +shield-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of the image used for the shield. + +------------ + + +shield-text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of the text placed on top of the shield. + +------------ + + +shield-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` + + +Default Value: auto +*(TODO.)* + +The shield's horizontal alignment from its centerpoint. + +------------ + + +shield-vertical-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``top`` ``middle`` ``bottom`` ``auto`` + + +Default Value: middle +*(TODO.)* + +The shield's vertical alignment from its centerpoint. + +------------ + + +shield-placement-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``dummy`` ``simple`` ``list`` + + +Default Value: dummy +*(Alternative placements will not be enabled.)* + +Re-position and/or re-size shield to avoid overlaps. "simple" for basic algorithm (using shield-placements string,) "dummy" to turn this feature off. + +------------ + + +shield-placements +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(No alternative placements will be used.)* + +If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is ``shield-placements: "E,NE,SE,W,NW,SW";``. + +------------ + + +shield-text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` ``reverse`` + + +Default Value: none +*(No text transformation will be applied.)* + +Transform the case of the characters. + +------------ + + +shield-justify-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``center`` ``right`` ``auto`` + + +Default Value: auto +*(TODO.)* + +Define how text in a shield's label is justified. + +------------ + + +shield-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation.)* + +Transform shield instance with specified function. Ignores map scale factor. + +------------ + + +shield-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +shield-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +Simplify the geometries used for shield placement by the given tolerance. + +------------ + + +shield-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +Simplify the geometries used for shield placement by the given algorithm. + +------------ + + +shield-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out the angles of the geometry used for shield placement. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +shield-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +line-pattern +^^^^^^^^^^^^ + +line-pattern +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a line pattern symbolizer rule or emitting it with default values. + +------------ + + +line-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +An image file to be repeated and warped along a line. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +line-pattern-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +line-pattern-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The image is rendered without modifications.)* + +Apply an opacity level to the image used for the pattern. + +------------ + + +line-pattern-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +geometries are simplified by the given tolerance. + +------------ + + +line-pattern-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +geometries are simplified by the given algorithm. + +------------ + + +line-pattern-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +line-pattern-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(The line will not be offset.)* + +Offsets a line a number of pixels parallel to its actual path. Positive values move the line left, negative values move it right (relative to the directionality of the line). + +------------ + + +line-pattern-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(The geometry will not be transformed.)* + +Transform line geometry with specified function and apply pattern to transformed geometry. + +------------ + + +line-pattern-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation.)* + +Transform line pattern instance with specified function. + +------------ + + +line-pattern-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +polygon-pattern +^^^^^^^^^^^^^^^ + +polygon-pattern +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a polygon pattern symbolizer rule or emitting it with default values. + +------------ + + +polygon-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image to use as a repeated pattern fill within a polygon. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +polygon-pattern-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``global`` ``local`` + + +Default Value: global +*(Patterns will be aligned to the map (or tile boundaries) when being repeated across polygons. This is ideal for seamless patterns in tiled rendering.)* + +Specify whether to align pattern fills to the layer's geometry (local) or to the map (global). + +------------ + + +polygon-pattern-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully antialiased.)* +Range: 0-1 +Level of antialiasing of polygon pattern edges. + +------------ + + +polygon-pattern-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The image is rendered without modifications.)* + +Apply an opacity level to the image used for the pattern. + +------------ + + +polygon-pattern-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +polygon-pattern-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +geometries are simplified by the given tolerance. + +------------ + + +polygon-pattern-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +geometries are simplified by the given algorithm. + +------------ + + +polygon-pattern-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +polygon-pattern-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(The geometry will not be transformed.)* + +Transform polygon geometry with specified function and apply pattern to transformed geometry. + +------------ + + +polygon-pattern-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation.)* + +Transform polygon pattern instance with specified function. + +------------ + + +polygon-pattern-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +raster +^^^^^^ + +raster +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a raster symbolizer rule or emitting it with default values. + +------------ + + +raster-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of the raster symbolizer on top of other symbolizers. + +------------ + + +raster-filter-factor +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: -1 +*(Allow the datasource to choose appropriate downscaling.)* + +This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed. + +------------ + + +raster-scaling +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``near`` ``fast`` ``bilinear`` ``bicubic`` ``spline16`` ``spline36`` ``hanning`` ``hamming`` ``hermite`` ``kaiser`` ``quadric`` ``catrom`` ``gaussian`` ``bessel`` ``mitchell`` ``sinc`` ``lanczos`` ``blackman`` + + +Default Value: near +*(Nearest neighboor resampling will be used to scale the image to the target size of the map.)* + +The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality. + +------------ + + +raster-mesh-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 16 +*(Reprojection mesh will be 1/16 of the resolution of the source image.)* + +A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion. + +------------ + + +raster-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +raster-colorizer-default-mode +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``discrete`` ``linear`` ``exact`` + + +Default Value: linear +*(A linear interpolation is used to generate colors between the two nearest stops.)* + +This can be either ``discrete``, ``linear`` or ``exact``. If it is not specified then the default is ``linear``. + +------------ + + +raster-colorizer-default-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: transparent +*(Pixels that are not colored by the colorizer stops will be transparent.)* + +This can be any color. Sets the color that is applied to all values outside of the range of the colorizer-stops. If not supplied pixels will be fully transparent. + +------------ + + +raster-colorizer-epsilon +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1.1920928955078125e-07 +*(Pixels must very closely match the stop filter otherwise they will not be colored.)* + +This can be any positive floating point value and will be used as a tolerance in floating point comparisions. The higher the value the more likely a stop will match and color data. + +------------ + + +raster-colorizer-stops +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``tags`` + + + + + +Default Value: +*(No colorization will happen without supplying stops.)* + +Assigns raster data values to colors. Stops must be listed in ascending order, and contain at a minimum the value and the associated color. You can also include the color-mode as a third argument, like ``stop(100,#fff,exact)``. + +------------ + + + +point +^^^^^ + +point +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a point symbolizer rule or emitting it with default values. + +------------ + + +point-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none +*(A 4x4 black square will be rendered.)* + +Image file to represent a point. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +point-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow points to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping points are shown or hidden. + +------------ + + +point-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache.)* + +Control whether the placement of the feature will prevent the placement of other features. + +------------ + + +point-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque.)* + +A value from 0 to 1 to control the opacity of the point. + +------------ + + +point-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``centroid`` ``interior`` + + +Default Value: centroid +*(The centroid of the geometry will be used to place the point.)* + +Control how this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon. + +------------ + + +point-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation.)* + +Transform point instance with specified function. Ignores map scale factor. + +------------ + + +point-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +text +^^^^ + +text +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a text symbolizer rule. + +------------ + + +text-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: none + + +Value to use for a text label. Data columns are specified using brackets like [column_name]. + +------------ + + +text-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: none + + +Font name and style to render a label in. + +------------ + + +text-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 +*(Font size of 10 will be used to render text.)* + +Text size in pixels. + +------------ + + +text-ratio +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 +*(TODO.)* + +Define the amount of text (of the total) present on successive lines when wrapping occurs. + +------------ + + +text-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 +*(Text will not be wrapped.)* + +Length of a chunk of text in pixels before wrapping text. If set to zero, text doesn't wrap. + +------------ + + +text-wrap-before +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Wrapped lines will be a bit longer than wrap-width.)* + +Wrap text before wrap-width is reached. + +------------ + + +text-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: " " +*(Lines will be wrapped conforming to the (untailored) Unicode Line Break Algorithm provided by ICU BreakIterator.)* + +Must be a single character. If you set it to other than the space character, Mapnik will wrap strictly on that character without involving any additional rules. + +------------ + + +text-repeat-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + +**Status: unstable** + + + + + +Default Value: false +*(Character will be removed when used to wrap a line.)* + +Keep the character used to wrap a line instead of removing it, and repeat it on the new line. + +------------ + + +text-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 +*(Only one label per line will attempt to be placed.)* + +Distance the renderer should use to try to place repeated text labels on a line. + +------------ + + +text-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(The default character spacing of the font will be used.)* + +Horizontal spacing adjustment between characters in pixels. This value is ignored when ``horizontal-alignment`` is set to ``adjust``. Typographic ligatures are turned off when this value is greater than zero. + +------------ + + +text-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(The default font spacing will be used.)* + +Vertical spacing adjustment between lines in pixels. + +------------ + + +text-label-position-tolerance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: text-spacing/2.0 +*(If a shield cannot be placed then the renderer will advance by text-spacing/2.0 to try placement again.)* + +Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line). + +------------ + + +text-max-char-angle-delta +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 22.5 +*(The label will not be placed if a character falls on a line with an angle sharper than 22.5 degrees.)* + +The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners. + +------------ + + +text-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black +*(The text will be rendered black.)* + +Specifies the color for the text. + +------------ + + +text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque.)* + +A number from 0 to 1 specifying the opacity for the text. + +------------ + + +text-halo-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque.)* + +A number from 0 to 1 specifying the opacity for the text halo. + +------------ + + +text-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: white +*(The halo will be rendered white.)* + +Specifies the color of the halo around the text. + +------------ + + +text-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo.)* + +Specify the radius of the halo in pixels. + +------------ + + +text-halo-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full +*(The text will be rendered using the highest quality method rather than the fastest.)* + +Exposes an alternate text halo rendering method that sacrifices quality for speed. + +------------ + + +text-halo-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: +*(No transformation.)* + +Transform text halo relative to the actual text with specified function. Allows for shadow or embossed effects. Ignores map scale factor. + +------------ + + +text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Text will not be displaced.)* + +Displace text by fixed amount, in pixels, +/- along the X axis. With "dummy" placement-type, a positive value displaces to the right. With "simple" placement-type, it is either left, right or unchanged, depending on the placement selected. Any non-zero value implies "horizontal-alignment" changes to "left" by default. Has no effect with 'line' text-placement-type. + +------------ + + +text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Text will not be displaced.)* + +Displace text by fixed amount, in pixels, +/- along the Y axis. With "dummy" placement-type, a positive value displaces downwards. With "simple" placement-type, it is either up, down or unchanged, depending on the placement selected. With "line" placement-type, a positive value displaces above the path. + +------------ + + +text-vertical-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``top`` ``middle`` ``bottom`` ``auto`` + + +Default Value: auto +*(Default affected by value of dy; "top" for dy>0, "bottom" for dy<0.)* + +Position of label relative to point position. + +------------ + + +text-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Text will be potentially placed near tile edges and therefore may look cut off unless the same text label is rendered on each adjacent tile.)* + +Avoid placing labels that intersect with tile boundaries. + +------------ + + +text-margin +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No extra margin will be used to determine if a label collides with any other text, shield, or marker.)* + +Minimum distance that a label can be placed from any other text, shield, or marker. + +------------ + + +text-repeat-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Labels with the same text will be rendered without restriction.)* + +Minimum distance between repeated text. If set this will prevent text labels being rendered nearby each other that contain the same text. Similar to text-min-distance with the difference that it works the same no matter what placement strategy is used. + +------------ + + +text-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + +**Status: deprecated** + + + + + +Default Value: 0 +*(Labels with the same text will be rendered without restriction.)* + +Minimum distance to the next label with the same text. Only works for line placement. Deprecated: replaced by ``text-repeat-distance`` and ``text-margin`` + +------------ + + +text-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No margin will be used to detect if a text label is nearby a tile boundary.)* + +Minimum distance a text label will be placed from the edge of a tile. This option is similar to shield-avoid-edges:true except that the extra margin is used to discard cases where the shield+margin are not fully inside the tile. + +------------ + + +text-min-path-length +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(place labels on all geometries no matter how small they are.)* + +Place labels only on polygons and lines with a bounding width longer than this value (in pixels). + +------------ + + +text-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow text to overlap with other text - overlapping markers will not be shown.)* + +Control whether overlapping text is shown or hidden. + +------------ + + +text-orientation +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Text is not rotated and is displayed upright.)* + +Rotate the text. (only works with text-placement:point). + +------------ + + +text-rotate-displacement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Label center is used for rotation.)* + +Rotates the displacement around the placement origin by the angle given by "orientation". + +------------ + + +text-upright +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``auto`` ``auto-down`` ``left`` ``right`` ``left-only`` ``right-only`` + + +Default Value: auto +*(Text will be positioned upright automatically.)* + +How this label should be placed along lines. By default when more than half of a label's characters are upside down the label is automatically flipped to keep it upright. By changing this parameter you can prevent this "auto-upright" behavior. The "auto-down" value places text in the opposite orientation to "auto". The "left" or "right" settings can be used to force text to always be placed along a line in a given direction and therefore disables flipping if text appears upside down. The "left-only" or "right-only" properties also force a given direction but will discard upside down text rather than trying to flip it. + +------------ + + +text-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` + + +Default Value: point +*(One shield will be placed per geometry.)* + +How this label should be placed. Point placement places one label on top of a point geometry and at the centroid of a polygon or the middle point of a line, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of a polygon. + +------------ + + +text-placement-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``dummy`` ``simple`` ``list`` + + +Default Value: dummy +*(Alternative placements will not be enabled.)* + +Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off. + +------------ + + +text-placements +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(No alternative placements will be used.)* + +If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is ``text-placements: "E,NE,SE,W,NW,SW";``. + +------------ + + +text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` ``reverse`` + + +Default Value: none +*(Transform text instance with specified function. Ignores map scale factor.)* + +Transform the case of the characters. + +------------ + + +text-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` ``adjust`` + + +Default Value: auto +*(TODO.)* + +The text's horizontal alignment from it's centerpoint. If ``placement`` is set to ``line``, then ``adjust`` can be set to auto-fit the text to the length of the path by dynamically calculating ``character-spacing``. + +------------ + + +text-align +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``right`` ``center`` ``auto`` + + +Default Value: auto +*(Auto alignment means that text will be centered by default except when using the ``placement-type`` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the ``text-placements`` directives.)* + +Define how text is justified. + +------------ + + +text-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +text-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +Simplify the geometries used for text placement by the given tolerance. + +------------ + + +text-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +Simplify the geometries used for text placement by the given algorithm. + +------------ + + +text-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out the angles of the geometry used for text placement. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +text-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +text-halo-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +text-font-feature-settings +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(Default set of typographic features recommended by OpenType specification. Ligatures are turned off by default when ``character-spacing`` is greater than zero.)* + +Comma separated list of OpenType typographic features. The syntax and semantics conforms to ``font-feature-settings`` from W3C CSS. + +------------ + + +text-largest-bbox-only +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + +**Status: experimental** + + + + + +Default Value: true +*(For multipolygons only polygon with largest bbox area is labeled (does not apply to other geometries).)* + +Controls default labeling behavior on multipolygons. The default is true and means that only the polygon with largest bbox is labeled. + +------------ + + + +building +^^^^^^^^ + +building +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a building symbolizer rule or emitting it with default values. + +------------ + + +building-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: The color gray will be used for fill. +*(Gray and fully opaque (alpha = 1), same as rgb(128,128,128) or rgba(128,128,128,1).)* + +The color of the buildings fill. Note: 0.8 will be used to multiply each color component to auto-generate a darkened wall color. + +------------ + + +building-fill-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of the building as a whole, including all walls. + +------------ + + +building-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Buildings will not have a visual height and will instead look like flat polygons.)* + +The height of the building in pixels. + +------------ + + + +debug +^^^^^ + +debug-mode +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``collision`` ``vertex`` + + +Default Value: collision +*(The otherwise invisible collision boxes will be rendered as squares on the map.)* + +The mode for debug rendering. + +------------ + + + +dot +^^^ + +dot +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a dot symbolizer rule or emitting it with default values. + +------------ + + +dot-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: gray +*(The dot fill color is gray.)* + +The color of the area of the dot. + +------------ + + +dot-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The opacity of the dot.)* + +The overall opacity of the dot. + +------------ + + +dot-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The marker width is 1 pixel.)* + +The width of the dot in pixels. + +------------ + + +dot-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The marker height is 1 pixels.)* + +The height of the dot in pixels. + +------------ + + +dot-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current layer on top of other layers.)* + +Composite operation. This defines how this layer should behave relative to layers atop or below it. + +------------ + + + + + diff --git a/docs/api/mapnik/3.0.20.rst b/docs/api/mapnik/3.0.20.rst new file mode 100644 index 0000000..93b8154 --- /dev/null +++ b/docs/api/mapnik/3.0.20.rst @@ -0,0 +1,3846 @@ +3.0.20 +====== +Style +----- + + + + + +image-filters +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``functions`` + + + +Possible values: ``agg-stack-blur`` ``emboss`` ``blur`` ``gray`` ``sobel`` ``edge-detect`` ``x-gradient`` ``y-gradient`` ``invert`` ``sharpen`` ``color-blind-protanope`` ``color-blind-deuteranope`` ``color-blind-tritanope`` ``colorize-alpha`` ``color-to-alpha`` ``scale-hsla`` + +Default Value: none +*(no filters)* + +A list of image filters that will be applied to the active rendering canvas for a given style. The presence of one more ``image-filters`` will trigger a new canvas to be created before starting to render a style and then this canvas will be composited back into the main canvas after rendering all features and after all ``image-filters`` have been applied. See ``direct-image-filters`` if you want to apply a filter directly to the main canvas. + +------------ + + + +image-filters-inflate +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``boolean`` + + + + + +Default Value: false +*(No special handling will be done and image filters that blur data will only blur up to the edge of a tile boundary)* + +A property that can be set to true to enable using an inflated image internally for seamless blurring across tiles (requires buffered data). + +------------ + + + +direct-image-filters +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``functions`` + + + +Possible values: ``agg-stack-blur`` ``emboss`` ``blur`` ``gray`` ``sobel`` ``edge-detect`` ``x-gradient`` ``y-gradient`` ``invert`` ``sharpen`` ``color-blind-protanope`` ``color-blind-deuteranope`` ``color-blind-tritanope`` ``colorize-alpha`` ``color-to-alpha`` ``scale-hsla`` + +Default Value: none +*(no filters)* + +A list of image filters to apply to the main canvas (see the ``image-filters`` doc for how they work on a separate canvas). + +------------ + + + +comp-op +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current layer on top of other layers)* + +Composite operation. This defines how this layer should behave relative to layers atop or below it. + +------------ + + + +opacity +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``float`` + + + + + +Default Value: 1 +*(No separate buffer will be used and no alpha will be applied to the style after rendering.)* + +An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer). + +------------ + + + +Symbolizers +----------- + + +map +^^^ + +background-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: none +*(Will be rendered transparent.)* + +Map Background color. + +------------ + + +background-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: +*(No background image will be used.)* + +An image that is repeated below all features on a map as a background. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +background-image-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(The background-image will be blended with the background normally (placed on top of any existing background-color).)* + +Set the compositing operation used to blend the image into the background. + +------------ + + +background-image-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The image opacity will not be changed when applied to the map background.)* + +Set the opacity of the image. + +------------ + + +srs +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +*(The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space.)* + +Map spatial reference (proj4 string). + +------------ + + +buffer-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No buffer will be used.)* + +Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges". + +------------ + + +maximum-extent +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: -20037508.34,-20037508.34,20037508.34,20037508.34 +*(All data will be clipped to global mercator extent (default is applied in Carto.js).)* + +An extent to be used to limit the bounds used to query all layers during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Map. + +------------ + + +base +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.)* + +Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet. + +------------ + + +font-directory +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none +*(No map-specific fonts will be registered.)* + +Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered). + +------------ + + + +polygon +^^^^^^^ + +polygon +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a polygon symbolizer rule or emitting it with default values. + +------------ + + +polygon-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: rgba(128,128,128,1) +*(Gray and fully opaque (alpha = 1), same as rgb(128,128,128) or rgba(128,128,128,1).)* + +Fill color to assign to a polygon. + +------------ + + +polygon-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of the polygon. + +------------ + + +polygon-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully antialiased.)* +Range: 0-1 +Level of antialiasing of polygon edges. + +------------ + + +polygon-gamma-method +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``power`` ``linear`` ``none`` ``threshold`` ``multiply`` + + +Default Value: power +*(pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA.)* + +An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions. + +------------ + + +polygon-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extend outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +polygon-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +Simplify geometries by the given tolerance. + +------------ + + +polygon-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +Simplify geometries by the given algorithm. + +------------ + + +polygon-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +polygon-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(The geometry will not be transformed.)* + +Transform polygon geometry with specified function. + +------------ + + +polygon-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +line +^^^^ + +line +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a line symbolizer rule or emitting it with default values. + +------------ + + +line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black +*(black and fully opaque (alpha = 1), same as rgb(0,0,0) or rgba(0,0,0,1).)* + +The color of a drawn line. + +------------ + + +line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The line will be rendered 1 pixel wide.)* + +The width of a line in pixels. + +------------ + + +line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of a line. + +------------ + + +line-join +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``miter`` ``miter-revert`` ``round`` ``bevel`` + + +Default Value: miter +*(The line joins will be rendered using a miter look.)* + +The behavior of lines when joining. + +------------ + + +line-cap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``butt`` ``round`` ``square`` + + +Default Value: butt +*(The line endings will be rendered using a butt look.)* + +The display of line endings. + +------------ + + +line-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully antialiased.)* +Range: 0-1 +Level of antialiasing of stroke line. + +------------ + + +line-gamma-method +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``power`` ``linear`` ``none`` ``threshold`` ``multiply`` + + +Default Value: power +*(pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA.)* + +An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions. + +------------ + + +line-dasharray +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(The line will be drawn without dashes.)* + +A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns. + +------------ + + +line-dash-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(The line will be drawn without dashes.)* + +Valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled). + +------------ + + +line-miterlimit +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 4 +*(Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )'.)* + +The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts. + +------------ + + +line-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +line-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +Simplify geometries by the given tolerance. + +------------ + + +line-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +Simplify geometries by the given algorithm. + +------------ + + +line-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +line-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + +**Status: unstable** + + + + + +Default Value: 0 +*(Will not be offset.)* + +Offsets a line a number of pixels parallel to its actual path. Positive values move the line left, negative values move it right (relative to the directionality of the line). + +------------ + + +line-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full +*(The line will be rendered using the highest quality method rather than the fastest.)* + +Exposes an alternate AGG rendering method that sacrifices some accuracy for speed. + +------------ + + +line-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(The geometry will not be transformed.)* + +Transform line geometry with specified function. + +------------ + + +line-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +markers +^^^^^^^ + +marker +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a marker symbolizer rule or emitting it with default values. + +------------ + + +marker-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none +*(An ellipse or circle, if width equals height.)* + +A file that this marker shows at each placement. If no file is given, the marker will show an ellipse. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +marker-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The stroke-opacity and fill-opacity of the marker.)* + +The overall opacity of the marker, if set, overrides both the opacity of the fill and the opacity of the stroke. + +------------ + + +marker-fill-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The fill opacity of the marker. This property will also set the ``fill-opacity`` of elements in an SVG loaded from a file. + +------------ + + +marker-line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black +*(The marker will be drawn with a black outline.)* + +The color of the stroke around the marker. This property will also set the ``stroke`` of elements in an SVG loaded from a file. + +------------ + + +marker-line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.5 +*(The marker will be drawn with an outline of .5 pixels wide.)* + +The width of the stroke around the marker, in pixels. This is positioned on the boundary, so high values can cover the area itself. This property will also set the ``stroke-width`` of elements in an SVG loaded from a file. + +------------ + + +marker-line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque. This property will also set the ``stroke-opacity`` of elements in an SVG loaded from a file.)* + +The opacity of a line. + +------------ + + +marker-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``interior`` ``vertex-first`` ``vertex-last`` + + +Default Value: point +*(Place markers at the center point (centroid) of the geometry.)* + +Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior. The 'vertex-first' and 'vertex-last' options can be used to place markers at the first or last vertex of lines or polygons. + +------------ + + +marker-multi-policy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``each`` ``whole`` ``largest`` + + +Default Value: each +*(If a feature contains multiple geometries and the placement type is either point or interior then a marker will be rendered for each.)* + +A special setting to allow the user to control rendering behavior for 'multi-geometries' (when a feature contains multiple geometries). This setting does not apply to markers placed along lines. The 'each' policy is default and means all geometries will get a marker. The 'whole' policy means that the aggregate centroid between all geometries will be used. The 'largest' policy means that only the largest (by bounding box areas) feature will get a rendered marker (this is how text labeling behaves by default). + +------------ + + +marker-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: deprecated** + + +Possible values: ``arrow`` ``ellipse`` + + +Default Value: ellipse +*(The marker shape is an ellipse.)* + +The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width). + +------------ + + +marker-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 +*(The marker width is 10 pixels.)* + +The width of the marker, if using one of the default types. + +------------ + + +marker-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 +*(The marker height is 10 pixels.)* + +The height of the marker, if using one of the default types. + +------------ + + +marker-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: blue +*(The marker fill color is blue.)* + +The color of the area of the marker. This property will also set the ``fill`` of elements in an SVG loaded from a file. + +------------ + + +marker-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow markers to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping markers are shown or hidden. + +------------ + + +marker-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Markers will be potentially placed near tile edges and therefore may look cut off unless they are rendered on each adjacent tile.)* + +Avoid placing markers that intersect with tile boundaries. + +------------ + + +marker-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache.)* + +Value to control whether the placement of the feature will prevent the placement of other features. + +------------ + + +marker-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 100 +*(In the case of marker-placement:line then draw a marker every 100 pixels along a line.)* + +Space between repeated markers in pixels. If the spacing is less than the marker size or larger than the line segment length then no marker will be placed. Any value less than 1 will be ignored and the default will be used instead. + +------------ + + +marker-max-error +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.2 +*(N/A: not intended to be changed.)* + +N/A: not intended to be changed. + +------------ + + +marker-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation.)* + +Transform marker instance with specified function. Ignores map scale factor. + +------------ + + +marker-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +marker-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Geometry will not be simplified.)* + +geometries are simplified by the given tolerance. + +------------ + + +marker-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +geometries are simplified by the given algorithm. + +------------ + + +marker-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +marker-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(The geometry will not be transformed.)* + +Transform marker geometry with specified function. + +------------ + + +marker-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Will not be offset.)* + +Offsets a marker from a line a number of pixels parallel to its actual path. Positive values move the marker left, negative values move it right (relative to the directionality of the line). + +------------ + + +marker-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +marker-direction +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``auto`` ``auto-down`` ``left`` ``right`` ``left-only`` ``right-only`` ``up`` ``down`` + + +Default Value: right +*(Markers are oriented to the right in the line direction.)* + +How markers should be placed along lines. With the "auto" setting when marker is upside down the marker is automatically rotated by 180 degrees to keep it upright. The "auto-down" value places marker in the opposite orientation to "auto". The "left" or "right" settings can be used to force marker to always be placed along a line in a given direction and therefore disables rotating if marker appears upside down. The "left-only" or "right-only" properties also force a given direction but will discard upside down markers rather than trying to flip it. The "up" and "down" settings don't adjust marker's orientation to the line direction. + +------------ + + + +shield +^^^^^^ + +shield +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a shield symbolizer rule. + +------------ + + +shield-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(No text label will be rendered with the shield.)* + +Value to use for a shield"s text label. Data columns are specified using brackets like [column_name]. + +------------ + + +shield-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image file to render behind the shield text. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +shield-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: none + + +Font name and style to use for the shield text. + +------------ + + +shield-unlock-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(text alignment relative to the shield image uses the center of the image as the anchor for text positioning.)* + +This parameter should be set to true if you are trying to position text beside rather than on top of the shield image. + +------------ + + +shield-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 +*(Font size of 10 will be used to render text.)* + +The size of the shield text in pixels. + +------------ + + +shield-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black +*(The shield text will be rendered black.)* + +The color of the shield text. + +------------ + + +shield-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` ``grid`` ``alternating-grid`` + + +Default Value: point +*(One shield will be placed per geometry.)* + +How this shield should be placed. Point placement places one shield on top of a point geometry and at the centroid of a polygon or the middle point of a line, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of a polygon. + +------------ + + +shield-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Shields will be potentially placed near tile edges and therefore may look cut off unless they are rendered on each adjacent tile.)* + +Avoid placing shields that intersect with tile boundaries. + +------------ + + +shield-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow shields to overlap with other map elements already placed.)* + +Control whether overlapping shields are shown or hidden. + +------------ + + +shield-margin +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No extra margin will be used to determine if a shield collides with any other text, shield, or marker.)* + +Minimum distance that a shield can be placed from any other text, shield, or marker. + +------------ + + +shield-repeat-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Shields with the same text will be rendered without restriction.)* + +Minimum distance between repeated shields. If set this will prevent shields being rendered nearby each other that contain the same text. Similar to shield-min-distance with the difference that it works the same no matter what placement strategy is used. + +------------ + + +shield-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + +**Status: deprecated** + + + + + +Default Value: 0 +*(Shields with the same text will be rendered without restriction.)* + +Minimum distance to any other collision object. Deprecated: replaced by ``text-margin``. + +------------ + + +shield-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Only one shield per line will attempt to be placed.)* + +Distance the renderer should use to try to place repeated shields on a line. + +------------ + + +shield-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No margin will be used to detect if a shield is nearby a tile boundary.)* + +Minimum distance a shield will be placed from the edge of a tile. This option is similar to shield-avoid-edges:true except that the extra margin is used to discard cases where the shield+margin are not fully inside the tile. + +------------ + + +shield-label-position-tolerance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: shield-spacing/2.0 +*(If a shield cannot be placed then the renderer will advance by shield-spacing/2.0 to try placement again.)* + +Allows the shield to be displaced from its ideal position by a number of pixels (only works with placement:line). + +------------ + + +shield-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 +*(Text will not be wrapped.)* + +Length of a chunk of text in pixels before wrapping text. If set to zero, text doesn't wrap. + +------------ + + +shield-wrap-before +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Wrapped lines will be a bit longer than wrap-width.)* + +Wrap text before wrap-width is reached. + +------------ + + +shield-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: " " +*(Lines will be wrapped conforming to the (untailored) Unicode Line Break Algorithm provided by ICU BreakIterator.)* + +Must be a single character. If you set it to other than the space character, Mapnik will wrap strictly on that character without involving any additional rules. + +------------ + + +shield-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: white +*(The shield halo text will be rendered white.)* + +Specifies the color of the halo around the text. + +------------ + + +shield-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo.)* + +Specify the radius of the halo in pixels. + +------------ + + +shield-halo-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full +*(The shield will be rendered using the highest quality method rather than the fastest.)* + +Exposes an alternate text halo rendering method that sacrifices quality for speed. + +------------ + + +shield-halo-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: +*(No transformation.)* + +Transform shield halo relative to the actual text with specified function. Allows for shadow or embossed effects. Ignores map scale factor. + +------------ + + +shield-halo-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +shield-halo-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque.)* + +A number from 0 to 1 specifying the opacity for the text halo. + +------------ + + +shield-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 +*(The default character spacing of the font will be used.)* + +Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement. + +------------ + + +shield-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(The default font spacing will be used.)* + +Vertical spacing between lines of multiline labels (in pixels). + +------------ + + +shield-text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Text will not be displaced.)* + +Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the shield right. + +------------ + + +shield-text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Text will not be displaced.)* + +Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the shield down. + +------------ + + +shield-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Shield will not be displaced.)* + +Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right. + +------------ + + +shield-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Shield will not be displaced.)* + +Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down. + +------------ + + +shield-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of the image used for the shield. + +------------ + + +shield-text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of the text placed on top of the shield. + +------------ + + +shield-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` + + +Default Value: auto +*(TODO.)* + +The shield's horizontal alignment from its centerpoint. + +------------ + + +shield-vertical-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``top`` ``middle`` ``bottom`` ``auto`` + + +Default Value: middle +*(TODO.)* + +The shield's vertical alignment from its centerpoint. + +------------ + + +shield-placement-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``dummy`` ``simple`` ``list`` + + +Default Value: dummy +*(Alternative placements will not be enabled.)* + +Re-position and/or re-size shield to avoid overlaps. "simple" for basic algorithm (using shield-placements string,) "dummy" to turn this feature off. + +------------ + + +shield-placements +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(No alternative placements will be used.)* + +If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is ``shield-placements: "E,NE,SE,W,NW,SW";``. + +------------ + + +shield-text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` ``reverse`` + + +Default Value: none +*(No text transformation will be applied.)* + +Transform the case of the characters. + +------------ + + +shield-justify-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``center`` ``right`` ``auto`` + + +Default Value: auto +*(TODO.)* + +Define how text in a shield's label is justified. + +------------ + + +shield-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation.)* + +Transform shield instance with specified function. Ignores map scale factor. + +------------ + + +shield-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +shield-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +Simplify the geometries used for shield placement by the given tolerance. + +------------ + + +shield-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +Simplify the geometries used for shield placement by the given algorithm. + +------------ + + +shield-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out the angles of the geometry used for shield placement. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +shield-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +shield-grid-cell-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No placement will be done.)* + +Controls horizontal spacing between placements of placement type ``grid`` or ``alternating-grid``. + +------------ + + +shield-grid-cell-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No placement will be done.)* + +Controls vertical spacing between placements of placement type ``grid`` or ``alternating-grid``. + +------------ + + + +line-pattern +^^^^^^^^^^^^ + +line-pattern +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a line pattern symbolizer rule or emitting it with default values. + +------------ + + +line-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +An image file to be repeated and warped along a line. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +line-pattern-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +line-pattern-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The image is rendered without modifications.)* + +Apply an opacity level to the image used for the pattern. + +------------ + + +line-pattern-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +geometries are simplified by the given tolerance. + +------------ + + +line-pattern-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +geometries are simplified by the given algorithm. + +------------ + + +line-pattern-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +line-pattern-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(The line will not be offset.)* + +Offsets a line a number of pixels parallel to its actual path. Positive values move the line left, negative values move it right (relative to the directionality of the line). + +------------ + + +line-pattern-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(The geometry will not be transformed.)* + +Transform line geometry with specified function and apply pattern to transformed geometry. + +------------ + + +line-pattern-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation.)* + +Transform line pattern instance with specified function. + +------------ + + +line-pattern-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +polygon-pattern +^^^^^^^^^^^^^^^ + +polygon-pattern +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a polygon pattern symbolizer rule or emitting it with default values. + +------------ + + +polygon-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image to use as a repeated pattern fill within a polygon. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +polygon-pattern-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``global`` ``local`` + + +Default Value: global +*(Patterns will be aligned to the map (or tile boundaries) when being repeated across polygons. This is ideal for seamless patterns in tiled rendering.)* + +Specify whether to align pattern fills to the layer's geometry (local) or to the map (global). + +------------ + + +polygon-pattern-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully antialiased.)* +Range: 0-1 +Level of antialiasing of polygon pattern edges. + +------------ + + +polygon-pattern-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The image is rendered without modifications.)* + +Apply an opacity level to the image used for the pattern. + +------------ + + +polygon-pattern-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +polygon-pattern-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +geometries are simplified by the given tolerance. + +------------ + + +polygon-pattern-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +geometries are simplified by the given algorithm. + +------------ + + +polygon-pattern-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +polygon-pattern-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(The geometry will not be transformed.)* + +Transform polygon geometry with specified function and apply pattern to transformed geometry. + +------------ + + +polygon-pattern-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation.)* + +Transform polygon pattern instance with specified function. + +------------ + + +polygon-pattern-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +raster +^^^^^^ + +raster +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a raster symbolizer rule or emitting it with default values. + +------------ + + +raster-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of the raster symbolizer on top of other symbolizers. + +------------ + + +raster-filter-factor +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: -1 +*(Allow the datasource to choose appropriate downscaling.)* + +This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed. + +------------ + + +raster-scaling +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``near`` ``fast`` ``bilinear`` ``bicubic`` ``spline16`` ``spline36`` ``hanning`` ``hamming`` ``hermite`` ``kaiser`` ``quadric`` ``catrom`` ``gaussian`` ``bessel`` ``mitchell`` ``sinc`` ``lanczos`` ``blackman`` + + +Default Value: near +*(Nearest neighboor resampling will be used to scale the image to the target size of the map.)* + +The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality. + +------------ + + +raster-mesh-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 16 +*(Reprojection mesh will be 1/16 of the resolution of the source image.)* + +A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion. + +------------ + + +raster-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +raster-colorizer-default-mode +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``discrete`` ``linear`` ``exact`` + + +Default Value: linear +*(A linear interpolation is used to generate colors between the two nearest stops.)* + +This can be either ``discrete``, ``linear`` or ``exact``. If it is not specified then the default is ``linear``. + +------------ + + +raster-colorizer-default-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: transparent +*(Pixels that are not colored by the colorizer stops will be transparent.)* + +This can be any color. Sets the color that is applied to all values outside of the range of the colorizer-stops. If not supplied pixels will be fully transparent. + +------------ + + +raster-colorizer-epsilon +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1.1920928955078125e-07 +*(Pixels must very closely match the stop filter otherwise they will not be colored.)* + +This can be any positive floating point value and will be used as a tolerance in floating point comparisions. The higher the value the more likely a stop will match and color data. + +------------ + + +raster-colorizer-stops +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``tags`` + + + + + +Default Value: +*(No colorization will happen without supplying stops.)* + +Assigns raster data values to colors. Stops must be listed in ascending order, and contain at a minimum the value and the associated color. You can also include the color-mode as a third argument, like ``stop(100,#fff,exact)``. + +------------ + + + +point +^^^^^ + +point +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a point symbolizer rule or emitting it with default values. + +------------ + + +point-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none +*(A 4x4 black square will be rendered.)* + +Image file to represent a point. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +point-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow points to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping points are shown or hidden. + +------------ + + +point-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache.)* + +Control whether the placement of the feature will prevent the placement of other features. + +------------ + + +point-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque.)* + +A value from 0 to 1 to control the opacity of the point. + +------------ + + +point-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``centroid`` ``interior`` + + +Default Value: centroid +*(The centroid of the geometry will be used to place the point.)* + +Control how this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon. + +------------ + + +point-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation.)* + +Transform point instance with specified function. Ignores map scale factor. + +------------ + + +point-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +text +^^^^ + +text +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a text symbolizer rule. + +------------ + + +text-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: none + + +Value to use for a text label. Data columns are specified using brackets like [column_name]. + +------------ + + +text-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: none + + +Font name and style to render a label in. + +------------ + + +text-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 +*(Font size of 10 will be used to render text.)* + +Text size in pixels. + +------------ + + +text-ratio +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 +*(TODO.)* + +Define the amount of text (of the total) present on successive lines when wrapping occurs. + +------------ + + +text-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 +*(Text will not be wrapped.)* + +Length of a chunk of text in pixels before wrapping text. If set to zero, text doesn't wrap. + +------------ + + +text-wrap-before +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Wrapped lines will be a bit longer than wrap-width.)* + +Wrap text before wrap-width is reached. + +------------ + + +text-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: " " +*(Lines will be wrapped conforming to the (untailored) Unicode Line Break Algorithm provided by ICU BreakIterator.)* + +Must be a single character. If you set it to other than the space character, Mapnik will wrap strictly on that character without involving any additional rules. + +------------ + + +text-repeat-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + +**Status: unstable** + + + + + +Default Value: false +*(Character will be removed when used to wrap a line.)* + +Keep the character used to wrap a line instead of removing it, and repeat it on the new line. + +------------ + + +text-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 +*(Only one label per line will attempt to be placed.)* + +Distance the renderer should use to try to place repeated text labels on a line. + +------------ + + +text-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(The default character spacing of the font will be used.)* + +Horizontal spacing adjustment between characters in pixels. This value is ignored when ``horizontal-alignment`` is set to ``adjust``. Typographic ligatures are turned off when this value is greater than zero. + +------------ + + +text-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(The default font spacing will be used.)* + +Vertical spacing adjustment between lines in pixels. + +------------ + + +text-label-position-tolerance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: text-spacing/2.0 +*(If a shield cannot be placed then the renderer will advance by text-spacing/2.0 to try placement again.)* + +Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line). + +------------ + + +text-max-char-angle-delta +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 22.5 +*(The label will not be placed if a character falls on a line with an angle sharper than 22.5 degrees.)* + +The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners. + +------------ + + +text-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black +*(The text will be rendered black.)* + +Specifies the color for the text. + +------------ + + +text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque.)* + +A number from 0 to 1 specifying the opacity for the text. + +------------ + + +text-halo-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque.)* + +A number from 0 to 1 specifying the opacity for the text halo. + +------------ + + +text-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: white +*(The halo will be rendered white.)* + +Specifies the color of the halo around the text. + +------------ + + +text-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo.)* + +Specify the radius of the halo in pixels. + +------------ + + +text-halo-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full +*(The text will be rendered using the highest quality method rather than the fastest.)* + +Exposes an alternate text halo rendering method that sacrifices quality for speed. + +------------ + + +text-halo-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: +*(No transformation.)* + +Transform text halo relative to the actual text with specified function. Allows for shadow or embossed effects. Ignores map scale factor. + +------------ + + +text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Text will not be displaced.)* + +Displace text by fixed amount, in pixels, +/- along the X axis. With "dummy" placement-type, a positive value displaces to the right. With "simple" placement-type, it is either left, right or unchanged, depending on the placement selected. Any non-zero value implies "horizontal-alignment" changes to "left" by default. Has no effect with 'line' text-placement-type. + +------------ + + +text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Text will not be displaced.)* + +Displace text by fixed amount, in pixels, +/- along the Y axis. With "dummy" placement-type, a positive value displaces downwards. With "simple" placement-type, it is either up, down or unchanged, depending on the placement selected. With "line" placement-type, a positive value displaces above the path. + +------------ + + +text-vertical-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``top`` ``middle`` ``bottom`` ``auto`` + + +Default Value: auto +*(Default affected by value of dy; "top" for dy>0, "bottom" for dy<0.)* + +Position of label relative to point position. + +------------ + + +text-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Text will be potentially placed near tile edges and therefore may look cut off unless the same text label is rendered on each adjacent tile.)* + +Avoid placing labels that intersect with tile boundaries. + +------------ + + +text-margin +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No extra margin will be used to determine if a label collides with any other text, shield, or marker.)* + +Minimum distance that a label can be placed from any other text, shield, or marker. + +------------ + + +text-repeat-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Labels with the same text will be rendered without restriction.)* + +Minimum distance between repeated text. If set this will prevent text labels being rendered nearby each other that contain the same text. Similar to text-min-distance with the difference that it works the same no matter what placement strategy is used. + +------------ + + +text-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + +**Status: deprecated** + + + + + +Default Value: 0 +*(Labels with the same text will be rendered without restriction.)* + +Minimum distance to the next label with the same text. Only works for line placement. Deprecated: replaced by ``text-repeat-distance`` and ``text-margin`` + +------------ + + +text-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No margin will be used to detect if a text label is nearby a tile boundary.)* + +Minimum distance a text label will be placed from the edge of a tile. This option is similar to shield-avoid-edges:true except that the extra margin is used to discard cases where the shield+margin are not fully inside the tile. + +------------ + + +text-min-path-length +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(place labels on all geometries no matter how small they are.)* + +Place labels only on polygons and lines with a bounding width longer than this value (in pixels). + +------------ + + +text-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow text to overlap with other text - overlapping markers will not be shown.)* + +Control whether overlapping text is shown or hidden. + +------------ + + +text-orientation +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Text is not rotated and is displayed upright.)* + +Rotate the text. (only works with text-placement:point). + +------------ + + +text-rotate-displacement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Label center is used for rotation.)* + +Rotates the displacement around the placement origin by the angle given by "orientation". + +------------ + + +text-upright +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``auto`` ``auto-down`` ``left`` ``right`` ``left-only`` ``right-only`` + + +Default Value: auto +*(Text will be positioned upright automatically.)* + +How this label should be placed along lines. By default when more than half of a label's characters are upside down the label is automatically flipped to keep it upright. By changing this parameter you can prevent this "auto-upright" behavior. The "auto-down" value places text in the opposite orientation to "auto". The "left" or "right" settings can be used to force text to always be placed along a line in a given direction and therefore disables flipping if text appears upside down. The "left-only" or "right-only" properties also force a given direction but will discard upside down text rather than trying to flip it. + +------------ + + +text-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` ``grid`` ``alternating-grid`` + + +Default Value: point +*(One shield will be placed per geometry.)* + +How this label should be placed. Point placement places one label on top of a point geometry and at the centroid of a polygon or the middle point of a line, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of a polygon. + +------------ + + +text-placement-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``dummy`` ``simple`` ``list`` + + +Default Value: dummy +*(Alternative placements will not be enabled.)* + +Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off. + +------------ + + +text-placements +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(No alternative placements will be used.)* + +If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is ``text-placements: "E,NE,SE,W,NW,SW";``. + +------------ + + +text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` ``reverse`` + + +Default Value: none +*(Transform text instance with specified function. Ignores map scale factor.)* + +Transform the case of the characters. + +------------ + + +text-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` ``adjust`` + + +Default Value: auto +*(TODO.)* + +The text's horizontal alignment from it's centerpoint. If ``placement`` is set to ``line``, then ``adjust`` can be set to auto-fit the text to the length of the path by dynamically calculating ``character-spacing``. + +------------ + + +text-align +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``right`` ``center`` ``auto`` + + +Default Value: auto +*(Auto alignment means that text will be centered by default except when using the ``placement-type`` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the ``text-placements`` directives.)* + +Define how text is justified. + +------------ + + +text-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +text-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +Simplify the geometries used for text placement by the given tolerance. + +------------ + + +text-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +Simplify the geometries used for text placement by the given algorithm. + +------------ + + +text-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out the angles of the geometry used for text placement. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +text-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +text-halo-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +text-font-feature-settings +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(Default set of typographic features recommended by OpenType specification. Ligatures are turned off by default when ``character-spacing`` is greater than zero.)* + +Comma separated list of OpenType typographic features. The syntax and semantics conforms to ``font-feature-settings`` from W3C CSS. + +------------ + + +text-largest-bbox-only +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + +**Status: experimental** + + + + + +Default Value: true +*(For multipolygons only polygon with largest bbox area is labeled (does not apply to other geometries).)* + +Controls default labeling behavior on multipolygons. The default is true and means that only the polygon with largest bbox is labeled. + +------------ + + +text-grid-cell-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No placement will be done.)* + +Controls horizontal spacing between placements of placement type ``grid`` or ``alternating-grid``. + +------------ + + +text-grid-cell-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No placement will be done.)* + +Controls vertical spacing between placements of placement type ``grid`` or ``alternating-grid``. + +------------ + + + +building +^^^^^^^^ + +building +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a building symbolizer rule or emitting it with default values. + +------------ + + +building-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: The color gray will be used for fill. +*(Gray and fully opaque (alpha = 1), same as rgb(128,128,128) or rgba(128,128,128,1).)* + +The color of the buildings fill. Note: 0.8 will be used to multiply each color component to auto-generate a darkened wall color. + +------------ + + +building-fill-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of the building as a whole, including all walls. + +------------ + + +building-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Buildings will not have a visual height and will instead look like flat polygons.)* + +The height of the building in pixels. + +------------ + + + +debug +^^^^^ + +debug-mode +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``collision`` ``vertex`` + + +Default Value: collision +*(The otherwise invisible collision boxes will be rendered as squares on the map.)* + +The mode for debug rendering. + +------------ + + + +dot +^^^ + +dot +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a dot symbolizer rule or emitting it with default values. + +------------ + + +dot-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: gray +*(The dot fill color is gray.)* + +The color of the area of the dot. + +------------ + + +dot-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The opacity of the dot.)* + +The overall opacity of the dot. + +------------ + + +dot-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The marker width is 1 pixel.)* + +The width of the dot in pixels. + +------------ + + +dot-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The marker height is 1 pixels.)* + +The height of the dot in pixels. + +------------ + + +dot-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current layer on top of other layers.)* + +Composite operation. This defines how this layer should behave relative to layers atop or below it. + +------------ + + + + + diff --git a/docs/api/mapnik/3.0.3.rst b/docs/api/mapnik/3.0.3.rst new file mode 100644 index 0000000..04453d7 --- /dev/null +++ b/docs/api/mapnik/3.0.3.rst @@ -0,0 +1,3778 @@ +3.0.3 +===== +Style +----- + + + + + +image-filters +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``functions`` + + + +Possible values: ``agg-stack-blur`` ``emboss`` ``blur`` ``gray`` ``sobel`` ``edge-detect`` ``x-gradient`` ``y-gradient`` ``invert`` ``sharpen`` ``color-blind-protanope`` ``color-blind-deuteranope`` ``color-blind-tritanope`` ``colorize-alpha`` ``color-to-alpha`` ``scale-hsla`` + +Default Value: none +*(no filters)* + +A list of image filters that will be applied to the active rendering canvas for a given style. The presence of one more ``image-filters`` will trigger a new canvas to be created before starting to render a style and then this canvas will be composited back into the main canvas after rendering all features and after all ``image-filters`` have been applied. See ``direct-image-filters`` if you want to apply a filter directly to the main canvas. + +------------ + + + +image-filters-inflate +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``boolean`` + + + + + +Default Value: false +*(No special handling will be done and image filters that blur data will only blur up to the edge of a tile boundary)* + +A property that can be set to true to enable using an inflated image internally for seamless blurring across tiles (requires buffered data). + +------------ + + + +direct-image-filters +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``functions`` + + + +Possible values: ``agg-stack-blur`` ``emboss`` ``blur`` ``gray`` ``sobel`` ``edge-detect`` ``x-gradient`` ``y-gradient`` ``invert`` ``sharpen`` ``color-blind-protanope`` ``color-blind-deuteranope`` ``color-blind-tritanope`` ``colorize-alpha`` ``color-to-alpha`` ``scale-hsla`` + +Default Value: none +*(no filters)* + +A list of image filters to apply to the main canvas (see the ``image-filters`` doc for how they work on a separate canvas). + +------------ + + + +comp-op +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current layer on top of other layers)* + +Composite operation. This defines how this layer should behave relative to layers atop or below it. + +------------ + + + +opacity +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``float`` + + + + + +Default Value: 1 +*(No separate buffer will be used and no alpha will be applied to the style after rendering.)* + +An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer). + +------------ + + + +Symbolizers +----------- + + +map +^^^ + +background-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: none +*(Will be rendered transparent.)* + +Map Background color. + +------------ + + +background-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: +*(No background image will be used.)* + +An image that is repeated below all features on a map as a background. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +background-image-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(The background-image will be blended with the background normally (placed on top of any existing background-color).)* + +Set the compositing operation used to blend the image into the background. + +------------ + + +background-image-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The image opacity will not be changed when applied to the map background.)* + +Set the opacity of the image. + +------------ + + +srs +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +*(The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space.)* + +Map spatial reference (proj4 string). + +------------ + + +buffer-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No buffer will be used.)* + +Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges". + +------------ + + +maximum-extent +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: -20037508.34,-20037508.34,20037508.34,20037508.34 +*(All data will be clipped to global mercator extent (default is applied in Carto.js).)* + +An extent to be used to limit the bounds used to query all layers during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Map. + +------------ + + +base +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.)* + +Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet. + +------------ + + +font-directory +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none +*(No map-specific fonts will be registered.)* + +Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered). + +------------ + + + +polygon +^^^^^^^ + +polygon +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a polygon symbolizer rule or emitting it with default values. + +------------ + + +polygon-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: The color gray will be used for fill. +*(Gray and fully opaque (alpha = 1), same as rgb(128,128,128) or rgba(128,128,128,1).)* + +Fill color to assign to a polygon. + +------------ + + +polygon-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of the polygon. + +------------ + + +polygon-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully antialiased.)* +Range: 0-1 +Level of antialiasing of polygon edges. + +------------ + + +polygon-gamma-method +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``power`` ``linear`` ``none`` ``threshold`` ``multiply`` + + +Default Value: power +*(pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA.)* + +An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions. + +------------ + + +polygon-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extend outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +polygon-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +Simplify geometries by the given tolerance. + +------------ + + +polygon-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +Simplify geometries by the given algorithm. + +------------ + + +polygon-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +polygon-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(The geometry will not be transformed.)* + +Transform polygon geometry with specified function. + +------------ + + +polygon-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +line +^^^^ + +line +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a line symbolizer rule or emitting it with default values. + +------------ + + +line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black +*(black and fully opaque (alpha = 1), same as rgb(0,0,0) or rgba(0,0,0,1).)* + +The color of a drawn line. + +------------ + + +line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The line will be rendered 1 pixel wide.)* + +The width of a line in pixels. + +------------ + + +line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of a line. + +------------ + + +line-join +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``miter`` ``miter-revert`` ``round`` ``bevel`` + + +Default Value: miter +*(The line joins will be rendered using a miter look.)* + +The behavior of lines when joining. + +------------ + + +line-cap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``butt`` ``round`` ``square`` + + +Default Value: butt +*(The line endings will be rendered using a butt look.)* + +The display of line endings. + +------------ + + +line-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully antialiased.)* +Range: 0-1 +Level of antialiasing of stroke line. + +------------ + + +line-gamma-method +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``power`` ``linear`` ``none`` ``threshold`` ``multiply`` + + +Default Value: power +*(pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA.)* + +An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions. + +------------ + + +line-dasharray +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(The line will be drawn without dashes.)* + +A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns. + +------------ + + +line-dash-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(The line will be drawn without dashes.)* + +Valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled). + +------------ + + +line-miterlimit +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 4 +*(Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )'.)* + +The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts. + +------------ + + +line-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +line-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +Simplify geometries by the given tolerance. + +------------ + + +line-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +Simplify geometries by the given algorithm. + +------------ + + +line-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +line-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + +**Status: unstable** + + + + + +Default Value: 0 +*(Will not be offset.)* + +Offsets a line a number of pixels parallel to its actual path. Positive values move the line left, negative values move it right (relative to the directionality of the line). + +------------ + + +line-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full +*(The line will be rendered using the highest quality method rather than the fastest.)* + +Exposes an alternate AGG rendering method that sacrifices some accuracy for speed. + +------------ + + +line-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(The geometry will not be transformed.)* + +Transform line geometry with specified function. + +------------ + + +line-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +markers +^^^^^^^ + +marker +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a marker symbolizer rule or emitting it with default values. + +------------ + + +marker-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none +*(An ellipse or circle, if width equals height.)* + +A file that this marker shows at each placement. If no file is given, the marker will show an ellipse. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +marker-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The stroke-opacity and fill-opacity of the marker.)* + +The overall opacity of the marker, if set, overrides both the opacity of the fill and the opacity of the stroke. + +------------ + + +marker-fill-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The fill opacity of the marker. This property will also set the ``fill-opacity`` of elements in an SVG loaded from a file. + +------------ + + +marker-line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black +*(The marker will be drawn with a black outline.)* + +The color of the stroke around the marker. This property will also set the ``stroke`` of elements in an SVG loaded from a file. + +------------ + + +marker-line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.5 +*(The marker will be drawn with an outline of .5 pixels wide.)* + +The width of the stroke around the marker, in pixels. This is positioned on the boundary, so high values can cover the area itself. This property will also set the ``stroke-width`` of elements in an SVG loaded from a file. + +------------ + + +marker-line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque. This property will also set the ``stroke-opacity`` of elements in an SVG loaded from a file.)* + +The opacity of a line. + +------------ + + +marker-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``interior`` ``vertex-first`` ``vertex-last`` + + +Default Value: point +*(Place markers at the center point (centroid) of the geometry.)* + +Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior. The 'vertex-first' and 'vertex-last' options can be used to place markers at the first or last vertex of lines or polygons. + +------------ + + +marker-multi-policy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``each`` ``whole`` ``largest`` + + +Default Value: each +*(If a feature contains multiple geometries and the placement type is either point or interior then a marker will be rendered for each.)* + +A special setting to allow the user to control rendering behavior for 'multi-geometries' (when a feature contains multiple geometries). This setting does not apply to markers placed along lines. The 'each' policy is default and means all geometries will get a marker. The 'whole' policy means that the aggregate centroid between all geometries will be used. The 'largest' policy means that only the largest (by bounding box areas) feature will get a rendered marker (this is how text labeling behaves by default). + +------------ + + +marker-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: deprecated** + + +Possible values: ``arrow`` ``ellipse`` + + +Default Value: ellipse +*(The marker shape is an ellipse.)* + +The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width). + +------------ + + +marker-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 +*(The marker width is 10 pixels.)* + +The width of the marker, if using one of the default types. + +------------ + + +marker-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 +*(The marker height is 10 pixels.)* + +The height of the marker, if using one of the default types. + +------------ + + +marker-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: blue +*(The marker fill color is blue.)* + +The color of the area of the marker. This property will also set the ``fill`` of elements in an SVG loaded from a file. + +------------ + + +marker-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow markers to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping markers are shown or hidden. + +------------ + + +marker-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Markers will be potentially placed near tile edges and therefore may look cut off unless they are rendered on each adjacent tile.)* + +Avoid placing markers that intersect with tile boundaries. + +------------ + + +marker-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache.)* + +Value to control whether the placement of the feature will prevent the placement of other features. + +------------ + + +marker-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 100 +*(In the case of marker-placement:line then draw a marker every 100 pixels along a line.)* + +Space between repeated markers in pixels. If the spacing is less than the marker size or larger than the line segment length then no marker will be placed. Any value less than 1 will be ignored and the default will be used instead. + +------------ + + +marker-max-error +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.2 +*(N/A: not intended to be changed.)* + +N/A: not intended to be changed. + +------------ + + +marker-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation.)* + +Transform marker instance with specified function. Ignores map scale factor. + +------------ + + +marker-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +marker-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Geometry will not be simplified.)* + +geometries are simplified by the given tolerance. + +------------ + + +marker-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +geometries are simplified by the given algorithm. + +------------ + + +marker-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +marker-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(The geometry will not be transformed.)* + +Transform marker geometry with specified function. + +------------ + + +marker-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Will not be offset.)* + +Offsets a marker from a line a number of pixels parallel to its actual path. Positive values move the marker left, negative values move it right (relative to the directionality of the line). + +------------ + + +marker-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +marker-direction +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``auto`` ``auto-down`` ``left`` ``right`` ``left-only`` ``right-only`` ``up`` ``down`` + + +Default Value: right +*(Markers are oriented to the right in the line direction.)* + +How markers should be placed along lines. With the "auto" setting when marker is upside down the marker is automatically rotated by 180 degrees to keep it upright. The "auto-down" value places marker in the opposite orientation to "auto". The "left" or "right" settings can be used to force marker to always be placed along a line in a given direction and therefore disables rotating if marker appears upside down. The "left-only" or "right-only" properties also force a given direction but will discard upside down markers rather than trying to flip it. The "up" and "down" settings don't adjust marker's orientation to the line direction. + +------------ + + + +shield +^^^^^^ + +shield +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a shield symbolizer rule. + +------------ + + +shield-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(No text label will be rendered with the shield.)* + +Value to use for a shield"s text label. Data columns are specified using brackets like [column_name]. + +------------ + + +shield-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image file to render behind the shield text. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +shield-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: none + + +Font name and style to use for the shield text. + +------------ + + +shield-unlock-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(text alignment relative to the shield image uses the center of the image as the anchor for text positioning.)* + +This parameter should be set to true if you are trying to position text beside rather than on top of the shield image. + +------------ + + +shield-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 +*(Font size of 10 will be used to render text.)* + +The size of the shield text in pixels. + +------------ + + +shield-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black +*(The shield text will be rendered black.)* + +The color of the shield text. + +------------ + + +shield-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` + + +Default Value: point +*(One shield will be placed per geometry.)* + +How this shield should be placed. Point placement places one shield on top of a point geometry and at the centroid of a polygon or the middle point of a line, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of a polygon. + +------------ + + +shield-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Shields will be potentially placed near tile edges and therefore may look cut off unless they are rendered on each adjacent tile.)* + +Avoid placing shields that intersect with tile boundaries. + +------------ + + +shield-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow shields to overlap with other map elements already placed.)* + +Control whether overlapping shields are shown or hidden. + +------------ + + +shield-margin +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No extra margin will be used to determine if a shield collides with any other text, shield, or marker.)* + +Minimum distance that a shield can be placed from any other text, shield, or marker. + +------------ + + +shield-repeat-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Shields with the same text will be rendered without restriction.)* + +Minimum distance between repeated shields. If set this will prevent shields being rendered nearby each other that contain the same text. Similar to shield-min-distance with the difference that it works the same no matter what placement strategy is used. + +------------ + + +shield-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + +**Status: deprecated** + + + + + +Default Value: 0 +*(Shields with the same text will be rendered without restriction.)* + +Minimum distance to any other collision object. Deprecated: replaced by ``text-margin``. + +------------ + + +shield-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Only one shield per line will attempt to be placed.)* + +Distance the renderer should use to try to place repeated shields on a line. + +------------ + + +shield-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No margin will be used to detect if a shield is nearby a tile boundary.)* + +Minimum distance a shield will be placed from the edge of a tile. This option is similar to shield-avoid-edges:true except that the extra margin is used to discard cases where the shield+margin are not fully inside the tile. + +------------ + + +shield-label-position-tolerance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: shield-spacing/2.0 +*(If a shield cannot be placed then the renderer will advance by shield-spacing/2.0 to try placement again.)* + +Allows the shield to be displaced from its ideal position by a number of pixels (only works with placement:line). + +------------ + + +shield-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 +*(Text will not be wrapped.)* + +Length of a chunk of text in pixels before wrapping text. If set to zero, text doesn't wrap. + +------------ + + +shield-wrap-before +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Wrapped lines will be a bit longer than wrap-width.)* + +Wrap text before wrap-width is reached. + +------------ + + +shield-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: " " +*(Lines will be wrapped conforming to the (untailored) Unicode Line Break Algorithm provided by ICU BreakIterator.)* + +Must be a single character. If you set it to other than the space character, Mapnik will wrap strictly on that character without involving any additional rules. + +------------ + + +shield-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: white +*(The shield halo text will be rendered white.)* + +Specifies the color of the halo around the text. + +------------ + + +shield-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo.)* + +Specify the radius of the halo in pixels. + +------------ + + +shield-halo-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full +*(The shield will be rendered using the highest quality method rather than the fastest.)* + +Exposes an alternate text halo rendering method that sacrifices quality for speed. + +------------ + + +shield-halo-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: +*(No transformation.)* + +Transform shield halo relative to the actual text with specified function. Allows for shadow or embossed effects. Ignores map scale factor. + +------------ + + +shield-halo-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +shield-halo-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque.)* + +A number from 0 to 1 specifying the opacity for the text halo. + +------------ + + +shield-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 +*(The default character spacing of the font will be used.)* + +Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement. + +------------ + + +shield-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(The default font spacing will be used.)* + +Vertical spacing between lines of multiline labels (in pixels). + +------------ + + +shield-text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Text will not be displaced.)* + +Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the shield right. + +------------ + + +shield-text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Text will not be displaced.)* + +Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the shield down. + +------------ + + +shield-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Shield will not be displaced.)* + +Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right. + +------------ + + +shield-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Shield will not be displaced.)* + +Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down. + +------------ + + +shield-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of the image used for the shield. + +------------ + + +shield-text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of the text placed on top of the shield. + +------------ + + +shield-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` + + +Default Value: auto +*(TODO.)* + +The shield's horizontal alignment from its centerpoint. + +------------ + + +shield-vertical-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``top`` ``middle`` ``bottom`` ``auto`` + + +Default Value: middle +*(TODO.)* + +The shield's vertical alignment from its centerpoint. + +------------ + + +shield-placement-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``dummy`` ``simple`` ``list`` + + +Default Value: dummy +*(Alternative placements will not be enabled.)* + +Re-position and/or re-size shield to avoid overlaps. "simple" for basic algorithm (using shield-placements string,) "dummy" to turn this feature off. + +------------ + + +shield-placements +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(No alternative placements will be used.)* + +If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is ``shield-placements: "E,NE,SE,W,NW,SW";``. + +------------ + + +shield-text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` ``reverse`` + + +Default Value: none +*(No text transformation will be applied.)* + +Transform the case of the characters. + +------------ + + +shield-justify-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``center`` ``right`` ``auto`` + + +Default Value: auto +*(TODO.)* + +Define how text in a shield's label is justified. + +------------ + + +shield-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation.)* + +Transform shield instance with specified function. Ignores map scale factor. + +------------ + + +shield-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +shield-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +Simplify the geometries used for shield placement by the given tolerance. + +------------ + + +shield-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +Simplify the geometries used for shield placement by the given algorithm. + +------------ + + +shield-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out the angles of the geometry used for shield placement. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +shield-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +line-pattern +^^^^^^^^^^^^ + +line-pattern +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a line pattern symbolizer rule. + +------------ + + +line-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +An image file to be repeated and warped along a line. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +line-pattern-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +line-pattern-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The image is rendered without modifications.)* + +Apply an opacity level to the image used for the pattern. + +------------ + + +line-pattern-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +geometries are simplified by the given tolerance. + +------------ + + +line-pattern-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +geometries are simplified by the given algorithm. + +------------ + + +line-pattern-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +line-pattern-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(The line will not be offset.)* + +Offsets a line a number of pixels parallel to its actual path. Positive values move the line left, negative values move it right (relative to the directionality of the line). + +------------ + + +line-pattern-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(The geometry will not be transformed.)* + +Transform line geometry with specified function and apply pattern to transformed geometry. + +------------ + + +line-pattern-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation.)* + +Transform line pattern instance with specified function. + +------------ + + +line-pattern-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +polygon-pattern +^^^^^^^^^^^^^^^ + +polygon-pattern +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a polygon pattern symbolizer rule or emitting it with default values. + +------------ + + +polygon-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image to use as a repeated pattern fill within a polygon. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +polygon-pattern-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``global`` ``local`` + + +Default Value: global +*(Patterns will be aligned to the map (or tile boundaries) when being repeated across polygons. This is ideal for seamless patterns in tiled rendering.)* + +Specify whether to align pattern fills to the layer's geometry (local) or to the map (global). + +------------ + + +polygon-pattern-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully antialiased.)* +Range: 0-1 +Level of antialiasing of polygon pattern edges. + +------------ + + +polygon-pattern-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The image is rendered without modifications.)* + +Apply an opacity level to the image used for the pattern. + +------------ + + +polygon-pattern-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +polygon-pattern-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +geometries are simplified by the given tolerance. + +------------ + + +polygon-pattern-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +geometries are simplified by the given algorithm. + +------------ + + +polygon-pattern-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +polygon-pattern-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(The geometry will not be transformed.)* + +Transform polygon geometry with specified function and apply pattern to transformed geometry. + +------------ + + +polygon-pattern-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation.)* + +Transform polygon pattern instance with specified function. + +------------ + + +polygon-pattern-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +raster +^^^^^^ + +raster +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a raster symbolizer rule or emitting it with default values. + +------------ + + +raster-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of the raster symbolizer on top of other symbolizers. + +------------ + + +raster-filter-factor +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: -1 +*(Allow the datasource to choose appropriate downscaling.)* + +This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed. + +------------ + + +raster-scaling +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``near`` ``fast`` ``bilinear`` ``bicubic`` ``spline16`` ``spline36`` ``hanning`` ``hamming`` ``hermite`` ``kaiser`` ``quadric`` ``catrom`` ``gaussian`` ``bessel`` ``mitchell`` ``sinc`` ``lanczos`` ``blackman`` + + +Default Value: near +*(Nearest neighboor resampling will be used to scale the image to the target size of the map.)* + +The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality. + +------------ + + +raster-mesh-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 16 +*(Reprojection mesh will be 1/16 of the resolution of the source image.)* + +A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion. + +------------ + + +raster-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +raster-colorizer-default-mode +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``discrete`` ``linear`` ``exact`` + + +Default Value: linear +*(A linear interpolation is used to generate colors between the two nearest stops.)* + +This can be either ``discrete``, ``linear`` or ``exact``. If it is not specified then the default is ``linear``. + +------------ + + +raster-colorizer-default-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: transparent +*(Pixels that are not colored by the colorizer stops will be transparent.)* + +This can be any color. Sets the color that is applied to all values outside of the range of the colorizer-stops. If not supplied pixels will be fully transparent. + +------------ + + +raster-colorizer-epsilon +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1.1920928955078125e-07 +*(Pixels must very closely match the stop filter otherwise they will not be colored.)* + +This can be any positive floating point value and will be used as a tolerance in floating point comparisions. The higher the value the more likely a stop will match and color data. + +------------ + + +raster-colorizer-stops +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``tags`` + + + + + +Default Value: +*(No colorization will happen without supplying stops.)* + +Assigns raster data values to colors. Stops must be listed in ascending order, and contain at a minimum the value and the associated color. You can also include the color-mode as a third argument, like ``stop(100,#fff,exact)``. + +------------ + + + +point +^^^^^ + +point +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a point symbolizer rule or emitting it with default values. + +------------ + + +point-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none +*(A 4x4 black square will be rendered.)* + +Image file to represent a point. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +point-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow points to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping points are shown or hidden. + +------------ + + +point-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache.)* + +Control whether the placement of the feature will prevent the placement of other features. + +------------ + + +point-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque.)* + +A value from 0 to 1 to control the opacity of the point. + +------------ + + +point-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``centroid`` ``interior`` + + +Default Value: centroid +*(The centroid of the geometry will be used to place the point.)* + +Control how this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon. + +------------ + + +point-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation.)* + +Transform point instance with specified function. Ignores map scale factor. + +------------ + + +point-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +text +^^^^ + +text +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a text symbolizer rule or emitting it with default values. + +------------ + + +text-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: none + + +Value to use for a text label. Data columns are specified using brackets like [column_name]. + +------------ + + +text-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: none + + +Font name and style to render a label in. + +------------ + + +text-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 +*(Font size of 10 will be used to render text.)* + +Text size in pixels. + +------------ + + +text-ratio +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 +*(TODO.)* + +Define the amount of text (of the total) present on successive lines when wrapping occurs. + +------------ + + +text-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 +*(Text will not be wrapped.)* + +Length of a chunk of text in pixels before wrapping text. If set to zero, text doesn't wrap. + +------------ + + +text-wrap-before +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Wrapped lines will be a bit longer than wrap-width.)* + +Wrap text before wrap-width is reached. + +------------ + + +text-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: " " +*(Lines will be wrapped conforming to the (untailored) Unicode Line Break Algorithm provided by ICU BreakIterator.)* + +Must be a single character. If you set it to other than the space character, Mapnik will wrap strictly on that character without involving any additional rules. + +------------ + + +text-repeat-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + +**Status: unstable** + + + + + +Default Value: false +*(Character will be removed when used to wrap a line.)* + +Keep the character used to wrap a line instead of removing it, and repeat it on the new line. + +------------ + + +text-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 +*(Only one label per line will attempt to be placed.)* + +Distance the renderer should use to try to place repeated text labels on a line. + +------------ + + +text-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(The default character spacing of the font will be used.)* + +Horizontal spacing adjustment between characters in pixels. This value is ignored when ``horizontal-alignment`` is set to ``adjust``. Typographic ligatures are turned off when this value is greater than zero. + +------------ + + +text-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(The default font spacing will be used.)* + +Vertical spacing adjustment between lines in pixels. + +------------ + + +text-label-position-tolerance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: text-spacing/2.0 +*(If a shield cannot be placed then the renderer will advance by text-spacing/2.0 to try placement again.)* + +Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line). + +------------ + + +text-max-char-angle-delta +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 22.5 +*(The label will not be placed if a character falls on a line with an angle sharper than 22.5 degrees.)* + +The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners. + +------------ + + +text-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black +*(The text will be rendered black.)* + +Specifies the color for the text. + +------------ + + +text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque.)* + +A number from 0 to 1 specifying the opacity for the text. + +------------ + + +text-halo-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque.)* + +A number from 0 to 1 specifying the opacity for the text halo. + +------------ + + +text-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: white +*(The halo will be rendered white.)* + +Specifies the color of the halo around the text. + +------------ + + +text-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo.)* + +Specify the radius of the halo in pixels. + +------------ + + +text-halo-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full +*(The text will be rendered using the highest quality method rather than the fastest.)* + +Exposes an alternate text halo rendering method that sacrifices quality for speed. + +------------ + + +text-halo-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: +*(No transformation.)* + +Transform text halo relative to the actual text with specified function. Allows for shadow or embossed effects. Ignores map scale factor. + +------------ + + +text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Text will not be displaced.)* + +Displace text by fixed amount, in pixels, +/- along the X axis. With "dummy" placement-type, a positive value displaces to the right. With "simple" placement-type, it is either left, right or unchanged, depending on the placement selected. Any non-zero value implies "horizontal-alignment" changes to "left" by default. Has no effect with 'line' text-placement-type. + +------------ + + +text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Text will not be displaced.)* + +Displace text by fixed amount, in pixels, +/- along the Y axis. With "dummy" placement-type, a positive value displaces downwards. With "simple" placement-type, it is either up, down or unchanged, depending on the placement selected. With "line" placement-type, a positive value displaces above the path. + +------------ + + +text-vertical-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``top`` ``middle`` ``bottom`` ``auto`` + + +Default Value: auto +*(Default affected by value of dy; "top" for dy>0, "bottom" for dy<0.)* + +Position of label relative to point position. + +------------ + + +text-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Text will be potentially placed near tile edges and therefore may look cut off unless the same text label is rendered on each adjacent tile.)* + +Avoid placing labels that intersect with tile boundaries. + +------------ + + +text-margin +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No extra margin will be used to determine if a label collides with any other text, shield, or marker.)* + +Minimum distance that a label can be placed from any other text, shield, or marker. + +------------ + + +text-repeat-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Labels with the same text will be rendered without restriction.)* + +Minimum distance between repeated text. If set this will prevent text labels being rendered nearby each other that contain the same text. Similar to text-min-distance with the difference that it works the same no matter what placement strategy is used. + +------------ + + +text-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + +**Status: deprecated** + + + + + +Default Value: 0 +*(Labels with the same text will be rendered without restriction.)* + +Minimum distance to the next label with the same text. Only works for line placement. Deprecated: replaced by ``text-repeat-distance`` and ``text-margin`` + +------------ + + +text-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No margin will be used to detect if a text label is nearby a tile boundary.)* + +Minimum distance a text label will be placed from the edge of a tile. This option is similar to shield-avoid-edges:true except that the extra margin is used to discard cases where the shield+margin are not fully inside the tile. + +------------ + + +text-min-path-length +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(place labels on all geometries no matter how small they are.)* + +Place labels only on polygons and lines with a bounding width longer than this value (in pixels). + +------------ + + +text-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow text to overlap with other text - overlapping markers will not be shown.)* + +Control whether overlapping text is shown or hidden. + +------------ + + +text-orientation +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Text is not rotated and is displayed upright.)* + +Rotate the text. (only works with text-placement:point). + +------------ + + +text-rotate-displacement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Label center is used for rotation.)* + +Rotates the displacement around the placement origin by the angle given by "orientation". + +------------ + + +text-upright +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``auto`` ``auto-down`` ``left`` ``right`` ``left-only`` ``right-only`` + + +Default Value: auto +*(Text will be positioned upright automatically.)* + +How this label should be placed along lines. By default when more than half of a label's characters are upside down the label is automatically flipped to keep it upright. By changing this parameter you can prevent this "auto-upright" behavior. The "auto-down" value places text in the opposite orientation to "auto". The "left" or "right" settings can be used to force text to always be placed along a line in a given direction and therefore disables flipping if text appears upside down. The "left-only" or "right-only" properties also force a given direction but will discard upside down text rather than trying to flip it. + +------------ + + +text-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` + + +Default Value: point +*(One shield will be placed per geometry.)* + +How this label should be placed. Point placement places one label on top of a point geometry and at the centroid of a polygon or the middle point of a line, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of a polygon. + +------------ + + +text-placement-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``dummy`` ``simple`` ``list`` + + +Default Value: dummy +*(Alternative placements will not be enabled.)* + +Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off. + +------------ + + +text-placements +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(No alternative placements will be used.)* + +If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is ``text-placements: "E,NE,SE,W,NW,SW";``. + +------------ + + +text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` ``reverse`` + + +Default Value: none +*(Transform text instance with specified function. Ignores map scale factor.)* + +Transform the case of the characters. + +------------ + + +text-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` ``adjust`` + + +Default Value: auto +*(TODO.)* + +The text's horizontal alignment from it's centerpoint. If ``placement`` is set to ``line``, then ``adjust`` can be set to auto-fit the text to the length of the path by dynamically calculating ``character-spacing``. + +------------ + + +text-align +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``right`` ``center`` ``auto`` + + +Default Value: auto +*(Auto alignment means that text will be centered by default except when using the ``placement-type`` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the ``text-placements`` directives.)* + +Define how text is justified. + +------------ + + +text-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +text-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +Simplify the geometries used for text placement by the given tolerance. + +------------ + + +text-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +Simplify the geometries used for text placement by the given algorithm. + +------------ + + +text-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out the angles of the geometry used for text placement. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +text-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +text-halo-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +text-font-feature-settings +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(Default set of typographic features recommended by OpenType specification. Ligatures are turned off by default when ``character-spacing`` is greater than zero.)* + +Comma separated list of OpenType typographic features. The syntax and semantics conforms to ``font-feature-settings`` from W3C CSS. + +------------ + + +text-largest-bbox-only +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + +**Status: experimental** + + + + + +Default Value: true +*(For multipolygons only polygon with largest bbox area is labeled (does not apply to other geometries).)* + +Controls default labeling behavior on multipolygons. The default is true and means that only the polygon with largest bbox is labeled. + +------------ + + + +building +^^^^^^^^ + +building +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a building symbolizer rule or emitting it with default values. + +------------ + + +building-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: The color gray will be used for fill. +*(Gray and fully opaque (alpha = 1), same as rgb(128,128,128) or rgba(128,128,128,1).)* + +The color of the buildings fill. Note: 0.8 will be used to multiply each color component to auto-generate a darkened wall color. + +------------ + + +building-fill-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of the building as a whole, including all walls. + +------------ + + +building-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Buildings will not have a visual height and will instead look like flat polygons.)* + +The height of the building in pixels. + +------------ + + + +debug +^^^^^ + +debug-mode +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``collision`` ``vertex`` + + +Default Value: collision +*(The otherwise invisible collision boxes will be rendered as squares on the map.)* + +The mode for debug rendering. + +------------ + + + +dot +^^^ + +dot +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a dot symbolizer rule or emitting it with default values. + +------------ + + +dot-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: gray +*(The dot fill color is gray.)* + +The color of the area of the dot. + +------------ + + +dot-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The opacity of the dot.)* + +The overall opacity of the dot. + +------------ + + +dot-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The marker width is 1 pixel.)* + +The width of the dot in pixels. + +------------ + + +dot-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The marker height is 1 pixels.)* + +The height of the dot in pixels. + +------------ + + +dot-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current layer on top of other layers.)* + +Composite operation. This defines how this layer should behave relative to layers atop or below it. + +------------ + + + + + diff --git a/docs/api/mapnik/3.0.6.rst b/docs/api/mapnik/3.0.6.rst new file mode 100644 index 0000000..ec90fa3 --- /dev/null +++ b/docs/api/mapnik/3.0.6.rst @@ -0,0 +1,3778 @@ +3.0.6 +===== +Style +----- + + + + + +image-filters +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``functions`` + + + +Possible values: ``agg-stack-blur`` ``emboss`` ``blur`` ``gray`` ``sobel`` ``edge-detect`` ``x-gradient`` ``y-gradient`` ``invert`` ``sharpen`` ``color-blind-protanope`` ``color-blind-deuteranope`` ``color-blind-tritanope`` ``colorize-alpha`` ``color-to-alpha`` ``scale-hsla`` + +Default Value: none +*(no filters)* + +A list of image filters that will be applied to the active rendering canvas for a given style. The presence of one more ``image-filters`` will trigger a new canvas to be created before starting to render a style and then this canvas will be composited back into the main canvas after rendering all features and after all ``image-filters`` have been applied. See ``direct-image-filters`` if you want to apply a filter directly to the main canvas. + +------------ + + + +image-filters-inflate +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``boolean`` + + + + + +Default Value: false +*(No special handling will be done and image filters that blur data will only blur up to the edge of a tile boundary)* + +A property that can be set to true to enable using an inflated image internally for seamless blurring across tiles (requires buffered data). + +------------ + + + +direct-image-filters +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``functions`` + + + +Possible values: ``agg-stack-blur`` ``emboss`` ``blur`` ``gray`` ``sobel`` ``edge-detect`` ``x-gradient`` ``y-gradient`` ``invert`` ``sharpen`` ``color-blind-protanope`` ``color-blind-deuteranope`` ``color-blind-tritanope`` ``colorize-alpha`` ``color-to-alpha`` ``scale-hsla`` + +Default Value: none +*(no filters)* + +A list of image filters to apply to the main canvas (see the ``image-filters`` doc for how they work on a separate canvas). + +------------ + + + +comp-op +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(add the current layer on top of other layers)* + +Composite operation. This defines how this layer should behave relative to layers atop or below it. + +------------ + + + +opacity +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: ``float`` + + + + + +Default Value: 1 +*(No separate buffer will be used and no alpha will be applied to the style after rendering.)* + +An alpha value for the style (which means an alpha applied to all features in separate buffer and then composited back to main buffer). + +------------ + + + +Symbolizers +----------- + + +map +^^^ + +background-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: none +*(Will be rendered transparent.)* + +Map Background color. + +------------ + + +background-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: +*(No background image will be used.)* + +An image that is repeated below all features on a map as a background. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +background-image-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(The background-image will be blended with the background normally (placed on top of any existing background-color).)* + +Set the compositing operation used to blend the image into the background. + +------------ + + +background-image-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The image opacity will not be changed when applied to the map background.)* + +Set the opacity of the image. + +------------ + + +srs +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +*(The proj4 literal of EPSG:4326 is assumed to be the Map's spatial reference and all data from layers within this map will be plotted using this coordinate system. If any layers do not declare an srs value then they will be assumed to be in the same srs as the Map and not transformations will be needed to plot them in the Map's coordinate space.)* + +Map spatial reference (proj4 string). + +------------ + + +buffer-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No buffer will be used.)* + +Extra tolerance around the map (in pixels) used to ensure labels crossing tile boundaries are equally rendered in each tile (e.g. cut in each tile). Not intended to be used in combination with "avoid-edges". + +------------ + + +maximum-extent +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: -20037508.34,-20037508.34,20037508.34,20037508.34 +*(All data will be clipped to global mercator extent (default is applied in Carto.js).)* + +An extent to be used to limit the bounds used to query all layers during rendering. Should be minx, miny, maxx, maxy in the coordinates of the Map. + +------------ + + +base +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(This base path defaults to an empty string meaning that any relative paths to files referenced in styles or layers will be interpreted relative to the application process.)* + +Any relative paths used to reference files will be understood as relative to this directory path if the map is loaded from an in memory object rather than from the filesystem. If the map is loaded from the filesystem and this option is not provided it will be set to the directory of the stylesheet. + +------------ + + +font-directory +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none +*(No map-specific fonts will be registered.)* + +Path to a directory which holds fonts which should be registered when the Map is loaded (in addition to any fonts that may be automatically registered). + +------------ + + + +polygon +^^^^^^^ + +polygon +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a polygon symbolizer rule or emitting it with default values. + +------------ + + +polygon-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: rgba(128,128,128,1) +*(Gray and fully opaque (alpha = 1), same as rgb(128,128,128) or rgba(128,128,128,1).)* + +Fill color to assign to a polygon. + +------------ + + +polygon-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of the polygon. + +------------ + + +polygon-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully antialiased.)* +Range: 0-1 +Level of antialiasing of polygon edges. + +------------ + + +polygon-gamma-method +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``power`` ``linear`` ``none`` ``threshold`` ``multiply`` + + +Default Value: power +*(pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA.)* + +An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions. + +------------ + + +polygon-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extend outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +polygon-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +Simplify geometries by the given tolerance. + +------------ + + +polygon-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +Simplify geometries by the given algorithm. + +------------ + + +polygon-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +polygon-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(The geometry will not be transformed.)* + +Transform polygon geometry with specified function. + +------------ + + +polygon-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +line +^^^^ + +line +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a line symbolizer rule or emitting it with default values. + +------------ + + +line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black +*(black and fully opaque (alpha = 1), same as rgb(0,0,0) or rgba(0,0,0,1).)* + +The color of a drawn line. + +------------ + + +line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The line will be rendered 1 pixel wide.)* + +The width of a line in pixels. + +------------ + + +line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of a line. + +------------ + + +line-join +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``miter`` ``miter-revert`` ``round`` ``bevel`` + + +Default Value: miter +*(The line joins will be rendered using a miter look.)* + +The behavior of lines when joining. + +------------ + + +line-cap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``butt`` ``round`` ``square`` + + +Default Value: butt +*(The line endings will be rendered using a butt look.)* + +The display of line endings. + +------------ + + +line-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully antialiased.)* +Range: 0-1 +Level of antialiasing of stroke line. + +------------ + + +line-gamma-method +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``power`` ``linear`` ``none`` ``threshold`` ``multiply`` + + +Default Value: power +*(pow(x,gamma) is used to calculate pixel gamma, which produces slightly smoother line and polygon antialiasing than the 'linear' method, while other methods are usually only used to disable AA.)* + +An Antigrain Geometry specific rendering hint to control the quality of antialiasing. Under the hood in Mapnik this method is used in combination with the 'gamma' value (which defaults to 1). The methods are in the AGG source at https://github.com/mapnik/mapnik/blob/master/deps/agg/include/agg_gamma_functions. + +------------ + + +line-dasharray +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(The line will be drawn without dashes.)* + +A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported for more complex patterns. + +------------ + + +line-dash-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``numbers`` + + + + + +Default Value: none +*(The line will be drawn without dashes.)* + +Valid parameter but not currently used in renderers (only exists for experimental svg support in Mapnik which is not yet enabled). + +------------ + + +line-miterlimit +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 4 +*(Will auto-convert miters to bevel line joins when theta is less than 29 degrees as per the SVG spec: 'miterLength / stroke-width = 1 / sin ( theta / 2 )'.)* + +The limit on the ratio of the miter length to the stroke-width. Used to automatically convert miter joins to bevel joins for sharp angles to avoid the miter extending beyond the thickness of the stroking path. Normally will not need to be set, but a larger value can sometimes help avoid jaggy artifacts. + +------------ + + +line-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +line-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +Simplify geometries by the given tolerance. + +------------ + + +line-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +Simplify geometries by the given algorithm. + +------------ + + +line-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +line-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + +**Status: unstable** + + + + + +Default Value: 0 +*(Will not be offset.)* + +Offsets a line a number of pixels parallel to its actual path. Positive values move the line left, negative values move it right (relative to the directionality of the line). + +------------ + + +line-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full +*(The line will be rendered using the highest quality method rather than the fastest.)* + +Exposes an alternate AGG rendering method that sacrifices some accuracy for speed. + +------------ + + +line-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(The geometry will not be transformed.)* + +Transform line geometry with specified function. + +------------ + + +line-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +markers +^^^^^^^ + +marker +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a marker symbolizer rule or emitting it with default values. + +------------ + + +marker-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none +*(An ellipse or circle, if width equals height.)* + +A file that this marker shows at each placement. If no file is given, the marker will show an ellipse. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +marker-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The stroke-opacity and fill-opacity of the marker.)* + +The overall opacity of the marker, if set, overrides both the opacity of the fill and the opacity of the stroke. + +------------ + + +marker-fill-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The fill opacity of the marker. This property will also set the ``fill-opacity`` of elements in an SVG loaded from a file. + +------------ + + +marker-line-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black +*(The marker will be drawn with a black outline.)* + +The color of the stroke around the marker. This property will also set the ``stroke`` of elements in an SVG loaded from a file. + +------------ + + +marker-line-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.5 +*(The marker will be drawn with an outline of .5 pixels wide.)* + +The width of the stroke around the marker, in pixels. This is positioned on the boundary, so high values can cover the area itself. This property will also set the ``stroke-width`` of elements in an SVG loaded from a file. + +------------ + + +marker-line-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque. This property will also set the ``stroke-opacity`` of elements in an SVG loaded from a file.)* + +The opacity of a line. + +------------ + + +marker-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``interior`` ``vertex-first`` ``vertex-last`` + + +Default Value: point +*(Place markers at the center point (centroid) of the geometry.)* + +Attempt to place markers on a point, in the center of a polygon, or if markers-placement:line, then multiple times along a line. 'interior' placement can be used to ensure that points placed on polygons are forced to be inside the polygon interior. The 'vertex-first' and 'vertex-last' options can be used to place markers at the first or last vertex of lines or polygons. + +------------ + + +marker-multi-policy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``each`` ``whole`` ``largest`` + + +Default Value: each +*(If a feature contains multiple geometries and the placement type is either point or interior then a marker will be rendered for each.)* + +A special setting to allow the user to control rendering behavior for 'multi-geometries' (when a feature contains multiple geometries). This setting does not apply to markers placed along lines. The 'each' policy is default and means all geometries will get a marker. The 'whole' policy means that the aggregate centroid between all geometries will be used. The 'largest' policy means that only the largest (by bounding box areas) feature will get a rendered marker (this is how text labeling behaves by default). + +------------ + + +marker-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: deprecated** + + +Possible values: ``arrow`` ``ellipse`` + + +Default Value: ellipse +*(The marker shape is an ellipse.)* + +The default marker-type. If a SVG file is not given as the marker-file parameter, the renderer provides either an arrow or an ellipse (a circle if height is equal to width). + +------------ + + +marker-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 +*(The marker width is 10 pixels.)* + +The width of the marker, if using one of the default types. + +------------ + + +marker-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 +*(The marker height is 10 pixels.)* + +The height of the marker, if using one of the default types. + +------------ + + +marker-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: blue +*(The marker fill color is blue.)* + +The color of the area of the marker. This property will also set the ``fill`` of elements in an SVG loaded from a file. + +------------ + + +marker-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow markers to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping markers are shown or hidden. + +------------ + + +marker-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Markers will be potentially placed near tile edges and therefore may look cut off unless they are rendered on each adjacent tile.)* + +Avoid placing markers that intersect with tile boundaries. + +------------ + + +marker-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache.)* + +Value to control whether the placement of the feature will prevent the placement of other features. + +------------ + + +marker-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 100 +*(In the case of marker-placement:line then draw a marker every 100 pixels along a line.)* + +Space between repeated markers in pixels. If the spacing is less than the marker size or larger than the line segment length then no marker will be placed. Any value less than 1 will be ignored and the default will be used instead. + +------------ + + +marker-max-error +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0.2 +*(N/A: not intended to be changed.)* + +N/A: not intended to be changed. + +------------ + + +marker-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation.)* + +Transform marker instance with specified function. Ignores map scale factor. + +------------ + + +marker-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +marker-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Geometry will not be simplified.)* + +geometries are simplified by the given tolerance. + +------------ + + +marker-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +geometries are simplified by the given algorithm. + +------------ + + +marker-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +marker-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(The geometry will not be transformed.)* + +Transform marker geometry with specified function. + +------------ + + +marker-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Will not be offset.)* + +Offsets a marker from a line a number of pixels parallel to its actual path. Positive values move the marker left, negative values move it right (relative to the directionality of the line). + +------------ + + +marker-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +marker-direction +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``auto`` ``auto-down`` ``left`` ``right`` ``left-only`` ``right-only`` ``up`` ``down`` + + +Default Value: right +*(Markers are oriented to the right in the line direction.)* + +How markers should be placed along lines. With the "auto" setting when marker is upside down the marker is automatically rotated by 180 degrees to keep it upright. The "auto-down" value places marker in the opposite orientation to "auto". The "left" or "right" settings can be used to force marker to always be placed along a line in a given direction and therefore disables rotating if marker appears upside down. The "left-only" or "right-only" properties also force a given direction but will discard upside down markers rather than trying to flip it. The "up" and "down" settings don't adjust marker's orientation to the line direction. + +------------ + + + +shield +^^^^^^ + +shield +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a shield symbolizer rule. + +------------ + + +shield-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(No text label will be rendered with the shield.)* + +Value to use for a shield"s text label. Data columns are specified using brackets like [column_name]. + +------------ + + +shield-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image file to render behind the shield text. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +shield-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: none + + +Font name and style to use for the shield text. + +------------ + + +shield-unlock-image +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(text alignment relative to the shield image uses the center of the image as the anchor for text positioning.)* + +This parameter should be set to true if you are trying to position text beside rather than on top of the shield image. + +------------ + + +shield-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 +*(Font size of 10 will be used to render text.)* + +The size of the shield text in pixels. + +------------ + + +shield-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black +*(The shield text will be rendered black.)* + +The color of the shield text. + +------------ + + +shield-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` + + +Default Value: point +*(One shield will be placed per geometry.)* + +How this shield should be placed. Point placement places one shield on top of a point geometry and at the centroid of a polygon or the middle point of a line, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of a polygon. + +------------ + + +shield-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Shields will be potentially placed near tile edges and therefore may look cut off unless they are rendered on each adjacent tile.)* + +Avoid placing shields that intersect with tile boundaries. + +------------ + + +shield-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow shields to overlap with other map elements already placed.)* + +Control whether overlapping shields are shown or hidden. + +------------ + + +shield-margin +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No extra margin will be used to determine if a shield collides with any other text, shield, or marker.)* + +Minimum distance that a shield can be placed from any other text, shield, or marker. + +------------ + + +shield-repeat-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Shields with the same text will be rendered without restriction.)* + +Minimum distance between repeated shields. If set this will prevent shields being rendered nearby each other that contain the same text. Similar to shield-min-distance with the difference that it works the same no matter what placement strategy is used. + +------------ + + +shield-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + +**Status: deprecated** + + + + + +Default Value: 0 +*(Shields with the same text will be rendered without restriction.)* + +Minimum distance to any other collision object. Deprecated: replaced by ``text-margin``. + +------------ + + +shield-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Only one shield per line will attempt to be placed.)* + +Distance the renderer should use to try to place repeated shields on a line. + +------------ + + +shield-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No margin will be used to detect if a shield is nearby a tile boundary.)* + +Minimum distance a shield will be placed from the edge of a tile. This option is similar to shield-avoid-edges:true except that the extra margin is used to discard cases where the shield+margin are not fully inside the tile. + +------------ + + +shield-label-position-tolerance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: shield-spacing/2.0 +*(If a shield cannot be placed then the renderer will advance by shield-spacing/2.0 to try placement again.)* + +Allows the shield to be displaced from its ideal position by a number of pixels (only works with placement:line). + +------------ + + +shield-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 +*(Text will not be wrapped.)* + +Length of a chunk of text in pixels before wrapping text. If set to zero, text doesn't wrap. + +------------ + + +shield-wrap-before +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Wrapped lines will be a bit longer than wrap-width.)* + +Wrap text before wrap-width is reached. + +------------ + + +shield-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: " " +*(Lines will be wrapped conforming to the (untailored) Unicode Line Break Algorithm provided by ICU BreakIterator.)* + +Must be a single character. If you set it to other than the space character, Mapnik will wrap strictly on that character without involving any additional rules. + +------------ + + +shield-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: white +*(The shield halo text will be rendered white.)* + +Specifies the color of the halo around the text. + +------------ + + +shield-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo.)* + +Specify the radius of the halo in pixels. + +------------ + + +shield-halo-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full +*(The shield will be rendered using the highest quality method rather than the fastest.)* + +Exposes an alternate text halo rendering method that sacrifices quality for speed. + +------------ + + +shield-halo-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: +*(No transformation.)* + +Transform shield halo relative to the actual text with specified function. Allows for shadow or embossed effects. Ignores map scale factor. + +------------ + + +shield-halo-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +shield-halo-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque.)* + +A number from 0 to 1 specifying the opacity for the text halo. + +------------ + + +shield-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 +*(The default character spacing of the font will be used.)* + +Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement. + +------------ + + +shield-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(The default font spacing will be used.)* + +Vertical spacing between lines of multiline labels (in pixels). + +------------ + + +shield-text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Text will not be displaced.)* + +Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the shield right. + +------------ + + +shield-text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Text will not be displaced.)* + +Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the shield down. + +------------ + + +shield-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Shield will not be displaced.)* + +Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right. + +------------ + + +shield-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Shield will not be displaced.)* + +Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down. + +------------ + + +shield-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of the image used for the shield. + +------------ + + +shield-text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of the text placed on top of the shield. + +------------ + + +shield-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` + + +Default Value: auto +*(TODO.)* + +The shield's horizontal alignment from its centerpoint. + +------------ + + +shield-vertical-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``top`` ``middle`` ``bottom`` ``auto`` + + +Default Value: middle +*(TODO.)* + +The shield's vertical alignment from its centerpoint. + +------------ + + +shield-placement-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``dummy`` ``simple`` ``list`` + + +Default Value: dummy +*(Alternative placements will not be enabled.)* + +Re-position and/or re-size shield to avoid overlaps. "simple" for basic algorithm (using shield-placements string,) "dummy" to turn this feature off. + +------------ + + +shield-placements +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(No alternative placements will be used.)* + +If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is ``shield-placements: "E,NE,SE,W,NW,SW";``. + +------------ + + +shield-text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` ``reverse`` + + +Default Value: none +*(No text transformation will be applied.)* + +Transform the case of the characters. + +------------ + + +shield-justify-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``center`` ``right`` ``auto`` + + +Default Value: auto +*(TODO.)* + +Define how text in a shield's label is justified. + +------------ + + +shield-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation.)* + +Transform shield instance with specified function. Ignores map scale factor. + +------------ + + +shield-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +shield-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +Simplify the geometries used for shield placement by the given tolerance. + +------------ + + +shield-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +Simplify the geometries used for shield placement by the given algorithm. + +------------ + + +shield-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out the angles of the geometry used for shield placement. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +shield-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +line-pattern +^^^^^^^^^^^^ + +line-pattern +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a line pattern symbolizer rule or emitting it with default values. + +------------ + + +line-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +An image file to be repeated and warped along a line. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +line-pattern-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +line-pattern-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The image is rendered without modifications.)* + +Apply an opacity level to the image used for the pattern. + +------------ + + +line-pattern-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +geometries are simplified by the given tolerance. + +------------ + + +line-pattern-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +geometries are simplified by the given algorithm. + +------------ + + +line-pattern-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +line-pattern-offset +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(The line will not be offset.)* + +Offsets a line a number of pixels parallel to its actual path. Positive values move the line left, negative values move it right (relative to the directionality of the line). + +------------ + + +line-pattern-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(The geometry will not be transformed.)* + +Transform line geometry with specified function and apply pattern to transformed geometry. + +------------ + + +line-pattern-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation.)* + +Transform line pattern instance with specified function. + +------------ + + +line-pattern-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +polygon-pattern +^^^^^^^^^^^^^^^ + +polygon-pattern +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a polygon pattern symbolizer rule or emitting it with default values. + +------------ + + +polygon-pattern-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none + + +Image to use as a repeated pattern fill within a polygon. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +polygon-pattern-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``global`` ``local`` + + +Default Value: global +*(Patterns will be aligned to the map (or tile boundaries) when being repeated across polygons. This is ideal for seamless patterns in tiled rendering.)* + +Specify whether to align pattern fills to the layer's geometry (local) or to the map (global). + +------------ + + +polygon-pattern-gamma +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully antialiased.)* +Range: 0-1 +Level of antialiasing of polygon pattern edges. + +------------ + + +polygon-pattern-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The image is rendered without modifications.)* + +Apply an opacity level to the image used for the pattern. + +------------ + + +polygon-pattern-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +polygon-pattern-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +geometries are simplified by the given tolerance. + +------------ + + +polygon-pattern-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +geometries are simplified by the given algorithm. + +------------ + + +polygon-pattern-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out geometry angles. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +polygon-pattern-geometry-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(The geometry will not be transformed.)* + +Transform polygon geometry with specified function and apply pattern to transformed geometry. + +------------ + + +polygon-pattern-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation.)* + +Transform polygon pattern instance with specified function. + +------------ + + +polygon-pattern-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +raster +^^^^^^ + +raster +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a raster symbolizer rule or emitting it with default values. + +------------ + + +raster-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of the raster symbolizer on top of other symbolizers. + +------------ + + +raster-filter-factor +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: -1 +*(Allow the datasource to choose appropriate downscaling.)* + +This is used by the Raster or Gdal datasources to pre-downscale images using overviews. Higher numbers can sometimes cause much better scaled image output, at the cost of speed. + +------------ + + +raster-scaling +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``near`` ``fast`` ``bilinear`` ``bicubic`` ``spline16`` ``spline36`` ``hanning`` ``hamming`` ``hermite`` ``kaiser`` ``quadric`` ``catrom`` ``gaussian`` ``bessel`` ``mitchell`` ``sinc`` ``lanczos`` ``blackman`` + + +Default Value: near +*(Nearest neighboor resampling will be used to scale the image to the target size of the map.)* + +The scaling algorithm used to making different resolution versions of this raster layer. Bilinear is a good compromise between speed and accuracy, while lanczos gives the highest quality. + +------------ + + +raster-mesh-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 16 +*(Reprojection mesh will be 1/16 of the resolution of the source image.)* + +A reduced resolution mesh is used for raster reprojection, and the total image size is divided by the mesh-size to determine the quality of that mesh. Values for mesh-size larger than the default will result in faster reprojection but might lead to distortion. + +------------ + + +raster-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +raster-colorizer-default-mode +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``discrete`` ``linear`` ``exact`` + + +Default Value: linear +*(A linear interpolation is used to generate colors between the two nearest stops.)* + +This can be either ``discrete``, ``linear`` or ``exact``. If it is not specified then the default is ``linear``. + +------------ + + +raster-colorizer-default-color +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: transparent +*(Pixels that are not colored by the colorizer stops will be transparent.)* + +This can be any color. Sets the color that is applied to all values outside of the range of the colorizer-stops. If not supplied pixels will be fully transparent. + +------------ + + +raster-colorizer-epsilon +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1.1920928955078125e-07 +*(Pixels must very closely match the stop filter otherwise they will not be colored.)* + +This can be any positive floating point value and will be used as a tolerance in floating point comparisions. The higher the value the more likely a stop will match and color data. + +------------ + + +raster-colorizer-stops +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``tags`` + + + + + +Default Value: +*(No colorization will happen without supplying stops.)* + +Assigns raster data values to colors. Stops must be listed in ascending order, and contain at a minimum the value and the associated color. You can also include the color-mode as a third argument, like ``stop(100,#fff,exact)``. + +------------ + + + +point +^^^^^ + +point +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a point symbolizer rule or emitting it with default values. + +------------ + + +point-file +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``uri`` + + + + + +Default Value: none +*(A 4x4 black square will be rendered.)* + +Image file to represent a point. Accepted formats: svg, jpg, png, tiff, and webp. + +------------ + + +point-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow points to overlap with each other - overlapping markers will not be shown.)* + +Control whether overlapping points are shown or hidden. + +------------ + + +point-ignore-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(do not store the bbox of this geometry in the collision detector cache.)* + +Control whether the placement of the feature will prevent the placement of other features. + +------------ + + +point-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque.)* + +A value from 0 to 1 to control the opacity of the point. + +------------ + + +point-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``centroid`` ``interior`` + + +Default Value: centroid +*(The centroid of the geometry will be used to place the point.)* + +Control how this point should be placed. Centroid calculates the geometric center of a polygon, which can be outside of it, while interior always places inside of a polygon. + +------------ + + +point-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: none +*(No transformation.)* + +Transform point instance with specified function. Ignores map scale factor. + +------------ + + +point-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + + +text +^^^^ + +text +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``none`` + + +Default Value: + + +Allows omitting a text symbolizer rule. + +------------ + + +text-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: none + + +Value to use for a text label. Data columns are specified using brackets like [column_name]. + +------------ + + +text-face-name +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: none + + +Font name and style to render a label in. + +------------ + + +text-size +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 10 +*(Font size of 10 will be used to render text.)* + +Text size in pixels. + +------------ + + +text-ratio +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 +*(TODO.)* + +Define the amount of text (of the total) present on successive lines when wrapping occurs. + +------------ + + +text-wrap-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 +*(Text will not be wrapped.)* + +Length of a chunk of text in pixels before wrapping text. If set to zero, text doesn't wrap. + +------------ + + +text-wrap-before +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Wrapped lines will be a bit longer than wrap-width.)* + +Wrap text before wrap-width is reached. + +------------ + + +text-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: " " +*(Lines will be wrapped conforming to the (untailored) Unicode Line Break Algorithm provided by ICU BreakIterator.)* + +Must be a single character. If you set it to other than the space character, Mapnik will wrap strictly on that character without involving any additional rules. + +------------ + + +text-repeat-wrap-character +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + +**Status: unstable** + + + + + +Default Value: false +*(Character will be removed when used to wrap a line.)* + +Keep the character used to wrap a line instead of removing it, and repeat it on the new line. + +------------ + + +text-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``unsigned`` + + + + + +Default Value: 0 +*(Only one label per line will attempt to be placed.)* + +Distance the renderer should use to try to place repeated text labels on a line. + +------------ + + +text-character-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(The default character spacing of the font will be used.)* + +Horizontal spacing adjustment between characters in pixels. This value is ignored when ``horizontal-alignment`` is set to ``adjust``. Typographic ligatures are turned off when this value is greater than zero. + +------------ + + +text-line-spacing +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(The default font spacing will be used.)* + +Vertical spacing adjustment between lines in pixels. + +------------ + + +text-label-position-tolerance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: text-spacing/2.0 +*(If a shield cannot be placed then the renderer will advance by text-spacing/2.0 to try placement again.)* + +Allows the label to be displaced from its ideal position by a number of pixels (only works with placement:line). + +------------ + + +text-max-char-angle-delta +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 22.5 +*(The label will not be placed if a character falls on a line with an angle sharper than 22.5 degrees.)* + +The maximum angle change, in degrees, allowed between adjacent characters in a label. This value internally is converted to radians to the default is 22.5*math.pi/180.0. The higher the value the fewer labels will be placed around around sharp corners. + +------------ + + +text-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: black +*(The text will be rendered black.)* + +Specifies the color for the text. + +------------ + + +text-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque.)* + +A number from 0 to 1 specifying the opacity for the text. + +------------ + + +text-halo-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Fully opaque.)* + +A number from 0 to 1 specifying the opacity for the text halo. + +------------ + + +text-halo-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: white +*(The halo will be rendered white.)* + +Specifies the color of the halo around the text. + +------------ + + +text-halo-radius +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(no halo.)* + +Specify the radius of the halo in pixels. + +------------ + + +text-halo-rasterizer +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``full`` ``fast`` + + +Default Value: full +*(The text will be rendered using the highest quality method rather than the fastest.)* + +Exposes an alternate text halo rendering method that sacrifices quality for speed. + +------------ + + +text-halo-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``functions`` + + + +Possible values: ``matrix`` ``translate`` ``scale`` ``rotate`` ``skewX`` ``skewY`` + +Default Value: +*(No transformation.)* + +Transform text halo relative to the actual text with specified function. Allows for shadow or embossed effects. Ignores map scale factor. + +------------ + + +text-dx +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Text will not be displaced.)* + +Displace text by fixed amount, in pixels, +/- along the X axis. With "dummy" placement-type, a positive value displaces to the right. With "simple" placement-type, it is either left, right or unchanged, depending on the placement selected. Any non-zero value implies "horizontal-alignment" changes to "left" by default. Has no effect with 'line' text-placement-type. + +------------ + + +text-dy +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Text will not be displaced.)* + +Displace text by fixed amount, in pixels, +/- along the Y axis. With "dummy" placement-type, a positive value displaces downwards. With "simple" placement-type, it is either up, down or unchanged, depending on the placement selected. With "line" placement-type, a positive value displaces above the path. + +------------ + + +text-vertical-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``top`` ``middle`` ``bottom`` ``auto`` + + +Default Value: auto +*(Default affected by value of dy; "top" for dy>0, "bottom" for dy<0.)* + +Position of label relative to point position. + +------------ + + +text-avoid-edges +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Text will be potentially placed near tile edges and therefore may look cut off unless the same text label is rendered on each adjacent tile.)* + +Avoid placing labels that intersect with tile boundaries. + +------------ + + +text-margin +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No extra margin will be used to determine if a label collides with any other text, shield, or marker.)* + +Minimum distance that a label can be placed from any other text, shield, or marker. + +------------ + + +text-repeat-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Labels with the same text will be rendered without restriction.)* + +Minimum distance between repeated text. If set this will prevent text labels being rendered nearby each other that contain the same text. Similar to text-min-distance with the difference that it works the same no matter what placement strategy is used. + +------------ + + +text-min-distance +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + +**Status: deprecated** + + + + + +Default Value: 0 +*(Labels with the same text will be rendered without restriction.)* + +Minimum distance to the next label with the same text. Only works for line placement. Deprecated: replaced by ``text-repeat-distance`` and ``text-margin`` + +------------ + + +text-min-padding +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No margin will be used to detect if a text label is nearby a tile boundary.)* + +Minimum distance a text label will be placed from the edge of a tile. This option is similar to shield-avoid-edges:true except that the extra margin is used to discard cases where the shield+margin are not fully inside the tile. + +------------ + + +text-min-path-length +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(place labels on all geometries no matter how small they are.)* + +Place labels only on polygons and lines with a bounding width longer than this value (in pixels). + +------------ + + +text-allow-overlap +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Do not allow text to overlap with other text - overlapping markers will not be shown.)* + +Control whether overlapping text is shown or hidden. + +------------ + + +text-orientation +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Text is not rotated and is displayed upright.)* + +Rotate the text. (only works with text-placement:point). + +------------ + + +text-rotate-displacement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(Label center is used for rotation.)* + +Rotates the displacement around the placement origin by the angle given by "orientation". + +------------ + + +text-upright +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``auto`` ``auto-down`` ``left`` ``right`` ``left-only`` ``right-only`` + + +Default Value: auto +*(Text will be positioned upright automatically.)* + +How this label should be placed along lines. By default when more than half of a label's characters are upside down the label is automatically flipped to keep it upright. By changing this parameter you can prevent this "auto-upright" behavior. The "auto-down" value places text in the opposite orientation to "auto". The "left" or "right" settings can be used to force text to always be placed along a line in a given direction and therefore disables flipping if text appears upside down. The "left-only" or "right-only" properties also force a given direction but will discard upside down text rather than trying to flip it. + +------------ + + +text-placement +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``point`` ``line`` ``vertex`` ``interior`` + + +Default Value: point +*(One shield will be placed per geometry.)* + +How this label should be placed. Point placement places one label on top of a point geometry and at the centroid of a polygon or the middle point of a line, line places along lines multiple times per feature, vertex places on the vertexes of polygons, and interior attempts to place inside of a polygon. + +------------ + + +text-placement-type +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``dummy`` ``simple`` ``list`` + + +Default Value: dummy +*(Alternative placements will not be enabled.)* + +Re-position and/or re-size text to avoid overlaps. "simple" for basic algorithm (using text-placements string,) "dummy" to turn this feature off. + +------------ + + +text-placements +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(No alternative placements will be used.)* + +If "placement-type" is set to "simple", use this "POSITIONS,[SIZES]" string. An example is ``text-placements: "E,NE,SE,W,NW,SW";``. + +------------ + + +text-transform +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``none`` ``uppercase`` ``lowercase`` ``capitalize`` ``reverse`` + + +Default Value: none +*(Transform text instance with specified function. Ignores map scale factor.)* + +Transform the case of the characters. + +------------ + + +text-horizontal-alignment +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``middle`` ``right`` ``auto`` ``adjust`` + + +Default Value: auto +*(TODO.)* + +The text's horizontal alignment from it's centerpoint. If ``placement`` is set to ``line``, then ``adjust`` can be set to auto-fit the text to the length of the path by dynamically calculating ``character-spacing``. + +------------ + + +text-align +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``left`` ``right`` ``center`` ``auto`` + + +Default Value: auto +*(Auto alignment means that text will be centered by default except when using the ``placement-type`` parameter - in that case either right or left justification will be used automatically depending on where the text could be fit given the ``text-placements`` directives.)* + +Define how text is justified. + +------------ + + +text-clip +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + + + + + +Default Value: false +*(The geometry will not be clipped to map bounds before rendering.)* + +Turning on clipping can help performance in the case that the boundaries of the geometry extent outside of tile extents. But clipping can result in undesirable rendering artifacts in rare cases. + +------------ + + +text-simplify +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(geometry will not be simplified.)* + +Simplify the geometries used for text placement by the given tolerance. + +------------ + + +text-simplify-algorithm +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``radial-distance`` ``zhao-saalfeld`` ``visvalingam-whyatt`` ``douglas-peucker`` + + +Default Value: radial-distance +*(The geometry will be simplified using the radial distance algorithm.)* + +Simplify the geometries used for text placement by the given algorithm. + +------------ + + +text-smooth +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(No smoothing.)* +Range: 0-1 +Smooths out the angles of the geometry used for text placement. 0 is no smoothing, 1 is fully smoothed. Values greater than 1 will produce wild, looping geometries. + +------------ + + +text-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +text-halo-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current symbolizer on top of other symbolizer.)* + +Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it. + +------------ + + +text-font-feature-settings +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``string`` + + + + + +Default Value: +*(Default set of typographic features recommended by OpenType specification. Ligatures are turned off by default when ``character-spacing`` is greater than zero.)* + +Comma separated list of OpenType typographic features. The syntax and semantics conforms to ``font-feature-settings`` from W3C CSS. + +------------ + + +text-largest-bbox-only +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``boolean`` + +**Status: experimental** + + + + + +Default Value: true +*(For multipolygons only polygon with largest bbox area is labeled (does not apply to other geometries).)* + +Controls default labeling behavior on multipolygons. The default is true and means that only the polygon with largest bbox is labeled. + +------------ + + + +building +^^^^^^^^ + +building +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a building symbolizer rule or emitting it with default values. + +------------ + + +building-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: The color gray will be used for fill. +*(Gray and fully opaque (alpha = 1), same as rgb(128,128,128) or rgba(128,128,128,1).)* + +The color of the buildings fill. Note: 0.8 will be used to multiply each color component to auto-generate a darkened wall color. + +------------ + + +building-fill-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(Color is fully opaque.)* + +The opacity of the building as a whole, including all walls. + +------------ + + +building-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 0 +*(Buildings will not have a visual height and will instead look like flat polygons.)* + +The height of the building in pixels. + +------------ + + + +debug +^^^^^ + +debug-mode +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``collision`` ``vertex`` + + +Default Value: collision +*(The otherwise invisible collision boxes will be rendered as squares on the map.)* + +The mode for debug rendering. + +------------ + + + +dot +^^^ + +dot +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + +**Status: unstable** + + +Possible values: ``auto`` ``none`` + + +Default Value: + + +Allows omitting a dot symbolizer rule or emitting it with default values. + +------------ + + +dot-fill +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``color`` + + + + + +Default Value: gray +*(The dot fill color is gray.)* + +The color of the area of the dot. + +------------ + + +dot-opacity +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The opacity of the dot.)* + +The overall opacity of the dot. + +------------ + + +dot-width +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The marker width is 1 pixel.)* + +The width of the dot in pixels. + +------------ + + +dot-height +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``float`` + + + + + +Default Value: 1 +*(The marker height is 1 pixels.)* + +The height of the dot in pixels. + +------------ + + +dot-comp-op +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: ``keyword`` + + +Possible values: ``clear`` ``src`` ``dst`` ``src-over`` ``dst-over`` ``src-in`` ``dst-in`` ``src-out`` ``dst-out`` ``src-atop`` ``dst-atop`` ``xor`` ``plus`` ``minus`` ``multiply`` ``divide`` ``screen`` ``overlay`` ``darken`` ``lighten`` ``color-dodge`` ``color-burn`` ``linear-dodge`` ``linear-burn`` ``hard-light`` ``soft-light`` ``difference`` ``exclusion`` ``contrast`` ``invert`` ``invert-rgb`` ``grain-merge`` ``grain-extract`` ``hue`` ``saturation`` ``color`` ``value`` + + +Default Value: src-over +*(Add the current layer on top of other layers.)* + +Composite operation. This defines how this layer should behave relative to layers atop or below it. + +------------ + + + + + diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..91db25a --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,157 @@ +# -*- coding: utf-8 -*- +# +# carto documentation build configuration file, created by +# sphinx-quickstart on Sun Feb 5 10:57:37 2017. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + +import sphinx_rtd_theme + + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'carto' +copyright = u'2017, Carto contributors' +author = u'Carto contributors' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = u'' +# The full version, including alpha/beta/rc tags. +release = u'' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This patterns also effect to html_static_path and html_extra_path +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = False + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "sphinx_rtd_theme" + +html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + + +# -- Options for HTMLHelp output ------------------------------------------ + +# Output file base name for HTML help builder. +htmlhelp_basename = 'cartodoc' + + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'carto.tex', u'carto Documentation', + u'Carto contributors', 'manual'), +] + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'carto', u'carto Documentation', + [author], 1) +] + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'carto', u'carto Documentation', + author, 'carto', 'One line description of project.', + 'Miscellaneous'), +] diff --git a/docs/generate.js b/docs/generate.js new file mode 100644 index 0000000..5122571 --- /dev/null +++ b/docs/generate.js @@ -0,0 +1,38 @@ +var fs = require('fs'), + path = require('path'), + refs = require('mapnik-reference'), + _ = require('lodash'); + +function tmpl(x) { + return _.template(fs.readFileSync(path.join(__dirname, x), 'utf-8')); +} + +function substituteReSt(str) { + str = str.replace(/\`/g, '``'); + + return str; +} + +var index = tmpl('mapnik_api._'), + table = tmpl('symbolizers._'), + versions = []; + +refs.versions.forEach(function (v) { + var ref = refs.load(v), + output = ''; + + output += v + '\n' + Array(v.length + 1).join('=') + '\n'; + output += table({ + style: ref.style, + symbolizers: ref.symbolizers, + subst: substituteReSt, + _: _ + }); + output += '\n\n'; + + versions.push('.. include:: api/mapnik/' + v + '.rst'); + + fs.writeFileSync(path.join(__dirname, 'api/mapnik/' + v + '.rst'), output); +}); + +fs.writeFileSync(path.join(__dirname, 'mapnik_api.rst'), index({versions: versions.reverse().join('\n')})); diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..9e5dc24 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,19 @@ +######## +CartoCSS +######## + +CartoCSS (short: Carto) is a language for map design. It is similar in syntax to CSS, but builds upon it with specific abilities to +filter map data and by providing things like variables. It targets the `Mapnik renderer `_ and is able to generate Mapnik XML or +a JSON variant of Mapnik XML. It can run from the command line or in the browser by using a bundler like Browserify. + +Carto is an evolution of the `Cascadenik `_ idea and language, with an emphasis on speed and flexibility. + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + installation_usage + language_elements + styling_concepts + mml + mapnik_api diff --git a/docs/installation_usage.rst b/docs/installation_usage.rst new file mode 100644 index 0000000..22c506a --- /dev/null +++ b/docs/installation_usage.rst @@ -0,0 +1,275 @@ +******************** +Installation & Usage +******************** + +Installation +============ + +If you are using a map design application like Kosmtik, Mapbox Studio Classic or Tilemill you already have CartoCSS installed +and might be more interested in the language reference. + +Else you can install the *carto* binary with NPM by running:: + + npm install -g carto + +You should consider using a Node.js version manager like `NVM `_. + +Optionally you may also want to install millstone which is required for resolving data in the same way as Mapbox Studio Classic does:: + + npm install -g millstone + + +Having *millstone* installed specifically enables support for localizing external resources (URLs and local files) referenced in your MML file, +and detecting projections (using `node-srs `_). + +Usage from the command line +=========================== + +Now that Carto is installed you should have a *carto* command line tool available that can be run on a CartoCSS project:: + + carto project.mml > mapnik.xml + +The following command line options are available: + +-a / --api VERSION + Specify Mapnik API version (e.g. --api 3.0.10) (default: latest Mapnik API version) + +-b / --benchmark + Outputs total compile time + +-f / --file + Outputs to the specified file instead of stdout + +-h / --help + Display help message + +-l / --localize + Use millstone to localize resources when loading an MML (default: off) + +-n / --nosymlink + Use absolute paths instead of symlinking files + +-o / --output + Specify output format, possible values are ``mapnik`` and ``json`` (default: ``mapnik``) + +-ppi RESOLUTION + Pixels per inch used to convert m, mm, cm, in, pt, pc to pixels (default: 90.714) + +-q / --quiet + Do not output any warnings (default: off) + +-v / --version + Display version information + +Usage from JavaScript (Carto API) +================================= + +Alternatively, Carto can be used from JavaScript. While you theoretically could +instantiate almost all of the classes the main outward facing stable interfaces +are the ``Renderer`` and the ``MML`` interface. We start with an example and describe +the details afterwards:: + + // defined variables: + // - input (the name or identifier of the file being parsed) + var carto = require('carto'); + + try { + var data = fs.readFileSync(input, 'utf-8'); + var mml = new carto.MML({}); + mml.load(path.dirname(input), data, function (err, data) { + var output = {}; + + if (!err) { + output = new carto.Renderer({ + filename: input + }).render(data); + } + + if (output.msg) { + output.msg.forEach(function (v) { + if (v.type === 'error') { + console.error(carto.Util.getMessageToPrint(v)); + } + else if (v.type === 'warning') { + console.warn(carto.Util.getMessageToPrint(v)); + } + }); + } + + // output content (if no errors) + if (output.data) { + console.log(output.data); + } + }); + } catch (err) { + // program failures + ... + } + +MML +--- + +The MML interface loads and processes a MML file (see :ref:`mml-file-structure` for details). +You instantiate the class with ``carto.MML``. The constructor takes a options object with +the following possible attributes: + +* ``localize`` *boolean* (same as -l / --localize on the command line) - this uses + `millstone `_ to localize stylesheet resources +* ``nosymlink`` *boolean* (same as -n / --nosymlink on the command line) - for millstone, tells + it to use unmodified paths instead of symlinking files + +By calling ``load(basedir, data, callback)`` the MML file is loaded and processed. +This method does not perform reading from a file, so you have to read the contents +of the file yourself and provide it as string to the method via the ``data`` parameter to the +load function. The ``basedir`` parameter is used to resolve stylesheet references. +When the processing is finished the specified ``callback`` function is called, which +has the following signature:: + + function (err, data) {} + +If an error occurred you find the message within ``err`` and ``data`` is ``null``. +When successful you find the processed MML data structure in ``data`` and ``err`` is ``null``. +The structure within ``data`` is excpected by the ``Renderer`` interface's ``render`` method. + +.. note:: If you want to use Carto within the browser you should not use MML loading via ``carto.MML.load``. + Instead you should supply the JSON of the MML including the Stylesheet strings directly to ``carto.Renderer.render``. + +Renderer +-------- + +The Renderer interface performs the parsing and transformation for rendering from +a MML file string (either self loaded or loaded through the MML interface) or from a MSS +file string (without layers). You instantiate the class with ``carto.Renderer``. +The constructor takes a options object with the following possible attributes: + +* ``benchmark`` *boolean* (similar to -b / --benchmark on the command line) - specifies + if carto should run in benchmarking mode +* ``effects`` *array* - a container for side-effects limited to FontSets +* ``filename`` *string* - name of the input file, used to format errors and warnings +* ``outputFormat`` *string [mapnik|json]* (similar to -o / --output on the command line) + - specifies which format the output should have, either Mapnik XML or JSON similar to Mapnik XML +* ``ppi`` *float* (similar to -ppi on the command line) - Pixels per inch used to convert m, mm, cm, in, pt, pc to pixels +* ``quiet`` *boolean* (similar to -q / --quiet on the command line) - if carto should output + warnings or not +* ``reference`` *class* - carto uses a reference to validate input. You can specify your own + which has to adhere to the specification. (see :ref:`reference`) +* ``validationData`` *object* + + * ``fonts`` *array* - a list of fonts that carto should use to validate if used fonts are valid/present + +* ``version`` *string (semver)* (similar to -a / --api on the command line) - specify which + Mapnik API version carto should use + +``carto.Renderer`` offers two methods for actual rendering. You can either use ``render(data)`` or +``renderMSS(data)``. Both accept a string of either a processed MML file or a MSS style fragment. +The ``render`` method produces a full-featured style output while the ``renderMSS`` outputs only +a style fragment. Both return the following object:: + + { + msg: [], + data: '' + } + +If errors or warnings occurred during rendering you will find them in ``msg`` and ``data`` +will be ``null`` (in case of errors). The actual output is found in ``data`` if no errors +occurred. + +Util +---- + +Carto provides a Util class to assist you with e.g. message formatting. Like in the +example you can call ``getMessageToPrint`` with a received message object to output it +nicely formatted as string. + +.. _reference: + +Using a custom reference +------------------------ + +Carto uses a reference to validate input. This reference specifies which rules and functions +are valid and which types a rule can take. It also describes how rules are transformed for +the output. By default carto uses `mapnik-reference `_ +as reference, but you can also use your own. It has to adhere to the following specification:: + + { + versions: [], // array of versions (semver) as strings + latest: '', // latest version (semver) as strings + load: function (version) {} // return data structure for specified version + } + +The data structure returned by ``load`` has to look like this:: + + { + version: '', // version (semver) as string + style: {}, // rules that apply to the style as a whole + layer: {}, // rules that apply to a layer as a whole + symbolizers: {}, // rules that apply to different elements of the renderer, this elements make up the map + colors: {}, // color names and their mapping to RGB values + datasources: {} // possible data sources for the rendering library and their parameters + } + +.. note:: ``datasources`` is not yet used by carto for validation. + +All entries that contain rules are objects where there attributes are named after +a color, symbolizer or rule. ``style`` and ``layer`` have the same inner structure. +Here is an example:: + + { + 'filter-mode': { + type: {}, + doc: '', + 'default-value': '', + 'default-meaning': '' + } + ... + } + +``symbolizer`` first contains the possible symbolizers and then their rules:: + + { + polygon: { + fill: {}, + 'fill-opacity': {} + ... + } + ... + } + +``colors`` maps color names to their RGB values:: + + { + aliceblue: [ 240, 248, 255 ], + antiquewhite: [ 250, 235, 215 ] + ... + } + +``datasources`` is similar to ``symbolizers`` and contains first the possible data sources +and then their possible parameters:: + + { + csv: { + file: {}, + base: {} + ... + } + } + +Rules (all the parts that where specified with ``{}`` with a little preview at ``filter-mode``) +can have several attributes that are evaluated:: + + name: { + css: '', // rule name which is used in CartoCSS + default-meaning: '', // meaning of the default value + default-value: '', // default value of the rule + doc: '', // documentation about the rule + expression: bool, // whether this rule is a expression or not + functions: [], // array of arrays that contain function name and # of params e.g. ["matrix", 6] + range: '', // range of values that are allowed e.g. 0-1 + required: bool, // if this rule is required + status: '[unstable|experimental|deprecated]', // if omitted it means stable + type: '[bbox|boolean|color|float|functions|numbers|string|uri]', // type can also be an array of keywords + } + +.. caution:: Adherence to the specification is not assessed in-depth because that would + be too resource intensive. If you don't adhere to the specification it is quite likely + that you hit runtime errors. diff --git a/docs/language_elements.rst b/docs/language_elements.rst new file mode 100644 index 0000000..d894316 --- /dev/null +++ b/docs/language_elements.rst @@ -0,0 +1,205 @@ +***************** +Language Elements +***************** + +Below is a list of values and an explanation of any expression that can be applied to properties in CartoCSS. + +Color +===== + +CartoCSS accepts a variety of syntaxes for colors - HTML-style hex values, rgb, rgba, hsl, hsla, hsluv, and hsluva. +It also supports the predefined HTML colors names, like `yellow` and `blue`. :: + + #line { + line-color: #ff0; + line-color: #ffff00; + line-color: rgb(255, 255, 0); + line-color: rgba(255, 255, 0, 1); + line-color: hsl(100, 50%, 50%); + line-color: hsla(100, 50%, 50%, 1); + line-color: hsluv(100, 50%, 50%); // same values yield different color than HSL + line-color: hsluva(100, 50%, 50%, 1); + line-color: yellow; + } + +Especially of note is the support for HSL and HSLuv, which can be easier to reason about than RGB. +CartoCSS also includes several color operation functions `borrowed from LessCSS `_:: + + // lighten and darken colors + lighten(#ace, 10%); + darken(#ace, 10%); + + // saturate and desaturate + saturate(#550000, 10%); + desaturate(#00ff00, 10%); + + // increase or decrease the opacity of a color + fadein(#fafafa, 10%); + fadeout(#fefefe, 14%); + + // spin rotates a color around the color wheel by degrees + spin(#ff00ff, 10); + + // mix generates a color in between two other colors. + mix(#fff, #000, 50%); + + // get color components + hue(#ff00ff); + saturation(#ff00ff); + lightness(#ff00ff); + alpha(hsla(100, 50%, 50%, 0.5)); + +These functions all take arguments which can be color variables, literal colors, or the results of other functions operating on colors. +All the above mentioned functions also come in a *functionp*-variant (e.g. ``lightenp``), which force a given color into HSLuv color space. + +Float +===== + +Float is a fancy way of saying 'number'. In CartoCSS, you specify *just a number* - unlike CSS, there are no units, +but everything is specified in pixels. :: + + #line { + line-width: 2; + } + +It's also possible to do simple math with number values:: + + #line { + line-width: 4 / 2; // division + line-width: 4 + 2; // addition + line-width: 4 - 2; // subtraction + line-width: 4 * 2; // multiplication + line-width: 4 % 2; // modulus + } + +URI +=== + +URI is a fancy way of saying URL. When an argument is a URI, you use the same kind of ``url('place.png')`` +notation that you would with HTML. Quotes around the URL aren't required, but are highly recommended. +URIs can be paths to places on your computer, or on the internet. :: + + #markers { + marker-file: url('marker.png'); + } + +String +====== + +A string is basically just text. In the case of CartoCSS, you're going to put it in quotes. Strings can be anything, +though pay attention to the cases of ``text-name`` and ``shield-name`` - they actually will refer to features, +which you refer to by putting them in brackets, as seen in the example below. :: + + #labels { + text-name: "[MY_FIELD]"; + } + +Boolean +======= + +Boolean means yes or no, so it accepts the values ``true`` or ``false``. :: + + #markers { + marker-allow-overlap: true; + } + +Expressions +=========== + +Expressions are statements that can include fields, numbers, and other types in a really flexible way. +You have run into expressions before, in the realm of 'fields', where you'd specify ``"[FIELD]"``, +but expressions allow you to drop the quotes and also do quick addition, division, multiplication, +and concatenation from within CartoCSS syntax. :: + + #buildings { + building-height: [HEIGHT_FIELD] * 10; + } + +Numbers +======= + +Numbers are comma-separated lists of one or more number in a specific order. +They're used in line dash arrays, in which the numbers specify intervals of line, break, and line again. :: + + #disputedboundary { + line-dasharray: 1, 4, 2; + } + +Percentages +=========== + +In CartoCSS, the percentage symbol, ``%`` universally means ``value/100``. +It's meant to be used with ratio-related properties, like opacity rules. + +.. attention:: You should not use percentages as widths, heights, or other properties - unlike CSS, + percentages are not relative to cascaded classes or page size, they're, as stated, + simply the value divided by one hundred. + +In an example:: + + #world { + // this syntax + polygon-opacity: 50%; + + // is equivalent to + polygon-opacity: 0.5; + } + +Functions +========= + +Functions are comma-separated lists of one or more functions. For instance, transforms use the ``functions`` type +to allow for transforms within CartoCSS, which are optionally chainable. :: + + #point { + point-transform: scale(2, 2); + } + +Mapnik Render-Time Variables +============================ + +Mapnik >= 3.0.0 supports variables of the form ``@var``. These can be used from CartoCSS by specifying them as strings. For example:: + + #layer { + line-width: '@zoom'; + } + +For this to have any effect you have to pass the variables to Mapnik at render time in a hashmap of the form ``variable_name:variable_value``. + +Controlling output of symbolizers and symbolizer attributes +=========================================================== + +You can control symbolizer output by using rules that work on the whole symbolizer. E.g. ``line`` works on the +line symbolizer. By using the keywords ``none`` or ``auto`` you can either suppress the symbolizer or output it with +default values. The keyword ``auto`` does not work on shield and text symbolizers because they have attributes without +default values. Here is an example how this works:: + + #layer { + line: none; + line-width: 2; + [feature = 'redfeature'] { + line-color: red; + } + [feature = 'bluefeature'] { + line-color: blue; + } + } + +Without ``line: none`` carto would output a line symbolizer with default values for all features +other than redfeature and bluefeature, that is a black line with width 1. In contrast, you can +quickly output a symbolizer with default value by using ``auto``:: + + #layer { + [feature = 'quickfeature'] { + marker: auto; + } + } + +This outputs a default markers symbolizer for all quickfeature features. + +You can also control the output of individual symbolizer properties by specifying them with the keyword ``none`` e.g. ``line-color: none``. +They will then be removed from the symbolizer thus using their default value +or not using them at all. This does not work or makes sense for all properties like e.g. not for ``text-face-name`` as it does not have a default value. For an overview over properties +where this works or makes sense see `this list `_. +In this case the use of ``none`` and ``auto`` is equivalent. In both cases the default +value will be used as Mapnik uses the default value automatically when the property is not present. diff --git a/docs/mapnik_api._ b/docs/mapnik_api._ new file mode 100644 index 0000000..17d1345 --- /dev/null +++ b/docs/mapnik_api._ @@ -0,0 +1,10 @@ +************************ +Mapnik API documentation +************************ + +The following is a list of properties provided in CartoCSS that you can apply to map elements +when using the Mapnik renderer. Each API version of Mapnik has its own subsection. Pick the one that +applies to the version you are running. If there is no subsection for your specific version the +next older listed version applies to this version. + +<%= versions %> diff --git a/docs/mapnik_api.rst b/docs/mapnik_api.rst new file mode 100644 index 0000000..88d4468 --- /dev/null +++ b/docs/mapnik_api.rst @@ -0,0 +1,20 @@ +************************ +Mapnik API documentation +************************ + +The following is a list of properties provided in CartoCSS that you can apply to map elements +when using the Mapnik renderer. Each API version of Mapnik has its own subsection. Pick the one that +applies to the version you are running. If there is no subsection for your specific version the +next older listed version applies to this version. + +.. include:: api/mapnik/3.0.20.rst +.. include:: api/mapnik/3.0.6.rst +.. include:: api/mapnik/3.0.3.rst +.. include:: api/mapnik/3.0.0.rst +.. include:: api/mapnik/2.3.0.rst +.. include:: api/mapnik/2.2.0.rst +.. include:: api/mapnik/2.1.1.rst +.. include:: api/mapnik/2.1.0.rst +.. include:: api/mapnik/2.0.2.rst +.. include:: api/mapnik/2.0.1.rst +.. include:: api/mapnik/2.0.0.rst diff --git a/docs/mml.rst b/docs/mml.rst new file mode 100644 index 0000000..2a606dd --- /dev/null +++ b/docs/mml.rst @@ -0,0 +1,470 @@ +.. _mml-file-structure: + +MML File Structure +================== + +The MML file (here: Map Markup Language file) is a +`YAML `_ or `JSON `_ +file containing layer definitions and stylesheet references. It is the central +part of a CartoCSS stylesheet. If you generate Mapnik XML from a stylesheet this is +the file you feed to carto and from which and its references the XML is produced. + +You may wonder whether you should use YAML or JSON. Internally, +JSON is used because it is a language that is easy to understand for machines. +YAML is a superset of JSON and is easier to read and write for humans and is also +less verbose. If you edit a stylesheet collaboratively and use version control +YAML might make it easier to resolve version conflicts. Carto fully understands both +forms. + +.. note:: YAML makes it less tedious to specify repeating properties like database + information for PostGIS datasources or extents by using a language feature called + `anchors or aliases `_. + +Properties Overview +------------------- + +What follows is an overview over properties a MML file can have. This list is not +complete. There may be other (also undocumented) options that Mapnik understands. +Simple properties are described here in alphabetical order while more complex +ones get their own section. + +center +^^^^^^ +Type: ``Array`` + +Specifies the initial center coordinates and zoom level of the map. Longitude, latitude and +zoom level in that order. Example (WGS84): ``[-1.28398, 47.08997, 17]`` + +bounds +^^^^^^ +Type: ``Array`` + +Defines a bounding box of the map extent. Lower left coordinates (longitude, latitude) +and upper right coordinates (longitude, latitude) in that order. +Example (WGS84): ``[-179, -80, 179, 80]`` + +description +^^^^^^^^^^^ +Type: ``String`` + +A description for the stylesheet (usually a bit longer than the name) + +format +^^^^^^ +Type: ``Keyword`` + +Possible values: ``png, jpeg, tiff, webp`` + +Specifies the output format Mapnik should use. For more details see the `Mapnik wiki +page on Image IO `_. + +Layer +^^^^^ +Lists all layers used in the project (see :ref:`layer-reference`) + +maxzoom +^^^^^^^ +Type: ``Integer`` + +Specifies the maximum zoom level of the map + +metatile +^^^^^^^^ +Type: ``Integer`` + +Specifies the number of tiles that make up one side of a metatile. For example, +if the number is 2 then the metatile is 2 tiles wide and tall and consists of +4 individual tiles. For efficiency reasons Mapnik generates metatiles before +splitting them into individual tiles. + +minzoom +^^^^^^^ +Type: ``Integer`` + +Specifies the minimum zoom level of the map + +name +^^^^ +Type: ``String`` + +A name for the stylesheet + +_properties +^^^^^^^^^^^ +Type: ``Object`` + +This is the same as the ``properties`` property for layers, but on a global level with +a bit different structure. It is used when you do not specify the layers in the MML +itself but only reference them. This is used in vector tile styles where the style +and the data are separate. + +First specifiy the layer name and then below it specify its properties as you would +do in the ``properties`` property of the specific layer. + +scale +^^^^^ +Type: ``Integer`` + +Specifies pixel scaling for the output. For example, a scale of 2 means that there +are two pixels for each map pixel in the output. + +srs +^^^ +Type: ``String`` + +Specifies the projection used by Mapnik using the `PROJ.4 `_ +format (SRS means `Spatial reference system `_). +The format can be determined by e.g. using `spatialreference.org `_. + +Stylesheet +^^^^^^^^^^ +Lists all styles or style files in the project (see :ref:`stylesheet-reference`) + +.. _layer-reference: + +Layer property +--------------- +Type: ``Array`` + +Beneath this property layer objects are referenced that are the building blocks +of the map style. The order of specification is important as it constitutes +the drawing order of layers used by Mapnik. Layers specified first are drawn first +and those specified later are drawn afterwards. + +Layers have different properties and their data can come from different data sources +such as shape files or relational databases like PostgreSQL/PostGIS. + +A layer object can have the following properties (there may be more that Mapnik +understands, also undocumented ones). + +class +^^^^^ +Type: ``String`` + +One or more classes associated with this layer separated by blanks. In style selectors +a class can be referenced by ``.classname`` if class contains ``classname`` similar to CSS. + +Datasource +^^^^^^^^^^ +Mapnik supports different datasources. Beneath this property you specify the type +of the datasource and additional properties depending on the type. + +Not all possible configuration options for each datasource are listed here. For +further information see the page for the datasource type on the Mapnik Wiki: +e.g. `PostGIS `_, +`PgRaster `_, +`ShapeFile `_, +`GDAL `_, +`OGR `_, +`OsmPlugin `_. + +type +"""" +Type: ``Keyword`` + +Possible values: ``shape, postgis, pgraster, raster, (gdal), (ogr), (osm)`` + +Specifies the format of the data source. Types in parenthesis are *not build +by default* according to the `Mapnik Wiki `_. + +band (gdal, pgraster) +""""""""""""""""""""" +Type: ``Integer`` + +With this property you can request a specific raster band index (1-based). By +specifying `-1` (gdal) / `0` (pgraster) you request to read all bands. + +dbname (postgis, pgraster) +"""""""""""""""""""""""""" +Type: ``String`` + +Specifies the database name of the PostgreSQL database. + +encoding (ogr, postgis, shape) +"""""""""""""""""""""""""""""" +Type: ``String`` + +Specifies the encoding of the database or shapefile e.g. `utf-8` or `latin1`. + +extent (ogr, postgis, pgraster) +""""""""""""""""""""""""""""""" +Type: ``String`` + +Specifies the maximum extent of the geometries or raster data. +Lower left coordinates (longitude, latitude) and upper right coordinates +(longitude, latitude) in that order. By default this is deduced from the +metadata of the table. + +file (gdal, ogr, osm, raster, shape) +"""""""""""""""""""""""""""""""""""" +Type: ``String`` + +Path and file name. + +geometry_field (postgis) +"""""""""""""""""""""""" +Type: ``String`` + +Specifies the name of the column that contains the geometry. Normally this will +be deduced from the query but sometimes it can be necessary to specify it manually +e.g. when there is more than one column with geometry. + +host (postgis, pgraster) +"""""""""""""""""""""""" +Type: ``String`` + +Specifies the hostname of the PostgreSQL database. + +layer (ogr) +""""""""""" +Type: ``String`` + +The name of the layer to display. + +layer_by_index (ogr) +"""""""""""""""""""" +Type: ``Integer`` + +The index of the layer to display (mandatory if no layer name specified). + +layer_by_sql (ogr) +"""""""""""""""""" +Type: ``String`` + +SQL-Statement to execute against the OGR datasource. + +password (postgis, pgraster) +"""""""""""""""""""""""""""" +Type: ``String`` + +Specifies the password for connecting to the PostgreSQL database. + +port (postgis, pgraster) +"""""""""""""""""""""""" +Type: ``String`` + +Specifies the port of the PostgreSQL database. + +raster_field (pgraster) +""""""""""""""""""""""" +Type: ``String`` + +Specifies the name of the column that contains the raster data. Normally this will +be deduced from the query but sometimes it can be necessary to specify it manually +e.g. when there is more than one column with raster data. + +simplify_geometries (postgis) +""""""""""""""""""""""""""""" +Type: ``Boolean`` + +Specify if input vertices should be automatically reduced or not. + +table (postgis, pgraster) +""""""""""""""""""""""""" +Type: ``String`` + +Either the name of the table to fetch or a sub query `(...) AS queryname`. + +user (postgis, pgraster) +"""""""""""""""""""""""" +Type: ``String`` + +Specifies the username for connecting to the PostgreSQL database. + +extent +^^^^^^ +Type: ``Array`` + +Defines a bounding box of the layer extent. Lower left coordinates (longitude, latitude) +and upper right coordinates (longitude, latitude) in that order. +Example (WGS84): ``[-179, -80, 179, 80]`` + +geometry +^^^^^^^^ +Type: ``Keyword`` + +Possible values: ``linestring, point, polygon, raster`` + +Specifies the geometry type for (the datasource of) this layer. + +id +^^ +Type: ``String`` + +A unique identifier for this layer. In style selectors it can be referenced with +``#layerid`` if the id is ``layerid`` similar to CSS. + +properties +^^^^^^^^^^ +Type: ``Object`` + +This property basically adds any sub-property as attribute to the Mapnik layer. So +available values depend greatly on what Mapnik allows. Here is an (incomplete) list: + +abstract +"""""""" +Type: ``String`` + +A short description of this layer (typically longer than the title). + +group-by +"""""""" +Type: ``String`` + +Enables `grouped rendering `_ +for Mapnik by specifying the field of the datasource that should be used for grouping. +Mapnik then renders all styles of the layer for those features that have the same +value for that field before moving on to other features that have different value. + +maxzoom +""""""" +Type: ``Integer`` + +Specifies the zoom level until which the layer is visible. + +minzoom +""""""" +Type: ``Integer`` + +Specifies the zoom level from which the layer is visible. + +status +"""""" +Type: ``Integer`` + +Specifies if the layer is active or not. 0 means inactive or off, 1 means +active or on. + +title +""""" +Type: ``String`` + +The title of this layer. Probably more verbose than the ID. + +srs +^^^ +Type: ``String`` + +Specifies the projection for this layer using the `PROJ.4 `_ +format (SRS means `Spatial reference system `_). +The format can be determined by e.g. using `spatialreference.org `_. + +srs-name +^^^^^^^^ +Type: ``String`` + +The name of this SRS. + +.. _stylesheet-reference: + +Stylesheet property +-------------------- + +Type: ``Array`` + +You have two options to specify the styles. Either you reference MSS files +(here: Map Stylesheet files) or you specify style objects directly. + +Referencing style files +^^^^^^^^^^^^^^^^^^^^^^^ +Here you reference the style files used in an array of paths/file names. Carto +understands relative as well as absolute paths. The order of style references is +normally not important, but re-definition of variables can be affected by the order +of the style files referenced. + +Specifying style objects +^^^^^^^^^^^^^^^^^^^^^^^^ +Internally style file references are transformed into style objects anyway, so you +can also specify them directly. This only makes sense if you generate them +programmatically otherwise the notation could become a bit tedious. You specify +an array of style objects. The order of the objects is normally not important, +but re-definition of variables can be affected by the order of the style objects. + +A style object consists of the following properties. + +id +""" +This is the identifier of the style object. When styles are being read from a +style file this is usually the file name. The property is used when generating +errors or warnings so it is advisable to set something recognizable here. + +data +"""" +This contains the actual style in the form of a string. + +Example +------- +Here is a simple MML file example with two layers (one shapefile and one PostGIS +layer) referencing one style file in YAML format. It has been modified from the +MML file of `openstreetmap-carto `_. :: + + scale: 1 + metatile: 2 + name: Example MML file + description: A example MML file to illustrate its options + bounds: &world + - -180 + - -85.05112877980659 + - 180 + - 85.05112877980659 + center: + - 0 + - 0 + - 4 + format: png + minzoom: 0 + maxzoom: 19 + 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" + + # Various parts to be included later on + _parts: + extents: &extents + extent: *world + srs-name: "900913" + 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" + osm2pgsql: &osm2pgsql + type: "postgis" + dbname: "gis" + key_field: "" + geometry_field: "way" + extent: "-20037508,-20037508,20037508,20037508" + + Stylesheet: + - style_file.mss + Layer: + - id: world + name: world + geometry: polygon + <<: *extents + Datasource: + file: data/simplified-land-polygons-complete-3857/simplified_land_polygons.shp + type: shape + properties: + maxzoom: 9 + - id: landcover-low-zoom + name: landcover-low-zoom + geometry: polygon + <<: *extents + Datasource: + <<: *osm2pgsql + table: |- + (SELECT + way, name, way_pixels, + COALESCE(wetland, landuse, "natural") AS feature + FROM (SELECT + way, COALESCE(name, '') AS name, + ('landuse_' || (CASE WHEN landuse IN ('forest', 'military') THEN landuse ELSE NULL END)) AS landuse, + ('natural_' || (CASE WHEN "natural" IN ('wood', 'sand', 'scree', 'shingle', 'bare_rock') THEN "natural" ELSE NULL END)) AS "natural", + ('wetland_' || (CASE WHEN "natural" IN ('wetland', 'mud') THEN (CASE WHEN "natural" IN ('mud') THEN "natural" ELSE tags->'wetland' END) ELSE NULL END)) AS wetland, + way_area/NULLIF(!pixel_width!::real*!pixel_height!::real,0) AS way_pixels + FROM planet_osm_polygon + WHERE (landuse IN ('forest', 'military') + OR "natural" IN ('wood', 'wetland', 'mud', 'sand', 'scree', 'shingle', 'bare_rock')) + AND way_area > 0.01*!pixel_width!::real*!pixel_height!::real + AND building IS NULL + ORDER BY COALESCE(layer,0), way_area DESC + ) AS features + ) AS landcover_low_zoom + properties: + minzoom: 7 + maxzoom: 9 diff --git a/docs/styling_concepts.rst b/docs/styling_concepts.rst new file mode 100644 index 0000000..1184665 --- /dev/null +++ b/docs/styling_concepts.rst @@ -0,0 +1,141 @@ +Styling Concepts +================ + +Attachments and Instances +------------------------- + +In CSS, a certain object can only have one instance of a property. A ``
`` has a specific border width and color, +rules that match better than others (#id instead of .class) override previous definitions. +CartoCSS acts the same way normally for the sake of familiarity and organization, but Mapnik itself is more powerful. + +Layers in Mapnik can have multiple `borders `_ and multiple copies +of other attributes. This ability is useful in drawing line outlines, like in the case of road borders or 'glow' effects around coasts. +CartoCSS makes this accessible by allowing attachments to styles:: + + #world { + line-color: #fff; + line-width: 3; + } + + #world::outline { + line-color: #000; + line-width: 6; + } + +Attachments are optional. + +While attachments allow creating implicit "layers" with the same data, using **instances** +allows you to create multiple symbolizers in the same style/layer:: + + #roads { + casing/line-width: 6; + casing/line-color: #333; + line-width: 4; + line-color: #666; + } + +This makes Mapnik first draw the line of color #333 with a width of 6, and then immediately afterwards, +it draws the same line again with width 4 and color #666. Contrast that to attachments: +Mapnik would first draw all casings before proceeding to the actual lines. + +Variables & Expressions +----------------------- + +CartoCSS inherits from its basis in `LessCSS `_ some new features in CSS. +One can define variables in stylesheets, and use expressions to modify them. :: + + @mybackground: #2B4D2D; + + Map { + background-color: @mybackground + } + + #world { + polygon-fill: @mybackground + #222; + line-color: darken(@mybackground, 10%); + } + +Nested Styles +------------- + +CartoCSS also inherits nesting of rules from LessCSS. :: + + /* Applies to all layers with .land class */ + .land { + line-color: #ccc; + line-width: 0.5; + polygon-fill: #eee; + /* Applies to #lakes.land */ + #lakes { + polygon-fill: #000; + } + } + +This can be a convenient way to group style changes by zoom level:: + + [zoom > 1] { + /* Applies to all layers at zoom > 1 */ + polygon-gamma: 0.3; + #world { + polygon-fill: #323; + } + #lakes { + polygon-fill: #144; + } + } + +FontSets +-------- + +By defining multiple fonts in a ``text-face-name`` definition, you create `FontSets `_ +in CartoCSS. These are useful for supporting multiple character sets and fallback fonts for distributed styles. + +This CartoCSS code :: + + #world { + text-name: "[NAME]"; + text-size: 11; + text-face-name: "Georgia Regular", "Arial Italic"; + } + +becomes this XML code :: + + + + + + + +Filters +------- + +CartoCSS supports a variety of filter styles: + +Numeric comparisons:: + + #world[population > 100] + #world[population < 100] + #world[population >= 100] + #world[population <= 100] + +General comparisons:: + + #world[population = 100] + #world[population != 100] + + +String comparisons:: + + /* a regular expression over name */ + #world[name =~ "A.*"] + +More complex expressions:: + + #world[[population] % 50 = 0] + #world[[population] * 2 < 1000] diff --git a/docs/symbolizers._ b/docs/symbolizers._ new file mode 100644 index 0000000..a9ddede --- /dev/null +++ b/docs/symbolizers._ @@ -0,0 +1,52 @@ +Style +----- + +<% _(style).each(function(rule, name) { %> +<% if (_.has(rule, 'css')) { %> +<%= rule.css.replace(/\s/g, '') %> +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Type: <% if (_.isArray(rule.type)) { %>``keyword``<% } else { %>``<%= rule.type %>`` <% } %> + +<% if (_.has(rule, 'status')) { %>**Status: <%= rule.status %>** + +<% } %> +<% if (_.isArray(rule.type)) { %>Possible values: <% _(rule.type).each(function(type) { %>``<%= type %>`` <% }); %><% } %> +<% if (rule.type === 'functions' && _.isArray(rule.functions)) { %>Possible values: <% _(rule.functions).each(function(type) { %>``<%= type[0] %>`` <% }); %><% } %> + +<% if (typeof rule['default-value'] !== '') { %>Default Value: <%= rule['default-value'] %><% } %> +<% if (rule['default-meaning']) { %>*(<%= subst(rule['default-meaning']) %>)*<% } %> +<% if (typeof rule['range'] !== 'undefined') { %>Range: <%= '' + rule['range'] %><% } %> +<% if (rule.doc) { %><%= subst(rule.doc) %><% } %> + +------------ +<% } %> +<% }); %> + +Symbolizers +----------- + +<% _(symbolizers).each(function(symbolizer, name) { %> +<%= name %> +<%= Array(name.length + 1).join('^') %> +<% _(symbolizer).filter(function(p) { return p.css; }).each(function(p) { %> +<%= p.css.replace(/\s/g, '') %> +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +Type: <% if (_.isArray(p.type)) { %>``keyword``<% } else { %>``<%= p.type %>`` <% } %> + +<% if (_.has(p, 'status')) { %>**Status: <%= p.status %>** + +<% } %> +<% if (_.isArray(p.type)) { %>Possible values: <% _(p.type).each(function(type) { %>``<%= type %>`` <% }); %><% } %> +<% if (p.type === 'functions' && _.isArray(p.functions)) { %>Possible values: <% _(p.functions).each(function(type) { %>``<%= type[0] %>`` <% }); %><% } %> + +<% if (typeof p['default-value'] !== '') { %>Default Value: <%= p['default-value'] %><% } %> +<% if (p['default-meaning']) { %>*(<%= subst(p['default-meaning']) %>)*<% } %> +<% if (typeof p['range'] !== 'undefined') { %>Range: <%= '' + p['range'] %><% } %> +<% if (p.doc) { %><%= subst(p.doc) %><% } %> + +------------ + +<% }); %> +<% }); %> diff --git a/lib/carto/functions.js b/lib/carto/functions.js new file mode 100644 index 0000000..5b17693 --- /dev/null +++ b/lib/carto/functions.js @@ -0,0 +1,335 @@ +var chroma = require('chroma-js'), + hsluv = require('hsluv'), + _ = require('lodash'); + +(function (tree) { + +tree.functions = { + rgb: function (r, g, b) { + return this.rgba(r, g, b, 1.0); + }, + rgba: function (r, g, b, a) { + var rgb = [r, g, b].map(function (c) { return number(c); }); + a = number(a); + if (rgb.some(isNaN) || isNaN(a)) return null; + + this.rgb[0] = Math.max(0, Math.min(this.rgb[0], 255)); + this.rgb[1] = Math.max(0, Math.min(this.rgb[1], 255)); + this.rgb[2] = Math.max(0, Math.min(this.rgb[2], 255)); + + var hsl = chroma(rgb).hsl(); + if (isNaN(hsl[0])) { + hsl[0] = 0; + } + + return new tree.Color(hsl, a); + }, + // Only require val + stop: function (val) { + var color, mode; + if (arguments.length > 1) color = arguments[1]; + if (arguments.length > 2) mode = arguments[2]; + + return { + is: 'tag', + val: val, + color: color, + mode: mode, + toString: function(env) { + var attr = {}; + + _.set(attr, 'value', val.ev(env).toString()); + if (color) { + _.set(attr, 'color', color.ev(env).toString()); + } + if (mode) { + _.set(attr, 'mode', mode.ev(env).toString()); + } + return { + '_name': 'stop', + '_attributes': attr + }; + } + }; + }, + hsl: function (h, s, l) { + return this.hsla(h, s, l, 1.0); + }, + hsla: function (h, s, l, a) { + var hsl = [h, s, l].map(function (c) { return number(c); }); + a = number(a); + if (hsl.some(isNaN) || isNaN(a)) return null; + + return new tree.Color(hsl, a, false); + }, + hsluv: function (h, s, l) { + return this.hsluva(h, s, l, 1.0); + }, + hsluva: function (h, s, l, a) { + var hsl = [h, s, l].map(function (c) { return number(c); }); + a = number(a); + if (hsl.some(isNaN) || isNaN(a)) return null; + + return new tree.Color(hsl, a, true); + }, + hue: function (color) { + if (!('getComponents' in color)) return null; + var comp = color.getComponents(); + if (comp.perceptual) { + if (!('toStandard' in color)) return null; + color = color.toStandard(); + comp = color.getComponents(); + } + return new tree.Dimension(Math.round(comp.h)); + }, + huep: function (color) { + if (!('getComponents' in color)) return null; + var comp = color.getComponents(); + if (!comp.perceptual) { + if (!('toPerceptual' in color)) return null; + color = color.toPerceptual(); + comp = color.getComponents(); + } + return new tree.Dimension(Math.round(comp.h)); + }, + saturation: function (color) { + if (!('getComponents' in color)) return null; + var comp = color.getComponents(); + if (comp.perceptual) { + if (!('toStandard' in color)) return null; + color = color.toStandard(); + comp = color.getComponents(); + } + return new tree.Dimension(Math.round(comp.s * 100), '%'); + }, + saturationp: function (color) { + if (!('getComponents' in color)) return null; + var comp = color.getComponents(); + if (!comp.perceptual) { + if (!('toPerceptual' in color)) return null; + color = color.toPerceptual(); + comp = color.getComponents(); + } + return new tree.Dimension(Math.round(comp.s * 100), '%'); + }, + lightness: function (color) { + if (!('getComponents' in color)) return null; + var comp = color.getComponents(); + if (comp.perceptual) { + if (!('toStandard' in color)) return null; + color = color.toStandard(); + comp = color.getComponents(); + } + return new tree.Dimension(Math.round(comp.l * 100), '%'); + }, + lightnessp: function (color) { + if (!('getComponents' in color)) return null; + var comp = color.getComponents(); + if (!comp.perceptual) { + if (!('toPerceptual' in color)) return null; + color = color.toPerceptual(); + comp = color.getComponents(); + } + return new tree.Dimension(Math.round(comp.l * 100), '%'); + }, + alpha: function (color) { + if (!('getComponents' in color)) return null; + var comp = color.getComponents(); + return new tree.Dimension(comp.a); + }, + saturate: function (color, amount) { + if (!('getComponents' in color)) return null; + var comp = color.getComponents(); + + comp.s += amount.value / 100; + comp.s = clamp(comp.s); + return new tree.Color([comp.h, comp.s, comp.l], comp.a, comp.perceptual); + }, + saturatep: function (color, amount) { + if (!('toPerceptual' in color)) return null; + return this.saturate(color.toPerceptual(), amount); + }, + desaturate: function (color, amount) { + if (!('getComponents' in color)) return null; + var comp = color.getComponents(); + + comp.s -= amount.value / 100; + comp.s = clamp(comp.s); + return new tree.Color([comp.h, comp.s, comp.l], comp.a, comp.perceptual); + }, + desaturatep: function (color, amount) { + if (!('toPerceptual' in color)) return null; + return this.desaturate(color.toPerceptual(), amount); + }, + lighten: function (color, amount) { + if (!('getComponents' in color)) return null; + var comp = color.getComponents(); + + comp.l += amount.value / 100; + comp.l = clamp(comp.l); + return new tree.Color([comp.h, comp.s, comp.l], comp.a, comp.perceptual); + }, + lightenp: function (color, amount) { + if (!('toPerceptual' in color)) return null; + return this.lighten(color.toPerceptual(), amount); + }, + darken: function (color, amount) { + if (!('getComponents' in color)) return null; + var comp = color.getComponents(); + + comp.l -= amount.value / 100; + comp.l = clamp(comp.l); + return new tree.Color([comp.h, comp.s, comp.l], comp.a, comp.perceptual); + }, + darkenp: function (color, amount) { + if (!('toPerceptual' in color)) return null; + return this.darken(color.toPerceptual(), amount); + }, + fadein: function (color, amount) { + if (!('getComponents' in color)) return null; + var comp = color.getComponents(); + + comp.a += amount.value / 100; + comp.a = clamp(comp.a); + return new tree.Color([comp.h, comp.s, comp.l], comp.a, comp.perceptual); + }, + fadeinp: function (color, amount) { + if (!('toPerceptual' in color)) return null; + return this.fadein(color.toPerceptual(), amount); + }, + fadeout: function (color, amount) { + if (!('getComponents' in color)) return null; + var comp = color.getComponents(); + + comp.a -= amount.value / 100; + comp.a = clamp(comp.a); + return new tree.Color([comp.h, comp.s, comp.l], comp.a, comp.perceptual); + }, + fadeoutp: function (color, amount) { + if (!('toPerceptual' in color)) return null; + return this.fadeout(color.toPerceptual(), amount); + }, + spin: function (color, amount) { + if (!('getComponents' in color)) return null; + var comp = color.getComponents(); + + var hue = (comp.h + amount.value) % 360; + comp.h = hue < 0 ? 360 + hue : hue; + return new tree.Color([comp.h, comp.s, comp.l], comp.a, comp.perceptual); + }, + spinp: function (color, amount) { + if (!('toPerceptual' in color)) return null; + return this.spin(color.toPerceptual(), amount); + }, + replace: function (entity, a, b) { + if (entity.is === 'field') { + return entity.toString + '.replace(' + a.toString() + ', ' + b.toString() + ')'; + } else { + return entity.replace(a, b); + } + }, + mix: function (color1, color2, weight) { + if (!('isPerceptual' in color1) || !('isPerceptual' in color2) + || !('toString' in color1) || !('toString' in color2) + || !('getComponents' in color1) || !('getComponents' in color2)) return null; + + var perceptual = color1.isPerceptual() || color2.isPerceptual(); + + if (color1.isPerceptual() && !color2.isPerceptual()) { + color2 = color2.toPerceptual(); + } + else if (!color1.toPerceptual() && color2.toPerceptual()) { + color1 = color1.toPerceptual(); + } + + var rgb1 = chroma(color1.toString()).rgb(); + var rgb2 = chroma(color2.toString()).rgb(); + + var p = weight.value / 100.0; + var alpha = color1.getComponents().a * p + color2.getComponents().a * (1 - p); + var a = color1.getComponents().a - color2.getComponents().a; + + var w = p * 2 - 1; + var w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0; + var w2 = 1 - w1; + + var rgb = [rgb1[0] * w1 + rgb2[0] * w2, + rgb1[1] * w1 + rgb2[1] * w2, + rgb1[2] * w1 + rgb2[2] * w2]; + + var mix = null; + if (perceptual) { + var normalize = function (x) { + return x / 255; + }; + mix = hsluv.rgbToHsluv(_.map(rgb, normalize)); + mix[1] = mix[1] / 100; + mix[2] = mix[2] / 100; + } + else { + mix = chroma(rgb).hsl(); + } + + return new tree.Color(mix, alpha, perceptual); + }, + greyscale: function (color) { + if (!('getComponents' in color)) return null; + var comp = color.getComponents(); + + comp.s -= 1; + comp.s = clamp(comp.s); + return new tree.Color([comp.h, comp.s, comp.l], comp.a, comp.perceptual); + }, + greyscalep: function (color) { + if (!('toPerceptual' in color)) return null; + return this.greyscale(color.toPerceptual()); + }, + '%': function (quoted /* arg, arg, ...*/) { + var args = Array.prototype.slice.call(arguments, 1), + str = quoted.value; + + for (var i = 0; i < args.length; i++) { + str = str.replace(/%s/, args[i].value) + .replace(/%[da]/, args[i].toString()); + } + str = str.replace(/%%/g, '%'); + return new tree.Quoted(str); + } +}; + +var image_filter_functors = [ + 'emboss', 'blur', 'gray', 'sobel', 'edge-detect', + 'x-gradient', 'y-gradient', 'sharpen']; + +for (var i = 0; i < image_filter_functors.length; i++) { + var f = image_filter_functors[i]; + tree.functions[f] = (function(f) { + return function() { + return new tree.ImageFilter(f); + }; + })(f); +} + +tree.functions['agg-stack-blur'] = function(x, y) { + return new tree.ImageFilter('agg-stack-blur', [x, y]); +}; + +tree.functions['scale-hsla'] = function(h0,h1,s0,s1,l0,l1,a0,a1) { + return new tree.ImageFilter('scale-hsla', [h0,h1,s0,s1,l0,l1,a0,a1]); +}; + +function number(n) { + if (n instanceof tree.Dimension) { + return parseFloat(n.unit == '%' ? n.value / 100 : n.value); + } else if (typeof(n) === 'number') { + return n; + } else { + return NaN; + } +} + +function clamp(val) { + return Math.min(1, Math.max(0, val)); +} + +})(require('./tree')); diff --git a/lib/carto/index.js b/lib/carto/index.js new file mode 100644 index 0000000..3ef97a2 --- /dev/null +++ b/lib/carto/index.js @@ -0,0 +1,106 @@ +var util = require('util'); + + +function getVersion() { + return require('../../package.json').version.split('.'); +} + +var carto = { + version: getVersion(), + Parser: require('./parser').Parser, + Renderer: require('./renderer').Renderer, + MML: require('./mml').MML, + tree: require('./tree'), + Util: require('./util'), + + // @TODO + writeError: function(ctx, options) { + var message = ''; + var extract = ctx.extract; + var error = []; + + options = options || {}; + + if (options.silent) { return; } + + options.indent = options.indent || ''; + + if (!('index' in ctx) || !extract) { + return util.error(options.indent + (ctx.stack || ctx.message)); + } + + if (typeof(extract[0]) === 'string') { + error.push(stylize((ctx.line - 1) + ' ' + extract[0], 'grey')); + } + + if (extract[1] === '' && typeof extract[2] === 'undefined') { + extract[1] = '¶'; + } + error.push(ctx.line + ' ' + extract[1].slice(0, ctx.column) + + stylize(stylize(extract[1][ctx.column], 'bold') + + extract[1].slice(ctx.column + 1), 'yellow')); + + if (typeof(extract[2]) === 'string') { + error.push(stylize((ctx.line + 1) + ' ' + extract[2], 'grey')); + } + error = options.indent + error.join('\n' + options.indent) + '\x1B[0m\n'; + + message = options.indent + message + stylize(ctx.message, 'red'); + if (ctx.filename) (message += stylize(' in ', 'red') + ctx.filename); + + util.error(message, error); + + if (ctx.callLine) { + util.error(stylize('from ', 'red') + (ctx.filename || '')); + util.error(stylize(ctx.callLine, 'grey') + ' ' + ctx.callExtract); + } + if (ctx.stack) { util.error(stylize(ctx.stack, 'red')); } + } +}; + +require('./tree/call'); +require('./tree/color'); +require('./tree/comment'); +require('./tree/definition'); +require('./tree/dimension'); +require('./tree/element'); +require('./tree/expression'); +require('./tree/filterset'); +require('./tree/filter'); +require('./tree/field'); +require('./tree/keyword'); +require('./tree/layer'); +require('./tree/literal'); +require('./tree/operation'); +require('./tree/quoted'); +require('./tree/imagefilter'); +require('./tree/reference'); +require('./tree/rule'); +require('./tree/ruleset'); +require('./tree/selector'); +require('./tree/style'); +require('./tree/url'); +require('./tree/value'); +require('./tree/variable'); +require('./tree/zoom'); +require('./tree/invalid'); +require('./tree/fontset'); + +require('./functions'); + +for (var k in carto) { exports[k] = carto[k]; } + +// Stylize a string +function stylize(str, style) { + var styles = { + 'bold' : [1, 22], + 'inverse' : [7, 27], + 'underline' : [4, 24], + 'yellow' : [33, 39], + 'green' : [32, 39], + 'red' : [31, 39], + 'grey' : [90, 39] + }; + return '\x1B[' + styles[style][0] + 'm' + str + + '\x1B[' + styles[style][1] + 'm'; +} diff --git a/lib/carto/mml.js b/lib/carto/mml.js new file mode 100644 index 0000000..aab6bc9 --- /dev/null +++ b/lib/carto/mml.js @@ -0,0 +1,95 @@ +var path = require('path'), + fs = require('fs'), + _ = require('lodash'), + yaml = require('js-yaml'), + carto = require('./index'), + util = require('./util'); + +carto.MML = function MML(options) { + this.options = options || {}; +}; + +/** + * Load a MML document. + * + * @param {String} basedir base directory of MML document. + * @param {String} data the MML document. + * @param {Callback} callback function to be called when finished loading. + */ +carto.MML.prototype.load = function load(basedir, data, callback) { + var mml = '', + that = this, + env = {}; + + try { + mml = yaml.safeLoad(data); + } catch (err) { + env = {}; + util.error(env, { + message: 'carto: ' + err.message.replace(/^[A-Z]+, /, '') + }); + return callback(env.msg, null); + } + + if (this.options.localize) { + var millstone; + try { + require.resolve('millstone'); + millstone = require('millstone'); + } catch (err) { + env = {}; + util.error(env, { + message: 'carto: Millstone not found, required if localizing stylesheet resources. ' + err.message.replace(/^[A-Z]+, /, '') + }); + return callback(env.msg, null); + } + millstone.resolve({ + mml: mml, + base: basedir, + cache: path.join(basedir, 'cache'), + nosymlink: this.options.nosymlink + }, function (err, data) { + // force drain the millstone download pool now + // to ensure we can exit without waiting + if (that.options.localize && millstone.drainPool) { + millstone.drainPool(function() {}); + } + env = {}; + util.error(env, err); + return callback(env.msg, data); + }); + } else { + if (_.has(mml, 'Stylesheet') && !_.isNil(mml.Stylesheet)) { + mml.Stylesheet = _.castArray(mml.Stylesheet); + for (var i = 0; i < mml.Stylesheet.length; i++) { + var stylesheet = mml.Stylesheet[i]; + if (typeof stylesheet !== 'string') { + mml.Stylesheet[i] = stylesheet; + continue; + } + var mss, + file = path.resolve(basedir, stylesheet); + try { + mss = fs.readFileSync(file, 'utf-8'); + } catch (err) { + env = {}; + util.error(env, { + message: 'Failed to load file ' + file + '.' + }); + return callback(env.msg, null); + } + mml.Stylesheet[i] = { id: stylesheet, data: mss }; + } + return callback(null, mml); + } + else { + env = {}; + util.error(env, { + message: "Expecting a Stylesheet property containing an (array of) stylesheet object(s) of the form { id: 'x', 'data': 'y' }." + }); + return callback(env.msg, null); + } + } +}; + +module.exports = carto; diff --git a/lib/carto/parser.js b/lib/carto/parser.js new file mode 100644 index 0000000..a77c6cf --- /dev/null +++ b/lib/carto/parser.js @@ -0,0 +1,783 @@ +var carto = exports, + tree = require('./tree'), + chroma = require('chroma-js'), + util = require('./util'); + +// Token matching is done with the `$` function, which either takes +// a terminal string or regexp, or a non-terminal function to call. +// It also takes care of moving all the indices forwards. +carto.Parser = function Parser(env) { + var input, // LeSS input string + i, // current index in `input` + j, // current chunk + temp, // temporarily holds a chunk's state, for backtracking + memo, // temporarily holds `i`, when backtracking + chunks, // chunkified input + current, // index of current chunk, in `input` + parser; + + var that = this; + + function save() { + temp = chunks[j]; + memo = i; + current = i; + } + function restore() { + chunks[j] = temp; + i = memo; + current = i; + } + + function sync() { + if (i > current) { + chunks[j] = chunks[j].slice(i - current); + current = i; + } + } + // + // Parse from a token, regexp or string, and move forward if match + // + function $(tok) { + var match, length, c, endIndex; + + // Non-terminal + if (tok instanceof Function) { + return tok.call(parser.parsers); + // Terminal + // Either match a single character in the input, + // or match a regexp in the current chunk (chunk[j]). + } else if (typeof(tok) === 'string') { + match = input.charAt(i) === tok ? tok : null; + length = 1; + sync(); + } else { + sync(); + + match = tok.exec(chunks[j]); + if (match) { + length = match[0].length; + } else { + return null; + } + } + + // The match is confirmed, add the match length to `i`, + // and consume any extra white-space characters (' ' || '\n') + // which come after that. The reason for this is that LeSS's + // grammar is mostly white-space insensitive. + if (match) { + var mem = i += length; + endIndex = i + chunks[j].length - length; + + while (i < endIndex) { + c = input.charCodeAt(i); + if (! (c === 32 || c === 10 || c === 9)) { break; } + i++; + } + chunks[j] = chunks[j].slice(length + (i - mem)); + current = i; + + if (chunks[j].length === 0 && j < chunks.length - 1) { j++; } + + if (typeof(match) === 'string') { + return match; + } else { + return match.length === 1 ? match[0] : match; + } + } + } + + // Same as $(), but don't change the state of the parser, + // just return the match. + function peek(tok) { + if (typeof(tok) === 'string') { + return input.charAt(i) === tok; + } else { + return !!tok.test(chunks[j]); + } + } + + this.env = env = env || {}; + this.env.filename = this.env.filename || null; + this.env.inputs = this.env.inputs || {}; + + // The Parser + parser = { + + // Parse an input string into an abstract syntax tree. + // Throws an error on parse errors. + parse: function(str) { + var root, error = null; + + i = j = current = 0; + chunks = []; + input = str.replace(/\r\n/g, '\n'); + if (env.filename) { + that.env.inputs[env.filename] = input; + } + + // Split the input into chunks. + chunks = (function (chunks) { + var j = 0, + skip = /(?:@\{[\w-]+\}|[^"'`\{\}\/\(\)\\])+/g, + comment = /\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g, + string = /"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'|`((?:[^`]|\\.)*)`/g, + level = 0, + match, + chunk = chunks[0], + inParam; + + for (var i = 0, c, cc; i < input.length;) { + skip.lastIndex = i; + match = skip.exec(input); + if (match) { + if (match.index === i) { + i += match[0].length; + chunk.push(match[0]); + } + } + c = input.charAt(i); + comment.lastIndex = string.lastIndex = i; + + match = string.exec(input) + if (match) { + if (match.index === i) { + i += match[0].length; + chunk.push(match[0]); + continue; + } + } + + if (!inParam && c === '/') { + cc = input.charAt(i + 1); + if (cc === '/' || cc === '*') { + match = comment.exec(input); + if (match) { + if (match.index === i) { + i += match[0].length; + chunk.push(match[0]); + continue; + } + } + } + } + + switch (c) { + case '{': + if (!inParam) { + level ++; + } + else { + inParam = false; + } + chunk.push(c); + break; + case '}': + if (!inParam) { + level --; + chunk.push(c); + chunks[++j] = chunk = []; + } + else { + inParam = false; + chunk.push(c); + } + break; + case '(': + if (!inParam) { + inParam = true; + } + else { + inParam = false; + } + chunk.push(c); + break; + case ')': + if (inParam) { + inParam = false; + } + chunk.push(c); + break; + default: + chunk.push(c); + } + + i++; + } + if (level !== 0) { + error = { + index: i - 1, + message: (level > 0) ? "missing closing `}`" : "missing opening `{`", + filename: env.filename + }; + } + + return chunks.map(function (c) { return c.join(''); }); + })([[]]); + + if (error) { + util.error(env, error); + throw new Error('N/A'); + } + + // Start with the primary rule. + // The whole syntax tree is held under a Ruleset node, + // with the `root` property set to true, so no `{}` are + // output. + root = new tree.Ruleset([], $(this.parsers.primary)); + root.root = true; + + // Get an array of Ruleset objects, flattened + // and sorted according to specificitySort + root.toList = (function() { + return function(env) { + env.frames = env.frames || []; + + + // call populates Invalid-caused errors + var definitions = this.flatten([], [], env); + definitions.sort(specificitySort); + return definitions; + }; + })(); + + // Sort rules by specificity: this function expects selectors to be + // split already. + // + // Written to be used as a .sort(Function); + // argument. + // + // [1, 0, 0, 467] > [0, 0, 1, 520] + var specificitySort = function(a, b) { + var as = a.specificity; + var bs = b.specificity; + + if (as[0] != bs[0]) return bs[0] - as[0]; + if (as[1] != bs[1]) return bs[1] - as[1]; + if (as[2] != bs[2]) return bs[2] - as[2]; + return bs[3] - as[3]; + }; + + return root; + }, + + // Here in, the parsing rules/functions + // + // The basic structure of the syntax tree generated is as follows: + // + // Ruleset -> Rule -> Value -> Expression -> Entity + // + // In general, most rules will try to parse a token with the `$()` function, and if the return + // value is truly, will return a new node, of the relevant type. Sometimes, we need to check + // first, before parsing, that's when we use `peek()`. + parsers: { + // The `primary` rule is the *entry* and *exit* point of the parser. + // The rules here can appear at any level of the parse tree. + // + // The recursive nature of the grammar is an interplay between the `block` + // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule, + // as represented by this simplified grammar: + // + // primary → (ruleset | rule)+ + // ruleset → selector+ block + // block → '{' primary '}' + // + // Only at one point is the primary rule not called from the + // block rule: at the root level. + primary: function() { + var node, root = []; + + while ((node = $(this.rule) || $(this.ruleset) || + $(this.comment)) || + $(/^[\s\n]+/) || (node = $(this.invalid))) { + if (node) root.push(node); + } + return root; + }, + + invalid: function () { + var chunk = $(/^[^;\n]*[;\n]/); + + // To fail gracefully, match everything until a semicolon or linebreak. + if (chunk) { + return new tree.Invalid(chunk, memo, null, env.filename); + } + }, + + // We create a Comment node for CSS comments `/* */`, + // but keep the LeSS comments `//` silent, by just skipping + // over them. + comment: function() { + if (input.charAt(i) !== '/') return; + + var comment = $(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/); + if (input.charAt(i + 1) === '/') { + return new tree.Comment($(/^\/\/.*/), true); + } else if (comment) { + return new tree.Comment(comment); + } + }, + + // Entities are tokens which can be found inside an Expression + entities: { + + // A string, which supports escaping " and ' "milky way" 'he\'s the one!' + quoted: function() { + if (input.charAt(i) !== '"' && input.charAt(i) !== "'") return; + var str = $(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/); + if (str) { + return new tree.Quoted(str[1] || str[2]); + } + }, + + // A reference to a Mapnik field, like [NAME] + // Behind the scenes, this has the same representation, but Carto + // needs to be careful to warn when unsupported operations are used. + field: function() { + if (! $('[')) return; + var field_name = $(/(^[^\]]+)/); + if (! $(']')) return; + if (field_name) return new tree.Field(field_name[1]); + }, + + // This is a comparison operator + comparison: function() { + var str = $(/^=~|=|!=|<=|>=|<|>/); + if (str) { + return str; + } + }, + + // A catch-all word, such as: hard-light + // These can start with either a letter or a dash (-), + // and then contain numbers, underscores, and letters. + keyword: function() { + var k = $(/^[A-Za-z-]+[A-Za-z-0-9_]*/); + if (k) { return new tree.Keyword(k); } + }, + + // A function call like rgb(255, 0, 255) + // The arguments are parsed with the `entities.arguments` parser. + call: function() { + var name, args; + + if (!(name = /^([\w\-]+|%)\(/.exec(chunks[j]))) return; + + name = name[1]; + + if (name === 'url') { + // url() is handled by the url parser instead + return null; + } else { + i += name.length; + } + + $('('); // Parse the '(' and consume whitespace. + + args = $(this.entities['arguments']); + + if (!$(')')) return; + + if (name) { + return new tree.Call(name, args, env.filename, i); + } + }, + // Arguments are comma-separated expressions + 'arguments': function() { + var args = [], arg; + + arg = $(this.expression); + while (arg) { + args.push(arg); + if (! $(',')) { break; } + arg = $(this.expression); + } + + return args; + }, + literal: function() { + return $(this.entities.dimension) || + $(this.entities.keywordcolor) || + $(this.entities.hexcolor) || + $(this.entities.quoted); + }, + + // Parse url() tokens + // + // We use a specific rule for urls, because they don't really behave like + // standard function calls. The difference is that the argument doesn't have + // to be enclosed within a string, so it can't be parsed as an Expression. + url: function() { + var value; + + if (input.charAt(i) !== 'u' || !$(/^url\(/)) return; + value = $(this.entities.quoted) || $(this.entities.variable) || + $(/^[\-\w%@$\/.&=:;#+?~]+/) || ''; + if (! $(')')) { + return new tree.Invalid(value, memo, 'Missing closing ) in URL.', env.filename); + } else { + return new tree.URL((typeof value.value !== 'undefined' || + value instanceof tree.Variable) ? + value : new tree.Quoted(value)); + } + }, + + // A Variable entity, such as `@fink`, in + // + // width: @fink + 2px + // + // We use a different parser for variable definitions, + // see `parsers.variable`. + variable: function() { + var name, index = i; + + if (input.charAt(i) === '@' && (name = $(/^@[\w-]+/))) { + return new tree.Variable(name, index, env.filename); + } + }, + + hexcolor: function() { + var rgb; + if (input.charAt(i) === '#' && (rgb = $(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/))) { + var hsl = chroma(rgb[0]).hsl(); + return new tree.Color(hsl, 1, false); + } + }, + + keywordcolor: function() { + var rgb = chunks[j].match(/^[a-z]+/); + if (rgb && rgb[0] in that.env.ref.data.colors) { + var data = that.env.ref.data.colors[$(/^[a-z]+/)]; + var a = 1; + if (data.length > 3) { + a = data[3]; + } + var hsl = chroma(data.slice(0, 3)).hsl(); + return new tree.Color(hsl, a, false); + } + }, + + // A Dimension, that is, a number and a unit. The only + // unit that has an effect is % + dimension: function() { + var c = input.charCodeAt(i); + if ((c > 57 || c < 45) || c === 47) return; + var value = $(/^(-?\d*\.?\d+(?:[eE][-+]?\d+)?)(\%|\w+)?/); + if (value) { + return new tree.Dimension(value[1], value[2], memo, env.filename); + } + } + }, + + // The variable part of a variable definition. + // Used in the `rule` parser. Like @fink: + variable: function() { + var name; + + if (input.charAt(i) === '@' && (name = $(/^(@[\w-]+)\s*:/))) { + return name[1]; + } + }, + + // Entities are the smallest recognized token, + // and can be found inside a rule's value. + entity: function() { + return $(this.entities.call) || + $(this.entities.literal) || + $(this.entities.field) || + $(this.entities.variable) || + $(this.entities.url) || + $(this.entities.keyword); + }, + + // A Rule terminator. Note that we use `peek()` to check for '}', + // because the `block` rule will be expecting it, but we still need to make sure + // it's there, if ';' was ommitted. + end: function() { + return $(';') || peek('}'); + }, + + // Elements are the building blocks for Selectors. They consist of + // an element name, such as a tag a class, or `*`. + element: function() { + var e = $(/^(?:[.#][\w\-]+|\*|Map)/); + if (e) return new tree.Element(e); + }, + + // Attachments allow adding multiple lines, polygons etc. to an + // object. There can only be one attachment per selector. + attachment: function() { + var s = $(/^::([\w\-]+(?:\/[\w\-]+)*)/); + if (s) return s[1]; + }, + + // Selectors are made out of one or more Elements, see above. + selector: function() { + var a, attachment, + e, elements = [], + f, filters = new tree.Filterset(), + z, zooms = [], + segments = 0, conditions = 0; + + while ( + (e = $(this.element)) || + (z = $(this.zoom)) || + (f = $(this.filter)) || + (a = $(this.attachment)) + ) { + segments++; + if (e) { + elements.push(e); + } else if (z) { + zooms.push(z); + conditions++; + } else if (f) { + var err = filters.add(f); + if (err) { + util.error(env, { + message: err, + index: i - 1, + filename: env.filename + }); + throw new Error('N/A'); + } + conditions++; + } else if (attachment) { + util.error(env, { + message: 'Encountered second attachment name.\n', + index: i - 1, + filename: env.filename + }); + throw new Error('N/A'); + } else { + attachment = a; + } + + var c = input.charAt(i); + if (c === '{' || c === '}' || c === ';' || c === ',') { break; } + } + + if (segments) { + return new tree.Selector(filters, zooms, elements, attachment, conditions, memo); + } + }, + + filter: function() { + save(); + var key, op, val; + if (! $('[')) return; + + if ((key = $(/^[a-zA-Z0-9\-_]+/) || + $(this.entities.quoted) || + $(this.expression) || + $(this.entities.variable) || + $(this.entities.keyword) || + $(this.entities.field))) { + // TODO: remove at 1.0.0 + if (key instanceof tree.Quoted) { + key = new tree.Field(key.toString()); + } + if ((op = $(this.entities.comparison)) && + (val = $(this.expression) || + $(this.entities.quoted) || + $(this.entities.variable) || + $(this.entities.dimension) || + $(this.entities.keyword) || + $(this.entities.field))) { + if (! $(']')) { + util.error(env, { + message: 'Missing closing ] of filter.', + index: memo - 1, + filename: env.filename + }); + throw new Error('N/A'); + } + if (!key.is) key = new tree.Field(key); + return new tree.Filter(key, op, val, memo, env.filename); + } + } + }, + + zoom: function() { + save(); + var op, val; + if ($(/^\[\s*zoom/g) && + (op = $(this.entities.comparison)) && + (val = $(this.entities.variable) || $(this.entities.dimension)) && $(']')) { + return new tree.Zoom(op, val, memo, env.filename); + } else { + // backtrack + restore(); + } + }, + + // The `block` rule is used by `ruleset` + // It's a wrapper around the `primary` rule, with added `{}`. + block: function() { + var content; + + if ($('{') && (content = $(this.primary)) && $('}')) { + return content; + } + }, + + // div, .class, body > p {...} + ruleset: function() { + var selectors = [], s, rules; + save(); + + s = $(this.selector); + while (s) { + selectors.push(s); + while ($(this.comment)) { + // do nothing + } + if (! $(',')) { break; } + while ($(this.comment)) { + // do nothing + } + s = $(this.selector); + } + if (s) { + while ($(this.comment)) { + // do nothing + } + } + + if (selectors.length > 0 && (rules = $(this.block))) { + if (selectors.length === 1 && + selectors[0].elements.length && + selectors[0].elements[0].value === 'Map') { + var rs = new tree.Ruleset(selectors, rules); + rs.isMap = true; + return rs; + } + return new tree.Ruleset(selectors, rules); + } else { + // Backtrack + restore(); + } + }, + + rule: function() { + var name, value, c = input.charAt(i); + save(); + + if (c === '.' || c === '#') { return; } + + if ((name = $(this.variable) || $(this.property))) { + value = $(this.value); + + if (value && $(this.end)) { + return new tree.Rule(env.ref, name, value, memo, env.filename); + } else { + restore(); + } + } + }, + + font: function() { + var value = [], expression = [], e; + + e = $(this.entity); + while (e) { + expression.push(e); + e = $(this.entity); + } + + value.push(new tree.Expression(expression)); + + if ($(',')) { + e = $(this.expression); + while (e) { + value.push(e); + if (! $(',')) { break; } + e = $(this.expression); + } + } + return new tree.Value(value); + }, + + // A Value is a comma-delimited list of Expressions + // In a Rule, a Value represents everything after the `:`, + // and before the `;`. + value: function() { + var e, expressions = []; + + e = $(this.expression); + while (e) { + expressions.push(e); + if (! $(',')) { break; } + e = $(this.expression); + } + + if (expressions.length > 1) { + return new tree.Value(expressions.map(function(e) { + return e.value[0]; + })); + } else if (expressions.length === 1) { + return new tree.Value(expressions); + } + }, + // A sub-expression, contained by parenthensis + sub: function() { + var e; + + if ($('(') && (e = $(this.expression)) && $(')')) { + return e; + } + }, + // This is a misnomer because it actually handles multiplication + // and division. + multiplication: function() { + var m, a, op, operation; + m = $(this.operand); + if (m) { + while ((op = ($('/') || $('*') || $('%'))) && (a = $(this.operand))) { + operation = new tree.Operation(op, [operation || m, a], memo, env.filename); + } + return operation || m; + } + }, + addition: function() { + var m, a, op, operation; + m = $(this.multiplication); + if (m) { + while ((op = $(/^[-+]\s+/) || (input.charAt(i - 1) != ' ' && ($('+') || $('-')))) && + (a = $(this.multiplication))) { + operation = new tree.Operation(op, [operation || m, a], memo, env.filename); + } + return operation || m; + } + }, + + // An operand is anything that can be part of an operation, + // such as a Color, or a Variable + operand: function() { + return $(this.sub) || $(this.entity); + }, + + // Expressions either represent mathematical operations, + // or white-space delimited Entities. @var * 2 + expression: function() { + var e, entities = []; + + e = $(this.addition); + while (e || $(this.entity)) { + entities.push(e); + e = $(this.addition); + } + + if (entities.length > 0) { + return new tree.Expression(entities); + } + }, + property: function() { + var name = $(/^(([a-z][-a-z_0-9]*\/)?\*?-?[-a-z_0-9]+)\s*:/); + if (name) return name[1]; + } + } + }; + return parser; +}; diff --git a/lib/carto/renderer.js b/lib/carto/renderer.js new file mode 100644 index 0000000..1e67483 --- /dev/null +++ b/lib/carto/renderer.js @@ -0,0 +1,662 @@ +var _ = require('lodash'), + carto = require('./index'), + util = require('./util'); + +carto.Renderer = function Renderer(options) { + this.env = {}; + this.options = options || {}; + + // load different reference if given + if (_.has(this.options, 'reference') && !_.isNil(this.options.reference)) { + this.ref = new carto.tree.Reference(this.options.reference); + } + else { + this.ref = new carto.tree.Reference(); + } + + this.options.version = this.options.version || this.ref.getLatest(); + this.options.outputFormat = this.options.outputFormat || 'mapnik'; + + this.env.ref = this.ref; + if (_.has(this.options, 'quiet') && _.isBoolean(this.options.quiet)) { + this.env.quiet = this.options.quiet; + _.unset(this.options.quiet); + } + if (_.has(this.options, 'benchmark') && _.isBoolean(this.options.benchmark)) { + this.env.benchmark = this.options.benchmark; + _.unset(this.options.benchmark); + } + if (_.has(this.options, 'validationData')) { + this.env.validation_data = this.options.validationData; + _.unset(this.options.validationData); + } + if (_.has(this.options, 'ppi')) { + this.env.ppi = this.options.ppi; + _.unset(this.options.ppi); + } + if (_.has(this.options, 'effects')) { + this.env.effects = this.options.effects; + _.unset(this.options.effects); + } + if (_.has(this.options, 'filename')) { + this.env.filename = this.options.filename; + _.unset(this.options.filename); + } +}; + +/** + * Prepare a MSS document (given as an string) into a + * XML Style fragment (mostly useful for debugging) + * + * @param {String} data the mss contents as a string. + */ +carto.Renderer.prototype.renderMSS = function render(data) { + // effects is a container for side-effects, which currently + // are limited to FontSets. + var env = _(this.env).defaults({ + benchmark: false, + validation_data: false, + effects: [], + quiet: false, + }).value(); + + try { + this.ref.setVersion(this.options.version); + } + catch (err) { + util.error(env, { + message: err.message + }); + return { + msg: env.msg, + data: null + }; + } + + // check if given reference is compliant with expectations + if (!this.ref.compliant) { + util.error(env, { + message: 'Could not use the given reference, because it does not adhere to the specification. See the documentation for details.' + }); + return { + msg: env.msg, + data: null + }; + } + + var output = []; + var styles = []; + + try { + + if (env.benchmark) console.time('Parsing MSS'); + var parser = (carto.Parser(env)).parse(data); + if (env.benchmark) console.timeEnd('Parsing MSS'); + + if (env.benchmark) console.time('Rule generation'); + var rule_list = parser.toList(env); + if (env.benchmark) console.timeEnd('Rule generation'); + + if (env.benchmark) console.time('Rule inheritance'); + var rules = inheritDefinitions(rule_list, env); + if (env.benchmark) console.timeEnd('Rule inheritance'); + + if (env.benchmark) console.time('Style sort'); + var sorted = sortStyles(rules); + if (env.benchmark) console.timeEnd('Style sort'); + + if (env.benchmark) console.time('Total Style generation'); + for (var k = 0, rule, style_name; k < sorted.length; k++) { + rule = sorted[k]; + style_name = 'style' + (rule.attachment !== '__default__' ? '-' + rule.attachment : ''); + styles.push(style_name); + var bench_name = '\tStyle "'+style_name+'" (#'+k+') toXML'; + if (env.benchmark) console.time(bench_name); + // env.effects can be modified by this call + output.push(carto.tree.StyleObject(style_name, rule.attachment, rule, env)); + if (env.benchmark) console.timeEnd(bench_name); + } + if (env.benchmark) console.timeEnd('Total Style generation'); + + if (!util.hasErrors(env.msg)) { + switch (this.options.outputFormat) { + case 'json': + output = JSON.stringify(output, null, 2); + break; + case 'mapnik': + default: + output = util.jsonToXML(output); + break; + } + } + else { + output = null; + } + + return { + msg: env.msg, + data: output + }; + } + catch (err) { + // do not swallow program errors + if (err.message !== 'N/A') { + throw err; + } + + return { + msg: env.msg, + data: null + }; + } +}; + +/** + * Prepare a MML document (given as an object) into a + * fully-localized XML file ready for Mapnik consumption + * + * @param {String} m - the JSON file as a string. + */ +carto.Renderer.prototype.render = function render(m) { + // effects is a container for side-effects, which currently + // are limited to FontSets. + var env = _(this.env).defaults({ + benchmark: false, + validation_data: false, + effects: [], + ppi: 90.714, + quiet: false + }).value(); + + try { + this.ref.setVersion(this.options.version); + } + catch (err) { + util.error(env, { + message: err.message + }); + return { + msg: env.msg, + data: null + }; + } + + // check if given reference is compliant with expectations + if (!this.ref.compliant) { + util.error(env, { + message: 'Could not use the given reference, because it does not adhere to the specification. See the documentation for details.' + }); + return { + msg: env.msg, + data: null + }; + } + + var output = []; + var definitions = []; + + function appliesTo(name, classIndex, zoom) { + return function(definition) { + return definition.appliesTo(name, classIndex, zoom); + }; + } + + try { + // Transform stylesheets into definitions. + if (_.has(m, 'Stylesheet') && !_.isNil(m.Stylesheet)) { + m.Stylesheet = _.castArray(m.Stylesheet); + + + definitions = _(m.Stylesheet).chain() + .map(function(s) { + if (_.isString(s) || !_.has(s, 'id') || !_.has(s, 'data') || _.isNil(s.id) || _.isNil(s.data)) { + util.error(env, { + message: "Expecting a stylesheet object of the form { id: 'x', 'data': 'y' } for the Stylesheet property." + }); + throw new Error('N/A'); + } + // Passing the environment from stylesheet to stylesheet, + // allows frames and effects to be maintained. + env = _(env).extend({filename:s.id}).value(); + + var time = +new Date(), + root = (carto.Parser(env)).parse(s.data); + if (env.benchmark) + console.warn('Parsing time: ' + (new Date() - time) + 'ms'); + return root.toList(env); + }) + .flatten() + .value(); + } + + // Iterate through layers and create styles custom-built + // for each of them, and apply those styles to the layers. + var styles, l, classIndex, rules, sorted, matching; + for (var i = 0; i < m.Layer.length; i++) { + l = m.Layer[i]; + styles = []; + + if (_.has(l, 'id')) { + l.layerId = l.id; + } + else { + util.error(env, { + message: 'The id attribute is required for layers.' + }); + + return { + msg: env.msg, + data: null + }; + } + + if (definitions.length > 0) { + classIndex = {}; + + if (env.benchmark) console.warn('processing layer: ' + l.id); + // Classes are given as space-separated alphanumeric strings. + var classes = (l['class'] || '').split(/\s+/g); + for (var j = 0; j < classes.length; j++) { + classIndex[classes[j]] = true; + } + // compile zoom range if given + var zoom = 0, + min = 0, + max = Infinity, + minOrMaxZoom = false; + + if (_.has(l, 'properties')) { + if (_.has(l.properties, 'minzoom') && l.properties.minzoom > 0) { + min = l.properties.minzoom; + minOrMaxZoom = true; + } + if (_.has(l.properties, 'maxzoom') && l.properties.maxzoom <= carto.tree.Zoom.maxZoom) { + max = l.properties.maxzoom; + minOrMaxZoom = true; + } + } + + if (minOrMaxZoom) { + for (var z = 0; z <= carto.tree.Zoom.maxZoom; z++) { + if (z >= min && z <= max) { + zoom |= (1 << z); + } + } + matching = definitions.filter(appliesTo(l.layerId, classIndex, zoom)); + } + else { + matching = definitions.filter(appliesTo(l.layerId, classIndex)); + } + + rules = inheritDefinitions(matching, env); + sorted = sortStyles(rules); + + if (sorted.length == 0) { + util.warning(env, { + message: 'Layer ' + l.layerId + ' has no styles associated with it.' + }); + } + + for (var k = 0, rule, style_name; k < sorted.length; k++) { + rule = foldStyle(sorted[k]); + style_name = l.layerId + (rule.attachment !== '__default__' ? '-' + rule.attachment : ''); + + // env.effects can be modified by this call + var styleObj = carto.tree.StyleObject(style_name, rule.attachment, rule, env); + + if (Object.keys(styleObj).length) { + output.push(styleObj); + styles.push(style_name); + } + } + } + + // if there is a global _properties object for this layer take it into account + if (_.has(m, '_properties') && _.has(m._properties, l.layerId)) { + if (!_.has(l, 'properties')) { + l.properties = {}; + } + var props = {}; + _.assign(props, m._properties[l.layerId], l.properties); + l.properties = props; + } + + output.push(carto.tree.LayerObject(l, styles, this.ref.data['version'])); + } + + if (env.effects.length) { + output = _.concat(env.effects.map(function(e) { + return e.toObject(env); + }), output); + } + + var map_properties = getMapProperties(m, definitions, this.ref.data.symbolizers.map, env); + + if (!util.hasErrors(env.msg)) { + + // Pass TileJSON and other custom parameters through to Mapnik XML. + var parameters = _(m).reduce(function(memo, v, k) { + if (!v && v !== 0) return memo; + + switch (k) { + // Known skippable properties. + case 'srs': + case 'Layer': + case 'Stylesheet': + break; + // Non URL-bound TileJSON properties. + case 'bounds': + case 'center': + case 'minzoom': + case 'maxzoom': + case 'version': + case 'name': + case 'description': + case 'legend': + case 'attribution': + case 'template': + case 'format': + memo.push({ + '_name': 'Parameter', + '_attributes': { + 'name': k + }, + '_content': v + }); + break; + case 'interactivity': + memo.push({ + '_name': 'Parameter', + '_attributes': { + 'name': 'interactivity_layer' + }, + '_content': v.layer + }); + memo.push({ + '_name': 'Parameter', + '_attributes': { + 'name': 'interactivity_fields' + }, + '_content': v.fields + }); + break; + // Support any additional scalar properties. + default: + if ('string' === typeof v || 'number' === typeof v || 'boolean' === typeof v) { + memo.push({ + '_name': 'Parameter', + '_attributes': { + 'name': k + }, + '_content': v + }); + } + break; + } + return memo; + }, []); + if (parameters.length) { + output.unshift({ + '_name': 'Parameters', + '_content': parameters + }); + } + + // issue warnings for definitions that do not match layers + _.forEach(definitions, function (v) { + if (v.matchCount == 0) { + var selectorName = '', + filename = null, + index = null; + + if (_.isArray(v.elements) && v.elements.length > 0) { + selectorName = v.elements[v.elements.length - 1].value; + } + if (_.isArray(v.rules) && v.rules.length > 0) { + filename = v.rules[0].filename; + index = v.rules[0].index; + } + util.warning(env, { + message: 'Styles do not match layer selector ' + selectorName + '.', + filename: filename, + index: index + }); + } + }); + + output = { + '_name': 'Map', + '_attributes': map_properties, + '_content': output + }; + + switch (this.options.outputFormat) { + case 'json': + output = JSON.stringify(output, null, 2); + break; + case 'mapnik': + default: + output = '\n\n' + util.jsonToXML(output); + break; + } + + } + else { + output = null; + } + + return { + msg: env.msg, + data: output + }; + } + catch (err) { + // do not swallow program errors + if (err.message !== 'N/A') { + throw err; + } + + return { + msg: env.msg, + data: null + }; + } +}; + +/** + * This function currently modifies 'current' + * @param {Array} current current list of rules + * @param {Object} definition a Definition object to add to the rules + * @param {Object} byFilter an object/dictionary of existing filters. This is + * actually keyed `attachment->filter` +*/ +function addRules(current, definition, byFilter) { + var newFilters = definition.filters, + newRules = definition.rules, + updatedFilters, clone, previous; + + // The current definition might have been split up into + // multiple definitions already. + for (var k = 0; k < current.length; k++) { + updatedFilters = current[k].filters.cloneWith(newFilters); + if (updatedFilters) { + previous = byFilter[updatedFilters]; + if (previous) { + // There's already a definition with those exact + // filters. Add the current definitions' rules + // and stop processing it as the existing rule + // has already gone down the inheritance chain. + previous.addRules(newRules); + } else { + clone = current[k].clone(updatedFilters); + // Make sure that we're only maintaining the clone + // when we did actually add rules. If not, there's + // no need to keep the clone around. + if (clone.addRules(newRules)) { + // We inserted an element before this one, so we need + // to make sure that in the next loop iteration, we're + // not performing the same task for this element again, + // hence the k++. + byFilter[updatedFilters] = clone; + current.splice(k, 0, clone); + k++; + } + } + } else if (updatedFilters === null) { + // if updatedFilters is null, then adding the filters doesn't + // invalidate or split the selector, so we addRules to the + // combined selector + + // Filters can be added, but they don't change the + // filters. This means we don't have to split the + // definition. + // + // this is cloned here because of shared classes, see + // sharedclass.mss + current[k] = current[k].clone(); + current[k].addRules(newRules); + } + // if updatedFeatures is false, then the filters split the rule, + // so they aren't the same inheritance chain + } + return current; +} + +/** + * Apply inherited styles from their ancestors to them. + * + * called either once per render (in the case of mss) or per layer + * (for mml) + * + * @param {Object} definitions - a list of definitions objects + * that contain .rules + * @param {Object} env - the environment + * @return {Array} an array of arrays is returned, + * in which each array refers to a specific attachment + */ +function inheritDefinitions(definitions, env) { + var inheritTime = +new Date(); + // definitions are ordered by specificity, + // high (index 0) to low + var byAttachment = {}, + byFilter = {}; + var result = []; + var current, attachment; + + // Evaluate the filters specified by each definition with the given + // environment to correctly resolve variable references + definitions.forEach(function(d) { + d.filters.ev(env); + }); + + for (var i = 0; i < definitions.length; i++) { + + attachment = definitions[i].attachment; + current = [definitions[i]]; + + if (!byAttachment[attachment]) { + byAttachment[attachment] = []; + byAttachment[attachment].attachment = attachment; + byFilter[attachment] = {}; + result.push(byAttachment[attachment]); + } + + // Iterate over all subsequent rules. + for (var j = i + 1; j < definitions.length; j++) { + if (definitions[j].attachment === attachment) { + // Only inherit rules from the same attachment. + current = addRules(current, definitions[j], byFilter[attachment]); + } + } + + for (var k = 0; k < current.length; k++) { + byFilter[attachment][current[k].filters] = current[k]; + byAttachment[attachment].push(current[k]); + } + } + + if (env.benchmark) console.warn('Inheritance time: ' + ((new Date() - inheritTime)) + 'ms'); + + return result; + +} + +// Sort styles by the minimum index of their rules. +// This sorts a slice of the styles, so it returns a sorted +// array but does not change the input. +function sortStylesIndex(a, b) { return b.index - a.index; } +function sortStyles(styles) { + for (var i = 0; i < styles.length; i++) { + var style = styles[i]; + style.index = Infinity; + for (var b = 0; b < style.length; b++) { + var rules = style[b].rules; + for (var r = 0; r < rules.length; r++) { + var rule = rules[r]; + if (rule.index < style.index) { + style.index = rule.index; + } + } + } + } + + var result = styles.slice(); + result.sort(sortStylesIndex); + return result; +} + +// Removes dead style definitions that can never be reached +// when filter-mode="first". The style is modified in-place +// and returned. The style must be sorted. +function foldStyle(style) { + for (var i = 0; i < style.length; i++) { + for (var j = style.length - 1; j > i; j--) { + if (style[j].filters.cloneWith(style[i].filters) === null) { + style.splice(j, 1); + } + } + } + return style; +} + +/** + * Find a rule like Map { background-color: #fff; }, + * if any, and return a list of properties to be inserted + * into the '; + }, + 'ev': function() { return this; } +}; + +})(require('../tree')); diff --git a/lib/carto/tree/definition.js b/lib/carto/tree/definition.js new file mode 100644 index 0000000..a845bae --- /dev/null +++ b/lib/carto/tree/definition.js @@ -0,0 +1,290 @@ +(function(tree) { +var assert = require('assert'), + _ = require('lodash'), + util = require('../util'); + +// A definition is the combination of a selector and rules, like +// #foo { +// polygon-opacity:1.0; +// } +// +// The selector can have filters +tree.Definition = function Definition(env, selector, rules) { + this.elements = selector.elements; + assert.ok(selector.filters instanceof tree.Filterset); + this.rules = rules; + this.ruleIndex = {}; + for (var i = 0; i < this.rules.length; i++) { + if ('zoom' in this.rules[i]) this.rules[i] = this.rules[i].clone(); + this.rules[i].zoom = selector.zoom; + this.ruleIndex[this.rules[i].updateID()] = true; + } + this.filters = selector.filters; + this.zoom = selector.zoom; + this.attachment = selector.attachment || '__default__'; + this.specificity = selector.specificity(); + this.matchCount = 0; + this.ref = env.ref; + + // special handling for Map selector + if (_.isArray(this.elements) && this.elements.length > 0 && + this.elements[0].value === 'Map') { + this.matchCount = 1; + } +}; + +tree.Definition.prototype.toString = function() { + var str = this.filters.toString(); + for (var i = 0; i < this.rules.length; i++) { + str += '\n ' + this.rules[i]; + } + return str; +}; + +tree.Definition.prototype.clone = function(filters) { + if (filters) assert.ok(filters instanceof tree.Filterset); + var clone = Object.create(tree.Definition.prototype); + clone.rules = this.rules.slice(); + clone.ruleIndex = _.clone(this.ruleIndex); + clone.filters = filters ? filters : this.filters.clone(); + clone.attachment = this.attachment; + clone.ref = this.ref; + return clone; +}; + +tree.Definition.prototype.addRules = function(rules) { + var added = 0; + + for (var i = 0; i < rules.length; i++) { + // only add rule if not for whole symbolizer (default) + // and if unique + if (this.ref.selectorName(rules[i].name) !== 'default' && + !this.ruleIndex[rules[i].id]) { + this.rules.push(rules[i]); + this.ruleIndex[rules[i].id] = true; + added++; + } + } + + return added; +}; + +// Determine whether this selector matches a given id, +// array of classes and zoom range, by determining whether +// all elements it contains match. +tree.Definition.prototype.appliesTo = function(id, classes, zoom) { + if (typeof zoom === 'undefined' || (this.zoom & zoom) > 0) { + for (var i = 0, l = this.elements.length; i < l; i++) { + var elem = this.elements[i]; + if (!(elem.wildcard || + (elem.type === 'class' && classes[elem.clean]) || + (elem.type === 'id' && id === elem.clean))) return false; + } + this.matchCount++; + return true; + } + return false; +}; + +function symbolizerName(symbolizer) { + function capitalize(str) { return str[1].toUpperCase(); } + return symbolizer.charAt(0).toUpperCase() + + symbolizer.slice(1).replace(/\-./, capitalize) + 'Symbolizer'; +} + +// Get a simple list of the symbolizers, in order +function symbolizerList(sym_order) { + return sym_order.sort(function(a, b) { return a[1] - b[1]; }) + .map(function(v) { return v[0]; }); +} + +tree.Definition.prototype.symbolizersToObject = function(env, symbolizers, zoom) { + var ruleContent = [], + filter = this.filters.toObject(env); + + ruleContent = _.concat(ruleContent, zoom.toObject(env)); + if (Object.keys(filter).length) { + ruleContent.push(filter); + } + + // Sort symbolizers by the index of their first property definition + var sym_order = [], indexes = []; + for (var key in symbolizers) { + indexes = []; + for (var prop in symbolizers[key]) { + indexes.push(symbolizers[key][prop].index); + } + var min_idx = Math.min.apply(Math, indexes); + sym_order.push([key, min_idx]); + } + + sym_order = symbolizerList(sym_order); + var sym_count = 0; + + for (var i = 0; i < sym_order.length; i++) { + var doNotSerialize = false; + var attributes = symbolizers[sym_order[i]]; + var symbolizer = sym_order[i].split('/').pop(); + + // Skip the magical * symbolizer which is used for universal properties + // which are bubbled up to Style elements intead of Symbolizer elements. + if (symbolizer === '*') continue; + sym_count++; + + var fail = env.ref.requiredProperties(symbolizer, attributes); + if (fail) { + var rule = attributes[Object.keys(attributes).shift()]; + util.error(env, { + message: fail, + index: rule.index, + filename: rule.filename + }); + } + + var name = symbolizerName(symbolizer), + symbolizerObject = {}, + symbolizerAttr = []; + + _.set(symbolizerObject, '_name', name); + + var selfclosing = true, tagcontent; + // iterate through attributes sorted by cartocss name + Object.keys(attributes).sort().forEach(function(j) { + if (symbolizer === 'map') util.error(env, { + message: 'Map properties are not permitted in other rules', + index: attributes[j].index, + filename: attributes[j].filename + }); + var x = env.ref.selector(attributes[j].name); + if (x && x.serialization && x.serialization === 'content') { + selfclosing = false; + tagcontent = attributes[j].ev(env).toObject(env, true); + } else if (x && x.serialization && x.serialization === 'tag') { + selfclosing = false; + tagcontent = attributes[j].ev(env).toObject(env, true); + } else { + var attr = attributes[j].ev(env); + // if we have a rule for the whole symbolizer (default) with keyword none + // don't output the rule + if (env.ref.selectorName(attr.name) === 'default' && + attr.value.value[0].is === 'keyword') { + if (attr.value.value[0].value === 'none') { + doNotSerialize = true; + // still call toObject for validation + attr.toObject(env); + } + else if (attr.value.value[0].value === 'auto') { + // still call toObject for validation + attr.toObject(env); + } + } + + // only output attributes that don't use the keywords none and auto + if (!(attr.value.value[0].is === 'keyword' && + (attr.value.value[0].value === 'none' || attr.value.value[0].value === 'auto'))) { + symbolizerAttr.push(attr.toObject(env)); + } + else { + if (!_.has(x, 'type')) { + symbolizerAttr.push(attr.toObject(env)); + } + else if (x.type === 'string' || x.type === 'uri') { + symbolizerAttr.push(attr.toObject(env)); + } + } + } + }); + + if (doNotSerialize) { + continue; + } + + if (symbolizerAttr.length) { + var attrObj = {}; + + _.forEach(symbolizerAttr, function (a) { + _.forOwn(a, function (v, k) { + attrObj[k] = v; + }); + }); + _.set(symbolizerObject, '_attributes', attrObj); + } + if (!selfclosing && typeof tagcontent !== 'undefined') { + _.set(symbolizerObject, '_content', tagcontent); + } + + if (Object.keys(symbolizerObject).length) { + ruleContent.push(symbolizerObject); + } + } + if (!sym_count || !ruleContent.length) return {}; + return { + '_name': 'Rule', + '_content': ruleContent + }; +}; + +// Take a zoom range of zooms and 'i', the index of a rule in this.rules, +// and finds all applicable symbolizers +tree.Definition.prototype.collectSymbolizers = function(zooms, i) { + var symbolizers = {}, child; + + for (var j = i; j < this.rules.length; j++) { + child = this.rules[j]; + var key = child.instance + '/' + child.symbolizer; + if (zooms.current & child.zoom && + (!(key in symbolizers) || + (!(child.name in symbolizers[key])))) { + zooms.current &= child.zoom; + if (!(key in symbolizers)) { + symbolizers[key] = {}; + } + symbolizers[key][child.name] = child; + } + } + + if (Object.keys(symbolizers).length) { + zooms.rule &= (zooms.available &= ~zooms.current); + return symbolizers; + } +}; + +// The tree.Zoom.toString function ignores the holes in zoom ranges and outputs +// scaledenominators that cover the whole range from the first to last bit set. +// This algorithm can produces zoom ranges that may have holes. However, +// when using the filter-mode="first", more specific zoom filters will always +// end up before broader ranges. The filter-mode will pick those first before +// resorting to the zoom range with the hole and stop processing further rules. +tree.Definition.prototype.toObject = function(env, existing) { + var filter = this.filters.toString(); + if (!(filter in existing)) existing[filter] = tree.Zoom.all; + + var available = tree.Zoom.all, + objects = [], + symbolizers, + zooms = { available: tree.Zoom.all }; + + for (var i = 0; i < this.rules.length && available; i++) { + zooms.rule = this.rules[i].zoom; + if (!(existing[filter] & zooms.rule)) continue; + + do { + zooms.current = zooms.rule & available; + if (zooms.current) { + symbolizers = this.collectSymbolizers(zooms, i); + if (symbolizers) { + if (!(existing[filter] & zooms.current)) continue; + objects.push(this.symbolizersToObject(env, symbolizers, + (new tree.Zoom()).setZoom(existing[filter] & zooms.current))); + existing[filter] &= ~zooms.current; + } + } + } + while (zooms.current); + } + + if (objects.length == 1) return objects[0]; + return objects; +}; + +})(require('../tree')); diff --git a/lib/carto/tree/dimension.js b/lib/carto/tree/dimension.js new file mode 100644 index 0000000..4d1e707 --- /dev/null +++ b/lib/carto/tree/dimension.js @@ -0,0 +1,102 @@ +(function(tree) { +var _ = require('lodash'), + chroma = require('chroma-js'), + util = require('../util'); +// +// A number with a unit +// +tree.Dimension = function Dimension(value, unit, index, filename) { + this.value = parseFloat(value); + this.unit = unit || null; + this.filename = filename; + this.index = index; +}; + +tree.Dimension.prototype = { + is: 'float', + physical_units: ['m', 'cm', 'in', 'mm', 'pt', 'pc'], + screen_units: ['px', '%'], + all_units: ['m', 'cm', 'in', 'mm', 'pt', 'pc', 'px', '%'], + densities: { + m: 0.0254, + mm: 25.4, + cm: 2.54, + pt: 72, + pc: 6 + }, + ev: function (env) { + if (this.unit && !_.includes(this.all_units, this.unit)) { + util.error(env, { + message: "Invalid unit: '" + this.unit + "'", + index: this.index, + filename: this.filename + }); + return { is: 'undefined', value: 'undefined' }; + } + + // normalize units which are not px or % + if (this.unit && _.includes(this.physical_units, this.unit)) { + if (!env.ppi) { + util.error(env, { + message: "ppi is not set, so metric units can't be used", + index: this.index, + filename: this.filename + }); + return { is: 'undefined', value: 'undefined' }; + } + // convert all units to inch + // convert inch to px using ppi + this.value = (this.value / this.densities[this.unit]) * env.ppi; + this.unit = 'px'; + } + + return this; + }, + toColor: function() { + return new tree.Color(chroma([this.value, this.value, this.value]).hsl(), 1, false); + }, + round: function() { + this.value = Math.round(this.value); + return this; + }, + toString: function() { + return this.value.toString(); + }, + operate: function(env, op, other) { + if (this.unit === '%' && other.unit !== '%') { + util.error(env, { + message: 'If two operands differ, the first must not be %', + index: this.index, + filename: this.filename + }); + return { + is: 'undefined', + value: 'undefined' + }; + } + + if (this.unit !== '%' && other.unit === '%') { + if (op === '*' || op === '/' || op === '%') { + util.error(env, { + message: 'Percent values can only be added or subtracted from other values', + index: this.index, + filename: this.filename + }); + return { + is: 'undefined', + value: 'undefined' + }; + } + + return new tree.Dimension(tree.operate(op, + this.value, this.value * other.value * 0.01), + this.unit, this.index, this.filename); + } + + //here the operands are either the same (% or undefined or px), or one is undefined and the other is px + return new tree.Dimension(tree.operate(op, this.value, other.value), + this.unit || other.unit, this.index, this.filename); + } +}; + +})(require('../tree')); diff --git a/lib/carto/tree/element.js b/lib/carto/tree/element.js new file mode 100644 index 0000000..e6c9556 --- /dev/null +++ b/lib/carto/tree/element.js @@ -0,0 +1,30 @@ +(function(tree) { + +// An element is an id or class selector +tree.Element = function Element(value) { + this.value = value.trim(); + if (this.value[0] === '#') { + this.type = 'id'; + this.clean = this.value.replace(/^#/, ''); + } + if (this.value[0] === '.') { + this.type = 'class'; + this.clean = this.value.replace(/^\./, ''); + } + if (this.value.indexOf('*') !== -1) { + this.type = 'wildcard'; + } +}; + +// Determine the 'specificity matrix' of this +// specific selector +tree.Element.prototype.specificity = function() { + return [ + (this.type === 'id') ? 1 : 0, // a + (this.type === 'class') ? 1 : 0 // b + ]; +}; + +tree.Element.prototype.toString = function() { return this.value; }; + +})(require('../tree')); diff --git a/lib/carto/tree/expression.js b/lib/carto/tree/expression.js new file mode 100644 index 0000000..dfe1da0 --- /dev/null +++ b/lib/carto/tree/expression.js @@ -0,0 +1,39 @@ +(function(tree) { + +var _ = require('lodash'); + +tree.Expression = function Expression(value) { + this.value = value; +}; + +tree.Expression.prototype = { + is: 'expression', + ev: function(env) { + if (this.value.length > 1) { + return new tree.Expression(this.value.map(function(e) { + return e.ev(env); + })); + } else { + return this.value[0].ev(env); + } + }, + + toString: function(env) { + var containsObj = false, + mappedVal = this.value.map(function(e) { + var result = e.toString(env); + + if (_.isObject(result)) { + containsObj = true; + } + return result; + }); + + if (containsObj) { + return mappedVal; + } + return mappedVal.join(' '); + } +}; + +})(require('../tree')); diff --git a/lib/carto/tree/field.js b/lib/carto/tree/field.js new file mode 100644 index 0000000..a98b904 --- /dev/null +++ b/lib/carto/tree/field.js @@ -0,0 +1,17 @@ +(function(tree) { + +tree.Field = function Field(content) { + this.value = content || ''; +}; + +tree.Field.prototype = { + is: 'field', + toString: function() { + return '[' + this.value + ']'; + }, + 'ev': function() { + return this; + } +}; + +})(require('../tree')); diff --git a/lib/carto/tree/filter.js b/lib/carto/tree/filter.js new file mode 100644 index 0000000..3f94476 --- /dev/null +++ b/lib/carto/tree/filter.js @@ -0,0 +1,70 @@ +(function(tree) { + +var util = require('../util'); + +tree.Filter = function Filter(key, op, val, index, filename) { + this.key = key; + this.op = op; + this.val = val; + this.index = index; + this.filename = filename; + + this.id = this.key + this.op + this.val; +}; + +// xmlsafe (removed), numeric, suffix +var ops = { + '<': [' < ', 'numeric'], + '>': [' > ', 'numeric'], + '=': [' = ', 'both'], + '!=': [' != ', 'both'], + '<=': [' <= ', 'numeric'], + '>=': [' >= ', 'numeric'], + '=~': ['.match(', 'string', ')'] +}; + +tree.Filter.prototype.ev = function(env) { + this.key = this.key.ev(env); + this.val = this.val.ev(env); + return this; +}; + +tree.Filter.prototype.toObject = function(env) { + if (env.ref.data.filter) { + if (this.key.is === 'keyword' && -1 === env.ref.data.filter.value.indexOf(this.key.toString())) { + util.error(env, { + message: this.key.toString() + ' is not a valid keyword in a filter expression', + index: this.index, + filename: this.filename + }); + } + if (this.val.is === 'keyword' && -1 === env.ref.data.filter.value.indexOf(this.val.toString())) { + util.error(env, { + message: this.val.toString() + ' is not a valid keyword in a filter expression', + index: this.index, + filename: this.filename + }); + } + } + var key = this.key.toString(false); + var val = this.val.toString(this.val.is == 'string'); + + if ( + (ops[this.op][1] == 'numeric' && isNaN(val) && this.val.is !== 'field') || + (ops[this.op][1] == 'string' && (val)[0] != "'") + ) { + util.error(env, { + message: 'Cannot use operator "' + this.op + '" with value ' + this.val, + index: this.index, + filename: this.filename + }); + } + + return key + ops[this.op][0] + val + (ops[this.op][2] || ''); +}; + +tree.Filter.prototype.toString = function() { + return '[' + this.id + ']'; +}; + +})(require('../tree')); diff --git a/lib/carto/tree/filterset.js b/lib/carto/tree/filterset.js new file mode 100644 index 0000000..a72ebc3 --- /dev/null +++ b/lib/carto/tree/filterset.js @@ -0,0 +1,290 @@ +var tree = require('../tree'), + util = require('../util'); + +tree.Filterset = function Filterset() { + this.filters = {}; +}; + +tree.Filterset.prototype.toObject = function(env) { + var filters = []; + for (var id in this.filters) { + filters.push('(' + this.filters[id].toObject(env).trim() + ')'); + } + if (filters.length) { + return { + '_name': 'Filter', + '_content': filters.join(' and ') + }; + } else { + return {}; + } +}; + +tree.Filterset.prototype.toString = function() { + var arr = []; + for (var id in this.filters) arr.push(this.filters[id].id); + return arr.sort().join('\t'); +}; + +tree.Filterset.prototype.ev = function(env) { + for (var i in this.filters) { + this.filters[i].ev(env); + } + // Rebuild the filters dict after var subst. + var result = new tree.Filterset(); + for (var i2 in this.filters) { + var err = result.add(this.filters[i2]); + if (err) { + util.error(env, { + message: err, + filename: this.filters[i2].filename, + index: this.filters[i2].index + }); + throw new Error('N/A'); + } + } + this.filters = result.filters; + return this; +}; + +tree.Filterset.prototype.clone = function() { + var clone = new tree.Filterset(); + for (var id in this.filters) { + clone.filters[id] = this.filters[id]; + } + return clone; +}; + +// Note: other has to be a tree.Filterset. +tree.Filterset.prototype.cloneWith = function(other) { + var additions = []; + for (var id in other.filters) { + var status = this.addable(other.filters[id]); + // status is true, false or null. if it's null we don't fail this + // clone nor do we add the filter. + if (status === false) { + return false; + } + if (status === true) { + // Adding the filter will override another value. + additions.push(other.filters[id]); + } + } + + // Adding the other filters doesn't make this filterset invalid, but it + // doesn't add anything to it either. + if (!additions.length) { + return null; + } + + // We can successfully add all filters. Now clone the filterset and add the + // new rules. + var clone = new tree.Filterset(); + + // We can add the rules that are already present without going through the + // add function as a Filterset is always in it's simplest canonical form. + for (id in this.filters) { + clone.filters[id] = this.filters[id]; + } + + // Only add new filters that actually change the filter. + do { + id = additions.shift(); + if (id) { + clone.add(id); + } + } + while (id); + + return clone; +}; + +// Returns true when the new filter can be added, false otherwise. +// It can also return null, and on the other side we test for === true or +// false +tree.Filterset.prototype.addable = function(filter) { + var key = filter.key.toString(), + value = filter.val.toString(), + valueIsNull = filter.val.is == 'keyword' && value == 'null'; + + if (value.match(/^[+-]?[0-9]+(\.[0-9]*)?([e|E][+-]?[0-9]+)?$/)) { + value = parseFloat(value); + } + + switch (filter.op) { + case '=': + // if there is already foo= and we're adding foo= + if (this.filters[key + '='] !== undefined) { + if (this.filters[key + '='].val.toString() != value) { + return false; + } else { + return null; + } + } + if (this.filters[key + '!=' + value] !== undefined) return false; + if (this.filters[key + '>'] !== undefined && (this.filters[key + '>'].val >= value || valueIsNull)) return false; + if (this.filters[key + '<'] !== undefined && (this.filters[key + '<'].val <= value || valueIsNull)) return false; + if (this.filters[key + '>='] !== undefined && (this.filters[key + '>='].val > value || valueIsNull)) return false; + if (this.filters[key + '<='] !== undefined && (this.filters[key + '<='].val < value || valueIsNull)) return false; + return true; + + case '=~': + return true; + + case '!=': + if (this.filters[key + '='] !== undefined) return (this.filters[key + '='].val == value) ? false : null; + if (this.filters[key + '!=' + value] !== undefined) return null; + if (this.filters[key + '>'] !== undefined && (this.filters[key + '>'].val >= value || valueIsNull)) return null; + if (this.filters[key + '<'] !== undefined && (this.filters[key + '<'].val <= value || valueIsNull)) return null; + if (this.filters[key + '>='] !== undefined && (this.filters[key + '>='].val > value || valueIsNull)) return null; + if (this.filters[key + '<='] !== undefined && (this.filters[key + '<='].val < value || valueIsNull)) return null; + return true; + + case '>': + if (this.filters[key + '='] !== undefined) { + if (this.filters[key + '='].val <= value || + (this.filters[key + '='].val.is == 'keyword' && this.filters[key + '='].val.toString() == 'null')) { + return false; + } else { + return null; + } + } + + if (this.filters[key + '<'] !== undefined && this.filters[key + '<'].val <= value) return false; + if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val <= value) return false; + if (this.filters[key + '>'] !== undefined && this.filters[key + '>'].val >= value) return null; + if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) return null; + return true; + + case '>=': + if (this.filters[key + '=' ] !== undefined) { + if (this.filters[key + '='].val < value || + (this.filters[key + '='].val.is == 'keyword' && this.filters[key + '='].val.toString() == 'null')) { + return false; + } else { + return null; + } + } + + if (this.filters[key + '<' ] !== undefined && this.filters[key + '<'].val <= value) return false; + if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) return false; + if (this.filters[key + '>' ] !== undefined && this.filters[key + '>'].val >= value) return null; + if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val >= value) return null; + return true; + + case '<': + if (this.filters[key + '=' ] !== undefined) { + if (this.filters[key + '='].val >= value || + (this.filters[key + '='].val.is == 'keyword' && this.filters[key + '='].val.toString() == 'null')) { + return false; + } else { + return null; + } + } + + if (this.filters[key + '>' ] !== undefined && this.filters[key + '>'].val >= value) return false; + if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val >= value) return false; + if (this.filters[key + '<' ] !== undefined && this.filters[key + '<'].val <= value) return null; + if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val < value) return null; + return true; + + case '<=': + if (this.filters[key + '=' ] !== undefined) { + if (this.filters[key + '='].val > value || + (this.filters[key + '='].val.is == 'keyword' && this.filters[key + '='].val.toString() == 'null')) { + return false; + } else { + return null; + } + } + + if (this.filters[key + '>' ] !== undefined && this.filters[key + '>'].val >= value) return false; + if (this.filters[key + '>='] !== undefined && this.filters[key + '>='].val > value) return false; + if (this.filters[key + '<' ] !== undefined && this.filters[key + '<'].val <= value) return null; + if (this.filters[key + '<='] !== undefined && this.filters[key + '<='].val <= value) return null; + return true; + } +}; + +// Does the new filter constitute a conflict? +tree.Filterset.prototype.conflict = function(filter) { + var key = filter.key.toString(), + value = filter.val.toString(); + + if (!isNaN(parseFloat(value))) value = parseFloat(value); + + // if (a=b) && (a=c) + // if (a=b) && (a!=b) + // or (a!=b) && (a=b) + if ((filter.op === '=' && this.filters[key + '='] !== undefined && + value != this.filters[key + '='].val.toString()) || + (filter.op === '!=' && this.filters[key + '='] !== undefined && + value == this.filters[key + '='].val.toString()) || + (filter.op === '=' && this.filters[key + '!='] !== undefined && + value == this.filters[key + '!='].val.toString())) { + return filter.toString() + ' added to ' + this.toString() + ' produces an invalid filter'; + } + + return false; +}; + +// Only call this function for filters that have been cleared by .addable(). +tree.Filterset.prototype.add = function(filter) { + var key = filter.key.toString(), + op = filter.op, + conflict = this.conflict(filter), + numval; + + if (conflict) return conflict; + + if (op === '=') { + for (var i in this.filters) { + if (this.filters[i].key == key) delete this.filters[i]; + } + this.filters[key + '='] = filter; + } else if (op === '!=') { + this.filters[key + '!=' + filter.val] = filter; + } else if (op === '=~') { + this.filters[key + '=~' + filter.val] = filter; + } else if (op === '>') { + this.filters[key + '>'] = filter; + } else if (op === '>=') { + for (var k in this.filters) { + numval = (+this.filters[k].val.toString()); + if (this.filters[k].key == key && numval < filter.val) { + delete this.filters[k]; + } + } + if (this.filters[key + '!=' + filter.val] !== undefined) { + delete this.filters[key + '!=' + filter.val]; + filter.op = '>'; + this.filters[key + '>'] = filter; + } + else { + this.filters[key + '>='] = filter; + } + } else if (op === '<') { + for (var l in this.filters) { + numval = (+this.filters[l].val.toString()); + if (this.filters[l].key == key && numval >= filter.val) { + delete this.filters[l]; + } + } + this.filters[key + '<'] = filter; + } else if (op === '<=') { + for (var m in this.filters) { + numval = (+this.filters[m].val.toString()); + if (this.filters[m].key == key && numval > filter.val) { + delete this.filters[m]; + } + } + if (this.filters[key + '!=' + filter.val] !== undefined) { + delete this.filters[key + '!=' + filter.val]; + filter.op = '<'; + this.filters[key + '<'] = filter; + } + else { + this.filters[key + '<='] = filter; + } + } +}; diff --git a/lib/carto/tree/fontset.js b/lib/carto/tree/fontset.js new file mode 100644 index 0000000..6c530a8 --- /dev/null +++ b/lib/carto/tree/fontset.js @@ -0,0 +1,51 @@ +(function(tree) { + +tree._flattenFontArray = function (fonts) { + var result = []; + + for (var i = 0; i < fonts.length; i++) { + if (Array.isArray(fonts[i].value)) { + result = result.concat(tree._flattenFontArray(fonts[i].value)); + } else { + result.push(fonts[i]); + } + } + return result; +} + +tree._getFontSet = function(env, fonts) { + var fontKey = fonts.join(''); + if (env._fontMap && env._fontMap[fontKey]) { + return env._fontMap[fontKey]; + } + + var new_fontset = new tree.FontSet(env, tree._flattenFontArray(fonts)); + env.effects.push(new_fontset); + if (!env._fontMap) env._fontMap = {}; + env._fontMap[fontKey] = new_fontset; + return new_fontset; +}; + +tree.FontSet = function FontSet(env, fonts) { + this.fonts = fonts; + this.name = 'fontset-' + env.effects.length; +}; + +tree.FontSet.prototype.toObject = function() { + return { + '_name': 'FontSet', + '_attributes': { + name: this.name + }, + '_content': this.fonts.map(function (f) { + return { + '_name': 'Font', + '_attributes': { + 'face-name': f.value + } + } + }) + }; +}; + +})(require('../tree')); diff --git a/lib/carto/tree/imagefilter.js b/lib/carto/tree/imagefilter.js new file mode 100644 index 0000000..99a1fe5 --- /dev/null +++ b/lib/carto/tree/imagefilter.js @@ -0,0 +1,22 @@ +(function(tree) { + +tree.ImageFilter = function ImageFilter(filter, args) { + this.filter = filter; + this.args = args || null; +}; + +tree.ImageFilter.prototype = { + is: 'imagefilter', + ev: function() { return this; }, + + toString: function() { + if (this.args) { + return this.filter + '(' + this.args.join(',') + ')'; + } else { + return this.filter; + } + } +}; + + +})(require('../tree')); diff --git a/lib/carto/tree/invalid.js b/lib/carto/tree/invalid.js new file mode 100644 index 0000000..ad37a7f --- /dev/null +++ b/lib/carto/tree/invalid.js @@ -0,0 +1,25 @@ +(function (tree) { + +var util = require('../util'); + +tree.Invalid = function Invalid(chunk, index, message, filename) { + this.chunk = chunk; + this.index = index; + this.message = message || "Invalid code: " + this.chunk; + this.filename = filename; +}; + +tree.Invalid.prototype.is = 'invalid'; + +tree.Invalid.prototype.ev = function(env) { + util.error(env, { + chunk: this.chunk, + index: this.index, + message: this.message || "Invalid code: " + this.chunk, + filename: this.filename + }); + return { + is: 'undefined' + }; +}; +})(require('../tree')); diff --git a/lib/carto/tree/keyword.js b/lib/carto/tree/keyword.js new file mode 100644 index 0000000..ed31771 --- /dev/null +++ b/lib/carto/tree/keyword.js @@ -0,0 +1,17 @@ +(function(tree) { + +tree.Keyword = function Keyword(value) { + this.value = value; + var special = { + 'transparent': 'color', + 'true': 'boolean', + 'false': 'boolean' + }; + this.is = special[value] ? special[value] : 'keyword'; +}; +tree.Keyword.prototype = { + ev: function() { return this; }, + toString: function() { return this.value; } +}; + +})(require('../tree')); diff --git a/lib/carto/tree/layer.js b/lib/carto/tree/layer.js new file mode 100644 index 0000000..52132c3 --- /dev/null +++ b/lib/carto/tree/layer.js @@ -0,0 +1,70 @@ +var semver = require('semver'), + _ = require('lodash'); + +(function(tree) { + +tree.LayerObject = function(obj, styles, apiVersion) { + var dsOptions = [], + layerAttr = {}, + layerContent = []; + + for (var i in obj.Datasource) { + dsOptions.push({ + '_name': 'Parameter', + '_attributes': { + 'name': i + }, + '_content': obj.Datasource[i] + }); + } + + for (var prop in obj.properties) { + if (prop === 'minzoom') { + if (semver.gte(apiVersion, '3.0.0')) { + _.set(layerAttr, 'maximum-scale-denominator', tree.Zoom.ranges[obj.properties[prop]]); + } + else { + _.set(layerAttr, 'maxzoom', tree.Zoom.ranges[obj.properties[prop]]); + } + } else if (prop === 'maxzoom') { + if (semver.gte(apiVersion, '3.0.0')) { + _.set(layerAttr, 'minimum-scale-denominator', tree.Zoom.ranges[obj.properties[prop]+1]); + } + else { + _.set(layerAttr, 'minzoom', tree.Zoom.ranges[obj.properties[prop]+1]); + } + } else { + _.set(layerAttr, prop, obj.properties[prop]); + } + } + + _.set(layerAttr, 'name', new tree.Quoted(obj.layerId).toString()); + if (typeof obj.status !== 'undefined') { + _.set(layerAttr, 'status', obj.status); + } + if (typeof obj.srs !== 'undefined') { + _.set(layerAttr, 'srs', obj.srs); + } + + _.forEach(styles.reverse(), function (s) { + layerContent.push({ + '_name': 'StyleName', + '_content': s + }); + }); + + if (dsOptions.length) { + layerContent.push({ + '_name': 'Datasource', + '_content': dsOptions + }); + } + + return { + '_name': 'Layer', + '_attributes': layerAttr, + '_content': layerContent + }; +}; + +})(require('../tree')); diff --git a/lib/carto/tree/literal.js b/lib/carto/tree/literal.js new file mode 100644 index 0000000..5fb6968 --- /dev/null +++ b/lib/carto/tree/literal.js @@ -0,0 +1,20 @@ +// A literal is a literal string for Mapnik - the +// result of the combination of a `tree.Field` with any +// other type. +(function(tree) { + +tree.Literal = function Field(content) { + this.value = content || ''; + this.is = 'field'; +}; + +tree.Literal.prototype = { + toString: function() { + return this.value; + }, + 'ev': function() { + return this; + } +}; + +})(require('../tree')); diff --git a/lib/carto/tree/operation.js b/lib/carto/tree/operation.js new file mode 100644 index 0000000..473d785 --- /dev/null +++ b/lib/carto/tree/operation.js @@ -0,0 +1,102 @@ +// An operation is an expression with an op in between two operands, +// like 2 + 1. +(function(tree) { + +var util = require('../util'); + +tree.Operation = function Operation(op, operands, index, filename) { + this.op = op.trim(); + this.operands = operands; + this.index = index; + this.filename = filename; +}; + +tree.Operation.prototype.is = 'operation'; + +tree.Operation.prototype.ev = function(env) { + var a = this.operands[0].ev(env), + b = this.operands[1].ev(env), + temp; + + if (a.is === 'undefined' || b.is === 'undefined') { + return { + is: 'undefined', + value: 'undefined' + }; + } + + if (a instanceof tree.Dimension && b instanceof tree.Color) { + if (this.op === '*' || this.op === '+') { + temp = b, b = a, a = temp; + } else { + util.error(env, { + name: "OperationError", + message: "Can't substract or divide a color from a number", + index: this.index, + filename: this.filename + }); + } + } + + // Only concatenate plain strings, because this is easily + // pre-processed + if (a instanceof tree.Quoted && b instanceof tree.Quoted && this.op !== '+') { + util.error(env, { + message: "Can't subtract, divide, or multiply strings.", + index: this.index, + filename: this.filename + }); + return { + is: 'undefined', + value: 'undefined' + }; + } + + // Fields, literals, dimensions, and quoted strings can be combined. + if (a instanceof tree.Field || b instanceof tree.Field || + a instanceof tree.Literal || b instanceof tree.Literal) { + if (a.is === 'color' || b.is === 'color') { + util.error(env, { + message: "Can't subtract, divide, or multiply colors in expressions.", + index: this.index, + filename: this.filename + }); + return { + is: 'undefined', + value: 'undefined' + }; + } else { + return new tree.Literal(a.ev(env).toString(true) + this.op + b.ev(env).toString(true)); + } + } + + if (a.operate === undefined) { + util.error(env, { + message: 'Cannot do math with type ' + a.is + '.', + index: this.index, + filename: this.filename + }); + return { + is: 'undefined', + value: 'undefined' + }; + } + + return a.operate(env, this.op, b); +}; + +tree.Operation.prototype.toString = function () { + return this.operands[0].toString() + this.op + this.operands[1].toString(); +}; + +tree.operate = function(op, a, b) { + switch (op) { + case '+': return a + b; + case '-': return a - b; + case '*': return a * b; + case '%': return a % b; + case '/': return a / b; + } +}; + +})(require('../tree')); diff --git a/lib/carto/tree/quoted.js b/lib/carto/tree/quoted.js new file mode 100644 index 0000000..0d3045e --- /dev/null +++ b/lib/carto/tree/quoted.js @@ -0,0 +1,30 @@ +(function(tree) { + +tree.Quoted = function Quoted(content) { + this.value = content || ''; +}; + +tree.Quoted.prototype = { + is: 'string', + + toString: function(quotes) { + var escapedValue = this.value + .replace(/&/g, '&') + var xmlvalue = escapedValue + .replace(/\'/g, '\\\'') + .replace(/\"/g, '"') + .replace(//g, '>'); + return (quotes === true) ? "'" + xmlvalue + "'" : escapedValue; + }, + + 'ev': function() { + return this; + }, + + operate: function(env, op, other) { + return new tree.Quoted(tree.operate(op, this.toString(), other.toString(this.contains_field))); + } +}; + +})(require('../tree')); diff --git a/lib/carto/tree/reference.js b/lib/carto/tree/reference.js new file mode 100644 index 0000000..2fa03d1 --- /dev/null +++ b/lib/carto/tree/reference.js @@ -0,0 +1,314 @@ +// Carto needs a reference to validate input. +// The reference can be either `mapnik-reference` or customly set. +// This file builds indexes from that file for its various +// options, and provides validation methods for property: value +// combinations. +(function(tree) { + +var _ = require('lodash'), + semver = require('semver'); + +tree.Reference = function Reference(ref) { + this.data = null; + this.selector_cache = []; + this.functions = []; + this.required_cache = []; + + if (!_.isNil(ref)) { + if (this.checkCompliance(ref)) { + this.compliant = true; + this.ref = ref; + } + // fall back to Mapnik reference if non-compliant reference was given + else { + this.compliant = false; + this.ref = require('mapnik-reference'); + } + } + // use Mapnik reference if no reference given + else { + this.compliant = true; + this.ref = require('mapnik-reference'); + } +}; + +tree.Reference.prototype.checkCompliance = function (ref) { + if (_.has(ref, 'latest') && _.has(ref, 'versions') && + _.isArray(ref.versions) && _.has(ref, 'load') && + _.isFunction(ref.load)) { + var data = ref.load(ref.latest); + if (_.has(data, 'version') && _.isString(data.version) && + _.has(data, 'style') && _.isObject(data.style) && + _.has(data, 'layer') && _.isObject(data.layer) && + _.has(data, 'symbolizers') && _.isObject(data.symbolizers) && + _.has(data, 'colors') && _.isObject(data.colors) && + _.has(data, 'datasources') && _.isObject(data.datasources)) { + + return true; + } + } + + return false; +}; + +tree.Reference.prototype.getLatest = function () { + return this.ref.latest; +}; + +tree.Reference.prototype.setData = function (data) { + this.data = data; + this.selector_cache = generateSelectorCache(data); + this.functions = generateFunctions(data); + + this.functions.matrix = [6]; + this.functions.translate = [1, 2]; + this.functions.scale = [1, 2]; + this.functions.rotate = [1, 3]; + this.functions.skewX = [1]; + this.functions.skewY = [1]; + + this.required_cache = generateRequiredProperties(data); +}; + +tree.Reference.prototype.setVersion = function (version) { + if (semver.valid(version)) { + try { + this.setData(this.ref.load(version)); + } + catch (err) { + var e = new Error('Version ' + version + ' is not supported'); + e.stack = null; // do not show stack trace + throw e; + } + } + else { + var apiErr = new Error('Invalid API version. A valid version is e.g. 3.0.0 or 3.0.10'); + apiErr.stack = null; // do not show stack trace + throw apiErr; + } +}; + +tree.Reference.prototype.selectorData = function (selector, i) { + if (this.selector_cache[selector]) return this.selector_cache[selector][i]; +}; + +tree.Reference.prototype.validSelector = function (selector) { return !!this.selector_cache[selector]; }; +tree.Reference.prototype.selectorName = function (selector) { return this.selectorData(selector, 3); }; +tree.Reference.prototype.selector = function (selector) { return this.selectorData(selector, 1); }; +tree.Reference.prototype.symbolizer = function (selector) { return this.selectorData(selector, 2); }; + +function generateSelectorCache(data) { + var index = {}; + _.forEach(data.style, function (rule, i) { + if (_.has(rule, 'css')) { + index[rule.css] = ['style', rule, '*', i]; + } + }); + _.forEach(data.layer, function (rule, i) { + if (_.has(rule, 'css')) { + index[rule.css] = ['layer', rule, '*', i]; + } + }); + _.forEach(data.symbolizers, function (symbolizer, i) { + _.forEach(symbolizer, function (rule, j) { + if (_.has(rule, 'css')) { + index[rule.css] = ['symbolizer', rule, i, j]; + } + }); + }); + return index; +} + +function generateFunctions(data) { + var functions = {}; + _.forEach(data.style, function (rule) { + if (rule.type === 'functions') { + _.forEach(rule.functions, function (func) { + functions[func[0]] = func[1]; + }); + } + }); + _.forEach(data.layer, function (rule) { + if (rule.type === 'functions') { + _.forEach(rule.functions, function (func) { + functions[func[0]] = func[1]; + }); + } + }); + _.forEach(data.symbolizers, function (symbolizer) { + _.forEach(symbolizer, function (rule) { + if (rule.type === 'functions') { + _.forEach(rule.functions, function (func) { + functions[func[0]] = func[1]; + }); + } + }); + }); + return functions; +} + +function generateRequiredProperties(data) { + var cache = {}; + for (var symbolizer_name in data.symbolizers) { + cache[symbolizer_name] = []; + for (var j in data.symbolizers[symbolizer_name]) { + if (data.symbolizers[symbolizer_name][j].required) { + cache[symbolizer_name].push(data.symbolizers[symbolizer_name][j].css); + } + } + } + return cache; +} + +tree.Reference.prototype.requiredProperties = function (symbolizer_name, rules) { + var that = this, + doNotSerialize = false; + + _.forEach(rules, function (rule) { + if (that.selectorName(rule.name) === 'default') { + doNotSerialize = true; + } + }); + if (doNotSerialize) { + return null; + } + + var req = this.required_cache[symbolizer_name]; + for (var i in req) { + if (!(req[i] in rules)) { + return 'Property ' + req[i] + ' required for defining ' + + symbolizer_name + ' styles.'; + } + } +}; + +// TODO: finish implementation - this is dead code +tree.Reference.prototype._validateValue = { + 'font': function(env, value) { + if (env.validation_data && env.validation_data.fonts) { + return env.validation_data.fonts.indexOf(value) != -1; + } else { + return true; + } + } +}; + +tree.Reference.prototype.isFont = function (selector) { + return this.selector(selector).validate == 'font'; +}; + +// https://gist.github.com/982927 +tree.Reference.prototype.editDistance = function (a, b){ + if (a.length === 0) return b.length; + if (b.length === 0) return a.length; + var matrix = []; + for (var i = 0; i <= b.length; i++) { matrix[i] = [i]; } + for (var j = 0; j <= a.length; j++) { matrix[0][j] = j; } + for (i = 1; i <= b.length; i++) { + for (j = 1; j <= a.length; j++) { + if (b.charAt(i-1) == a.charAt(j-1)) { + matrix[i][j] = matrix[i-1][j-1]; + } else { + matrix[i][j] = Math.min(matrix[i-1][j-1] + 1, // substitution + Math.min(matrix[i][j-1] + 1, // insertion + matrix[i-1][j] + 1)); // deletion + } + } + } + return matrix[b.length][a.length]; +}; + +function validateFunctions(ref, value, selector) { + if (value.value[0].is === 'string') return true; + for (var i in value.value) { + for (var j in value.value[i].value) { + if (value.value[i].value[j].is !== 'call') return false; + var f = _.find(ref + .selector(selector).functions, function(x) { + return x[0] == value.value[i].value[j].name; + }); + if (!(f && f[1] == -1)) { + // This filter is unknown or given an incorrect number of arguments + if (!f || f[1] !== value.value[i].value[j].args.length) return false; + } + } + } + return true; +} + +function validateKeyword(ref, value, selector) { + if (typeof ref.selector(selector).type === 'object') { + return ref.selector(selector).type + .indexOf(value.value[0].value) !== -1; + } else { + // allow unquoted keywords as strings + return ref.selector(selector).type === 'string' || + ref.selector(selector)['default-value'] === value.value[0].value; + } +} + +tree.Reference.prototype.selectorStatus = function (selector) { + var selectorRef = this.selector(selector); + + if (_.has(selectorRef, 'status')) { + return selectorRef.status; + } + + return 'stable'; +}; + +tree.Reference.prototype.validValue = function (env, selector, value) { + var i; + // TODO: handle in reusable way + if (!this.selector(selector)) { + return false; + } else if (value.value[0].is == 'keyword') { + return validateKeyword(this, value, selector); + } else if (value.value[0].is == 'undefined') { + // caught earlier in the chain - ignore here so that + // error is not overridden + return true; + } else if (this.selector(selector).type == 'numbers') { + for (i in value.value) { + if (value.value[i].is !== 'float') { + return false; + } + } + return true; + } else if (this.selector(selector).type == 'tags') { + if (!value.value) return false; + if (!value.value[0].value) { + return value.value[0].is === 'tag'; + } + for (i = 0; i < value.value[0].value.length; i++) { + if (value.value[0].value[i].is !== 'tag') return false; + } + return true; + } else if (this.selector(selector).type == 'functions') { + // For backwards compatibility, you can specify a string for `functions`-compatible + // values, though they will not be validated. + return validateFunctions(this.ref, value, selector); + } else if (this.selector(selector).type === 'unsigned') { + if (value.value[0].is === 'float') { + value.value[0].round(); + return true; + } else { + return false; + } + } else if ((this.selector(selector).expression)) { + return true; + } else { + if (this.selector(selector).validate) { + for (i = 0; i < value.value.length; i++) { + if (this.selector(selector).type == value.value[i].is && + this._validateValue[this.selector(selector).validate](env, value.value[i].value)) { + return true; + } + } + return false; + } else { + return this.selector(selector).type == value.value[0].is; + } + } +}; +})(require('../tree')); diff --git a/lib/carto/tree/rule.js b/lib/carto/tree/rule.js new file mode 100644 index 0000000..3824eb9 --- /dev/null +++ b/lib/carto/tree/rule.js @@ -0,0 +1,173 @@ +(function(tree) { + +var util = require('../util'), + _ = require('lodash'); + +// a rule is a single property and value combination, or variable +// name and value combination, like +// polygon-opacity: 1.0; or @opacity: 1.0; +tree.Rule = function Rule(ref, name, value, index, filename) { + var parts = name.split('/'); + this.name = parts.pop(); + this.instance = parts.length ? parts[0] : '__default__'; + this.value = (value instanceof tree.Value) ? + value : new tree.Value([value]); + this.index = index; + this.symbolizer = ref.symbolizer(this.name); + this.filename = filename; + this.variable = (name.charAt(0) === '@'); +}; + +tree.Rule.prototype.is = 'rule'; + +tree.Rule.prototype.clone = function() { + var clone = Object.create(tree.Rule.prototype); + clone.name = this.name; + clone.value = this.value; + clone.index = this.index; + clone.instance = this.instance; + clone.symbolizer = this.symbolizer; + clone.filename = this.filename; + clone.variable = this.variable; + return clone; +}; + +tree.Rule.prototype.updateID = function() { + return this.id = this.zoom + '#' + this.instance + '#' + this.name; +}; + +tree.Rule.prototype.toString = function() { + return '[' + tree.Zoom.toString(this.zoom) + '] ' + this.name + ': ' + this.value; +}; + +tree.Rule.prototype.validate = function (env) { + var valid = true; + + if (!env.ref.validSelector(this.name)) { + var mean = getMean(this.name, env.ref); + var mean_message = '.'; + if (!_.isNil(mean) && !_.isEmpty(mean)) { + if (mean[0][1] < 3) { + mean_message = '. Did you mean ' + mean[0][0] + '?'; + } + } + valid = false; + util.error(env, { + message: "Unrecognized rule: " + this.name + mean_message, + index: this.index, + filename: this.filename + }); + } + else { + var selectorStatus = env.ref.selectorStatus(this.name); + if (selectorStatus !== 'stable') { + if (selectorStatus === 'deprecated') { + util.warning(env, { + message: this.name + ' is deprecated. It may be removed in the future.', + filename: this.filename, + index: this.index + }); + } + else if (selectorStatus === 'unstable') { + util.warning(env, { + message: this.name + ' is unstable. It may change in the future.', + filename: this.filename, + index: this.index + }); + } + else if (selectorStatus === 'experimental') { + util.warning(env, { + message: this.name + ' is experimental. It may change, be renamed or removed in the future.', + filename: this.filename, + index: this.index + }); + } + } + + if ((this.value instanceof tree.Value) && + !env.ref.validValue(env, this.name, this.value)) { + if (!env.ref.selector(this.name)) { + valid = false; + util.error(env, { + message: 'Unrecognized property: ' + + this.name, + index: this.index, + filename: this.filename + }); + } else { + var typename; + if (env.ref.selector(this.name).validate) { + typename = env.ref.selector(this.name).validate; + } else if (typeof env.ref.selector(this.name).type === 'object') { + typename = 'keyword (options: ' + env.ref.selector(this.name).type.join(', ') + ')'; + } else { + typename = env.ref.selector(this.name).type; + } + + if (typename !== 'font' || + (typename === 'font' && this.value.value[0].is !== 'string')) { + valid = false; + util.error(env, { + message: 'Invalid value for ' + + this.name + + ', the type ' + typename + + ' is expected. ' + this.value + + ' (of type ' + this.value.value[0].is + ') was given.', + index: this.index, + filename: this.filename + }); + } + else { + valid = false; + util.error(env, { + message: 'The font \'' + + this.value + + '\' (specified as text-face-name) is not a known font on your system,' + + ' please provide an existing font face name.', + index: this.index, + filename: this.filename + }); + } + } + } + } + + return valid; +} + +function getMean(name, ref) { + return Object.keys(ref.selector_cache).map(function(f) { + return [f, ref.editDistance(name, f)]; + }).sort(function(a, b) { return a[1] - b[1]; }); +} + +// second argument, if true, outputs the value of this +// rule without the usual attribute="content" wrapping. Right +// now this is just for the TextSymbolizer, but applies to other +// properties in reference.json which specify serialization=content +tree.Rule.prototype.toObject = function(env, content, sep) { + if (this.validate(env)) { + if (this.variable) { + return {}; + } else if (env.ref.isFont(this.name) && this.value.value.length > 1) { + var f = tree._getFontSet(env, this.value.value); + return _.set({}, 'fontset-name', f.name); + } else if (content) { + return this.value.toString(env, this.name, sep); + } else { + return _.set({}, env.ref.selectorName(this.name), this.value.toString(env, this.name)); + } + } + + return {}; +}; + +// TODO: Rule ev chain should add fontsets to env.frames +tree.Rule.prototype.ev = function(context) { + return new tree.Rule(context.ref, this.name, + this.value.ev(context), + this.index, + this.filename); +}; + +})(require('../tree')); diff --git a/lib/carto/tree/ruleset.js b/lib/carto/tree/ruleset.js new file mode 100644 index 0000000..654ebab --- /dev/null +++ b/lib/carto/tree/ruleset.js @@ -0,0 +1,178 @@ +(function(tree) { + +var util = require('../util'); + +tree.Ruleset = function Ruleset(selectors, rules) { + this.selectors = selectors; + this.rules = rules; + // static cache of find() function + this._lookups = {}; +}; +tree.Ruleset.prototype = { + is: 'ruleset', + 'ev': function(env) { + var i, + rule, + ruleset = new tree.Ruleset(this.selectors, this.rules.slice(0)); + ruleset.root = this.root; + + // push the current ruleset to the frames stack + env.frames.unshift(ruleset); + + // Evaluate everything else + for (i = 0; i < ruleset.rules.length; i++) { + rule = ruleset.rules[i]; + ruleset.rules[i] = rule.ev ? rule.ev(env) : rule; + } + + // Pop the stack + env.frames.shift(); + + return ruleset; + }, + match: function(args) { + return !args || args.length === 0; + }, + variables: function() { + if (this._variables) { return this._variables; } + else { + return this._variables = this.rules.reduce(function(hash, r) { + if (r instanceof tree.Rule && r.variable === true) { + hash[r.name] = r; + } + return hash; + }, {}); + } + }, + variable: function(name) { + return this.variables()[name]; + }, + rulesets: function() { + if (this._rulesets) { return this._rulesets; } + else { + return this._rulesets = this.rules.filter(function(r) { + return (r instanceof tree.Ruleset); + }); + } + }, + find: function(selector, self) { + self = self || this; + var rules = [], match, + key = selector.toString(); + + if (key in this._lookups) { return this._lookups[key]; } + + this.rulesets().forEach(function(rule) { + if (rule !== self) { + for (var j = 0; j < rule.selectors.length; j++) { + match = selector.match(rule.selectors[j]); + if (match) { + if (selector.elements.length > 1) { + Array.prototype.push.apply(rules, rule.find( + new tree.Selector(null, null, selector.elements.slice(1)), self)); + } else { + rules.push(rule); + } + break; + } + } + } + }); + return this._lookups[key] = rules; + }, + // Zooms can use variables. This replaces tree.Zoom objects on selectors + // with simple bit-arrays that we can compare easily. + evZooms: function(env) { + for (var i = 0; i < this.selectors.length; i++) { + var zval = tree.Zoom.all; + for (var z = 0; z < this.selectors[i].zoom.length; z++) { + zval = zval & this.selectors[i].zoom[z].ev(env).zoom; + } + this.selectors[i].zoom = zval; + } + }, + flatten: function(result, parents, env) { + var selectors = [], i, j; + if (this.selectors.length === 0) { + env.frames = env.frames.concat(this.rules); + } + // evaluate zoom variables on this object. + this.evZooms(env); + for (i = 0; i < this.selectors.length; i++) { + var child = this.selectors[i]; + + if (!child.filters) { + // TODO: is this internal inconsistency? + // This is an invalid filterset. + continue; + } + + if (parents.length) { + for (j = 0; j < parents.length; j++) { + var parent = parents[j]; + + var mergedFilters = parent.filters.cloneWith(child.filters); + if (mergedFilters === null) { + // Filters could be added, but they didn't change the + // filters. This means that we only have to clone when + // the zoom levels or the attachment is different too. + if (parent.zoom === (parent.zoom & child.zoom) && + parent.attachment === child.attachment && + parent.elements.join() === child.elements.join()) { + selectors.push(parent); + continue; + } else { + mergedFilters = parent.filters; + } + } else if (!mergedFilters) { + // The merged filters are invalid, that means we don't + // have to clone. + continue; + } + + var clone = Object.create(tree.Selector.prototype); + clone.filters = mergedFilters; + clone.zoom = parent.zoom & child.zoom; + clone.elements = parent.elements.concat(child.elements); + if (parent.attachment && child.attachment) { + clone.attachment = parent.attachment + '/' + child.attachment; + } + else clone.attachment = child.attachment || parent.attachment; + clone.conditions = parent.conditions + child.conditions; + clone.index = child.index; + selectors.push(clone); + } + } else { + selectors.push(child); + } + } + + var rules = []; + for (i = 0; i < this.rules.length; i++) { + var rule = this.rules[i]; + + // Recursively flatten any nested rulesets + if (rule instanceof tree.Ruleset) { + rule.flatten(result, selectors, env); + } else if (rule instanceof tree.Rule) { + rules.push(rule); + } else if (rule instanceof tree.Invalid) { + util.error(env, rule); + } + } + + var index = rules.length ? rules[0].index : false; + for (i = 0; i < selectors.length; i++) { + // For specificity sort, use the position of the first rule to allow + // defining attachments that are under current element as a descendant + // selector. + if (index !== false) { + selectors[i].index = index; + } + result.push(new tree.Definition(env, selectors[i], rules.slice())); + } + + return result; + } +}; +})(require('../tree')); diff --git a/lib/carto/tree/selector.js b/lib/carto/tree/selector.js new file mode 100644 index 0000000..76fb5da --- /dev/null +++ b/lib/carto/tree/selector.js @@ -0,0 +1,26 @@ +(function(tree) { + +tree.Selector = function Selector(filters, zoom, elements, attachment, conditions, index) { + this.elements = elements || []; + this.attachment = attachment; + this.filters = filters || {}; + this.zoom = typeof zoom !== 'undefined' ? zoom : tree.Zoom.all; + this.conditions = conditions; + this.index = index; +}; + +// Determine the specificity of this selector +// based on the specificity of its elements - calling +// Element.specificity() in order to do so +// +// [ID, Class, Filters, Position in document] +tree.Selector.prototype.specificity = function() { + return this.elements.reduce(function(memo, e) { + var spec = e.specificity(); + memo[0] += spec[0]; + memo[1] += spec[1]; + return memo; + }, [0, 0, this.conditions, this.index]); +}; + +})(require('../tree')); diff --git a/lib/carto/tree/style.js b/lib/carto/tree/style.js new file mode 100644 index 0000000..ce110dd --- /dev/null +++ b/lib/carto/tree/style.js @@ -0,0 +1,96 @@ +(function(tree) { +var _ = require('lodash'); + +// Given a style's name, attachment, definitions, and an environment object, +// return a style object resembling Mapnik XML +tree.StyleObject = function(name, attachment, definitions, env) { + var existing = {}; + var image_filters = [], image_filters_inflate = [], direct_image_filters = [], comp_op = [], opacity = []; + + for (var i = 0; i < definitions.length; i++) { + for (var j = 0; j < definitions[i].rules.length; j++) { + var isNone = false; + + if (_.has(definitions[i].rules[j].value.value[0], 'value') && + _.has(definitions[i].rules[j].value.value[0].value[0], 'is') && + definitions[i].rules[j].value.value[0].value[0].is === 'keyword' && + definitions[i].rules[j].value.value[0].value[0].value === 'none') { + isNone = true; + } + + if (definitions[i].rules[j].name === 'image-filters' && !isNone) { + image_filters.push(definitions[i].rules[j]); + } + if (definitions[i].rules[j].name === 'image-filters-inflate') { + image_filters_inflate.push(definitions[i].rules[j]); + } + if (definitions[i].rules[j].name === 'direct-image-filters' && !isNone) { + direct_image_filters.push(definitions[i].rules[j]); + } + if (definitions[i].rules[j].name === 'comp-op' && !isNone) { + comp_op.push(definitions[i].rules[j]); + } + if (definitions[i].rules[j].name === 'opacity') { + opacity.push(definitions[i].rules[j]); + } + } + } + + var styleContent = definitions.map(function(definition) { + return definition.toObject(env, existing); + }).filter(function (definition) { + // filter empty + if (_.isArray(definition) && !definition.length) { + return false; + } + else if (!Object.keys(definition).length) { + return false; + } + return true; + }); + + var styleAttrs = {}; + + if (image_filters.length) { + _.set(styleAttrs, 'image-filters', _.chain(image_filters) + // prevent identical filters from being duplicated in the style + .uniq(function(i) { return i.id; }).map(function(f) { + return f.ev(env).toObject(env, true, ',', 'image-filter'); + }).value().join(',')); + } + + if (image_filters_inflate.length) { + _.set(styleAttrs, 'image-filters-inflate', image_filters_inflate[0].value.ev(env).toString()); + } + + if (direct_image_filters.length) { + _.set(styleAttrs, 'direct-image-filters', _.chain(direct_image_filters) + // prevent identical filters from being duplicated in the style + .uniq(function(i) { return i.id; }).map(function(f) { + return f.ev(env).toObject(env, true, ',', 'direct-image-filter'); + }).value().join(',')); + } + + if (comp_op.length && comp_op[0].value.ev(env).value != 'src-over') { + _.set(styleAttrs, 'comp-op', comp_op[0].value.ev(env).toString()); + } + + if (opacity.length && opacity[0].value.ev(env).value != 1) { + _.set(styleAttrs, 'opacity', opacity[0].value.ev(env).toString()); + } + + if (!Object.keys(styleAttrs).length && !styleContent.length) { + return {}; + } + + _.set(styleAttrs, 'name', new tree.Quoted(name).toString()); + _.set(styleAttrs, 'filter-mode', 'first'); + + return { + '_name': 'Style', + '_attributes': styleAttrs, + '_content': styleContent + } +}; + +})(require('../tree')); diff --git a/lib/carto/tree/url.js b/lib/carto/tree/url.js new file mode 100644 index 0000000..fc8fdb7 --- /dev/null +++ b/lib/carto/tree/url.js @@ -0,0 +1,18 @@ +(function(tree) { + +tree.URL = function URL(val, paths) { + this.value = val; + this.paths = paths; +}; + +tree.URL.prototype = { + is: 'uri', + toString: function() { + return this.value.toString(); + }, + ev: function(ctx) { + return new tree.URL(this.value.ev(ctx), this.paths); + } +}; + +})(require('../tree')); diff --git a/lib/carto/tree/value.js b/lib/carto/tree/value.js new file mode 100644 index 0000000..4ecbbfe --- /dev/null +++ b/lib/carto/tree/value.js @@ -0,0 +1,45 @@ +(function(tree) { + +var _ = require('lodash'); + +tree.Value = function Value(value) { + this.value = value; +}; + +tree.Value.prototype = { + is: 'value', + ev: function(env) { + if (this.value.length === 1) { + return this.value[0].ev(env); + } else { + return new tree.Value(this.value.map(function(v) { + return v.ev(env); + })); + } + }, + toString: function(env, selector, sep, format) { + var containsObj = false, + mappedVal = this.value.map(function(e) { + var result = e.toString(env, format); + + if (_.isObject(result)) { + containsObj = true; + } + return result; + }); + + if (containsObj) { + return _.flatten(mappedVal); + } + return mappedVal.join(sep || ', '); + }, + clone: function() { + var obj = Object.create(tree.Value.prototype); + if (Array.isArray(obj)) obj.value = this.value.slice(); + else obj.value = this.value; + obj.is = this.is; + return obj; + } +}; + +})(require('../tree')); diff --git a/lib/carto/tree/variable.js b/lib/carto/tree/variable.js new file mode 100644 index 0000000..abacb82 --- /dev/null +++ b/lib/carto/tree/variable.js @@ -0,0 +1,38 @@ +(function(tree) { + +var util = require('../util'); + +tree.Variable = function Variable(name, index, filename) { + this.name = name; + this.index = index; + this.filename = filename; +}; + +tree.Variable.prototype = { + is: 'variable', + toString: function() { + return this.name; + }, + ev: function(env) { + if (this._css) return this._css; + + var thisframe = env.frames.filter(function(f) { + return f.name == this.name; + }.bind(this)); + if (thisframe.length) { + return thisframe[thisframe.length - 1].value.ev(env); + } else { + util.error(env, { + message: 'variable ' + this.name + ' is undefined', + index: this.index, + filename: this.filename + }); + return { + is: 'undefined', + value: 'undefined' + }; + } + } +}; + +})(require('../tree')); diff --git a/lib/carto/tree/zoom.js b/lib/carto/tree/zoom.js new file mode 100644 index 0000000..50b39c2 --- /dev/null +++ b/lib/carto/tree/zoom.js @@ -0,0 +1,128 @@ +var tree = require('../tree'), + util = require('../util'); + +// Storage for zoom ranges. Only supports continuous ranges, +// and stores them as bit-sequences so that they can be combined, +// inverted, and compared quickly. +tree.Zoom = function(op, value, index, filename) { + this.op = op; + this.value = value; + this.index = index; + this.filename = filename; +}; + +tree.Zoom.prototype.setZoom = function(zoom) { + this.zoom = zoom; + return this; +}; + +tree.Zoom.prototype.ev = function(env) { + var start = 0, + end = Infinity, + value = parseInt(this.value.ev(env).toString(), 10), + zoom = 0; + + if (value > tree.Zoom.maxZoom || value < 0) { + util.error(env, { + message: 'Only zoom levels between 0 and ' + + tree.Zoom.maxZoom + ' supported.', + index: this.index, + filename: this.filename + }); + } + + switch (this.op) { + case '=': + this.zoom = 1 << value; + return this; + case '>': + start = value + 1; + break; + case '>=': + start = value; + break; + case '<': + end = value - 1; + break; + case '<=': + end = value; + break; + } + for (var i = 0; i <= tree.Zoom.maxZoom; i++) { + if (i >= start && i <= end) { + zoom |= (1 << i); + } + } + this.zoom = zoom; + return this; +}; + +tree.Zoom.maxZoom = 25; + +// Covers all zoomlevels from 0 to maxZoom +tree.Zoom.all = parseInt(Array(tree.Zoom.maxZoom + 2).join('1'), 2) + +tree.Zoom.ranges = { + 0: 1000000000, + 1: 500000000, + 2: 200000000, + 3: 100000000, + 4: 50000000, + 5: 25000000, + 6: 12500000, + 7: 6500000, + 8: 3000000, + 9: 1500000, + 10: 750000, + 11: 400000, + 12: 200000, + 13: 100000, + 14: 50000, + 15: 25000, + 16: 12500, + 17: 5000, + 18: 2500, + 19: 1500, + 20: 750, + 21: 500, + 22: 250, + 23: 100, + 24: 50, + 25: 25, + 26: 12.5 +}; + +// Only works for single range zooms. `[XXX....XXXXX.........]` is invalid. +tree.Zoom.prototype.toObject = function() { + var conditions = []; + if (this.zoom != tree.Zoom.all) { + var start = null, end = null; + for (var i = 0; i <= tree.Zoom.maxZoom; i++) { + if (this.zoom & (1 << i)) { + if (start === null) start = i; + end = i; + } + } + if (start > 0) { + conditions.push({ + '_name': 'MaxScaleDenominator', + '_content': tree.Zoom.ranges[start] + }); + } + if (end < tree.Zoom.maxZoom) { + conditions.push({ + '_name': 'MinScaleDenominator', + '_content': tree.Zoom.ranges[end + 1] + }); + } + } + return conditions; +}; + +tree.Zoom.prototype.toString = function() { + var str = ''; + for (var i = 0; i <= tree.Zoom.maxZoom; i++) { + str += (this.zoom & (1 << i)) ? 'X' : '.'; + } + return str; +}; diff --git a/lib/carto/util.js b/lib/carto/util.js new file mode 100644 index 0000000..1f49391 --- /dev/null +++ b/lib/carto/util.js @@ -0,0 +1,178 @@ +var _ = require('lodash'); + +var Util = function () { + this.processMessage = function (env, message) { + if (!env.msg) { + env.msg = []; + } + + if (message.type === 'error' || + (message.type === 'warning' && !env.quiet)) { + if (!_.isNil(message.filename) && !_.isNil(message.index) && + env.inputs && env.inputs[message.filename]) { + _.assign(message, this.getLineColumn(env.inputs[message.filename], message.index)); + _.unset(message.index); + } + + // add to messages collection if it not already exists + if (_.isNil(_.find(env.msg, function (v) { + return message.message === v.message && + message.filename === v.filename && + message.line === v.line && + message.column === v.column && + message.type === v.type; + }))) { + env.msg.push(message); + } + } + }; +}; + +Util.prototype.getLineColumn = function (input, index) { + var lineCol = { + line: 0, + column: -1 + }; + + if (!_.isNil(input) && !_.isNil(index)) { + lineCol.line = (input.slice(0, index).match(/\n/g) || '').length + 1; + for (var n = index; n >= 0 && input.charAt(n) !== '\n'; n--) { + lineCol.column++; + } + } + + return lineCol; +}; + +Util.prototype.hasErrors = function (messages) { + return typeof _.find(messages, ['type', 'error']) !== 'undefined'; +}; + +Util.prototype.getMessagesToPrint = function (messages) { + var messageOutput = '', + that = this; + + _.forEach(messages, function (v) { + messageOutput += that.getMessageToPrint(v) + '\n'; + }); + + return messageOutput.trim(); +}; + +Util.prototype.getMessageToPrint = function (message) { + var messageOutput = ''; + + message.type = message.type.charAt(0).toUpperCase() + message.type.slice(1); + + if (!_.isNil(message.filename)) { + if (message.line >= 0) { + if (message.column >= 0) { + messageOutput = _.template('<%=type%>: <%=filename%>:<%=line%>:<%=column%> <%=message%>')(message); + } + else { + messageOutput = _.template('<%=type%>: <%=filename%>:<%=line%> <%=message%>')(message); + } + } + else { + messageOutput = _.template('<%=type%>: <%=filename%> <%=message%>')(message); + } + } + else { + messageOutput = _.template('<%=type%>: <%=message%>')(message); + } + + return messageOutput; +}; + +Util.prototype.warning = function (env, message) { + _(message).defaults({ + type: 'warning', + message: 'Unspecified warning.', + filename: null, + line: -1, + column: -1 + }).value(); + + this.processMessage(env, message); +}; + +Util.prototype.error = function (env, message) { + _(message).defaults({ + type: 'error', + message: 'Unspecified error.', + filename: null, + line: -1, + column: -1 + }).value(); + + this.processMessage(env, message); +} + +Util.prototype.jsonToXML = function (json, level) { + var that = this, + intendation = ''; + + if (typeof level === 'undefined') { + level = 0; + } + for (var i = 0; i < level; i++) { + intendation += ' '; + } + + if (_.isObject(json) && !_.isArray(json)) { + if (_.has(json, '_name')) { + var output = intendation + '<' + json._name; + + if (_.has(json, '_attributes') && Object.keys(json._attributes).length) { + var attributes = []; + + // output attributes sorted in alphabetical order + Object.keys(json._attributes).sort().forEach(function (v) { + attributes.push(v + '="' + json._attributes[v] + '"'); + }); + output += ' ' + attributes.join(' '); + } + + if (_.has(json, '_content')) { + var content = that.jsonToXML(json._content, level + 1); + + // check if there are subtags + if (content.indexOf('') == -1) { + output += '>' + content + '\n'; + } + else { + output += '>\n' + content; + output += intendation + '\n'; + } + + } + else { + output += ' />\n'; + } + return output; + } + } + else if (_.isArray(json)) { + if (json.length) { + if (_.isObject(json[0])) { + return json.map(function (o) { + return that.jsonToXML(o, level); + }).join(''); + } + else { + return json.join(','); + } + } + } + else { + if (_.isString(json)) { + return ''; + } + else if (!_.isNil(json)) { + return json.toString(); + } + } + return ''; +}; + +module.exports = new Util(); diff --git a/man/carto.1 b/man/carto.1 new file mode 100644 index 0000000..8281fa9 --- /dev/null +++ b/man/carto.1 @@ -0,0 +1,52 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. +.TH CARTO "1" "July 2017" "carto 0.18.0 (Carto map stylesheet compiler)" "User Commands" +.SH NAME +carto \- manual page for carto 0.18.0 (Carto map stylesheet compiler) +.SH SYNOPSIS +.B carto +\fI\,\/\fR +.SH OPTIONS +.TP +\fB\-h\fR, \fB\-\-help\fR +Display this help message +.TP +\fB\-v\fR, \fB\-\-version\fR +Display version information [boolean] +.TP +\fB\-b\fR, \fB\-\-benchmark\fR +Outputs total compile time [boolean] +.TP +\fB\-l\fR, \fB\-\-localize\fR +Use millstone to localize resources when loading an MML +[boolean] [default: false] +.TP +\fB\-n\fR, \fB\-\-nosymlink\fR +Use absolute paths instead of symlinking files [boolean] +.TP +\fB\-a\fR, \fB\-\-api\fR +Specify Mapnik API version +.TP +\fB\-f\fR, \fB\-\-file\fR +Outputs to the given file instead of stdout. +.TP +\fB\-o\fR, \fB\-\-output\fR +Specify output format (mapnik, json) [default: "mapnik"] +.TP +\fB\-q\fR, \fB\-\-quiet\fR +Do not output any warnings [boolean] [default: false] +.TP +\fB\-\-ppi\fR +Pixels per inch used to convert m, mm, cm, in, pt, pc to +pixels [default: 90.714] +.SH "SEE ALSO" +The full documentation for +.B carto +is maintained as a Texinfo manual. If the +.B info +and +.B carto +programs are properly installed at your site, the command +.IP +.B info carto +.PP +should give you access to the complete manual. diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..5544351 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2309 @@ +{ + "name": "carto", + "version": "1.2.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "dev": true + }, + "acorn": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", + "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "dev": true + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "^3.0.4" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "ajv-keywords": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "dev": true + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" + } + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true + }, + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE=", + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha1-uqVZ7hTO1zRSIputcyZGfGH6vWA=", + "dev": true + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "^0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "optional": true, + "requires": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + } + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, + "chroma-js": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/chroma-js/-/chroma-js-1.3.7.tgz", + "integrity": "sha512-ARq0P94NObL8hdQbgc+E33X9OHiNzdHO7epe3nC/KgxNRxkQcFpzNqnGeFjvOY2GxfVhbia686NXD2jByb1o0g==" + }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha1-gVyZ6oT2gJUp0vRXkb34JxE1LWY=", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha1-NIQi2+gtgAswIu709qwQvy5NG0k=", + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "combined-stream": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha1-30boZ9D8Kuxmo0ZitAapzK//Ww8=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "coveralls": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.0.0.tgz", + "integrity": "sha1-Iu9zAzBTgIDSm4wVHckUav3oipk=", + "dev": true, + "requires": { + "js-yaml": "^3.6.1", + "lcov-parse": "^0.0.10", + "log-driver": "^1.2.5", + "minimist": "^1.2.0", + "request": "^2.79.0" + } + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true, + "optional": true + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha1-gAwN0eCov7yVg1wgKtIg/jF+WhI=", + "dev": true + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha1-XNAfwQFiG0LEzX9dGmYkNxbT850=", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", + "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "dev": true, + "requires": { + "esprima": "^2.7.1", + "estraverse": "^1.9.1", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.2.0" + }, + "dependencies": { + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + } + } + }, + "eslint": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", + "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", + "dev": true, + "requires": { + "ajv": "^5.3.0", + "babel-code-frame": "^6.22.0", + "chalk": "^2.1.0", + "concat-stream": "^1.6.0", + "cross-spawn": "^5.1.0", + "debug": "^3.1.0", + "doctrine": "^2.1.0", + "eslint-scope": "^3.7.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^3.5.4", + "esquery": "^1.0.0", + "esutils": "^2.0.2", + "file-entry-cache": "^2.0.0", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.0.1", + "ignore": "^3.3.3", + "imurmurhash": "^0.1.4", + "inquirer": "^3.0.6", + "is-resolvable": "^1.0.0", + "js-yaml": "^3.9.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.4", + "minimatch": "^3.0.2", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "pluralize": "^7.0.0", + "progress": "^2.0.0", + "regexpp": "^1.0.1", + "require-uncached": "^1.0.3", + "semver": "^5.3.0", + "strip-ansi": "^4.0.0", + "strip-json-comments": "~2.0.1", + "table": "4.0.2", + "text-table": "~0.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "eslint-scope": { + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz", + "integrity": "sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + }, + "dependencies": { + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + } + } + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha1-PzGA+y4pEBdxastMnW1bXDSmqB0=", + "dev": true + }, + "espree": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "dev": true, + "requires": { + "acorn": "^5.5.0", + "acorn-jsx": "^3.0.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha1-E7BM2z5sXRnfkatph6hpVhmwqnE=" + }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "^4.0.0" + }, + "dependencies": { + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + }, + "dependencies": { + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + } + } + }, + "estraverse": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "external-editor": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "dev": true, + "requires": { + "chardet": "^0.4.0", + "iconv-lite": "^0.4.17", + "tmp": "^0.0.33" + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "^1.2.1", + "object-assign": "^4.0.1" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha1-SRafHXmTQwZG2mHsxa41XCHJe3M=", + "requires": { + "locate-path": "^3.0.0" + } + }, + "flat-cache": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", + "integrity": "sha512-VwyB3Lkgacfik2vhqR4uv2rvebqmDvFu4jlN/C1RzWoJEo8I7z4Q404oiqYCkq41mni8EzQnm95emU9seckwtg==", + "dev": true, + "requires": { + "circular-json": "^0.3.1", + "graceful-fs": "^4.1.2", + "rimraf": "~2.6.2", + "write": "^0.2.1" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha1-+Xj6TJDR3+f/LWvtoqUV5xO9z0o=" + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-all": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-all/-/glob-all-3.1.0.tgz", + "integrity": "sha1-iRPd+17hrHgSZWJBsD1SF8ZLAqs=", + "dev": true, + "requires": { + "glob": "^7.0.5", + "yargs": "~1.2.6" + }, + "dependencies": { + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "minimist": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.1.0.tgz", + "integrity": "sha1-md9lelJXTCHJBXSX33QnkLK0wN4=", + "dev": true + }, + "yargs": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-1.2.6.tgz", + "integrity": "sha1-nHtKgv1dWVsr8Xq23MQxNUMv40s=", + "dev": true, + "requires": { + "minimist": "^0.1.0" + } + } + } + }, + "globals": { + "version": "11.10.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.10.0.tgz", + "integrity": "sha512-0GZF1RiPKU97IHUO5TORo9w1PwrH/NBPl+fS7oMLdaTRiYmYbwK4NWoZWrAdd0/abG9R2BU+OiwyQpTpE6pdfQ==", + "dev": true + }, + "graceful-fs": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "dev": true + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha1-8nNdwig2dPpnR4sQGBBZNVw2nl4=", + "dev": true + }, + "handlebars": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", + "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "dev": true, + "requires": { + "async": "^1.4.0", + "optimist": "^0.6.1", + "source-map": "^0.4.4", + "uglify-js": "^2.6" + }, + "dependencies": { + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": ">=0.0.4" + } + } + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "dev": true, + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + }, + "dependencies": { + "ajv": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.7.0.tgz", + "integrity": "sha512-RZXPviBTtfmtka9n9sy1N5M5b82CbxWIR6HIis4s3WQTXDJamc/0gpCWNGz6EWdWp4DOfjzJfhz/AS9zVPjjWg==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + } + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + } + } + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "hsluv": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/hsluv/-/hsluv-0.0.2.tgz", + "integrity": "sha1-j9asiY9AhsD+t6FG1TiwESK1HBo=" + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "3.3.10", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", + "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "inquirer": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "dev": true, + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^2.0.4", + "figures": "^2.0.0", + "lodash": "^4.3.0", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rx-lite": "^4.0.8", + "rx-lite-aggregates": "^4.0.8", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha1-76ouqdqg16suoTqXsritUf776L4=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "istanbul": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", + "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", + "dev": true, + "requires": { + "abbrev": "1.0.x", + "async": "1.x", + "escodegen": "1.8.x", + "esprima": "2.7.x", + "glob": "^5.0.15", + "handlebars": "^4.0.1", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "once": "1.x", + "resolve": "1.1.x", + "supports-color": "^3.1.0", + "which": "^1.1.1", + "wordwrap": "^1.0.0" + }, + "dependencies": { + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "^1.0.0" + } + } + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha1-6u1lbsg0TxD1J8a/obbiJE3hZ9E=", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true, + "optional": true + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "requires": { + "invert-kv": "^1.0.0" + } + }, + "lcov-parse": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-0.0.10.tgz", + "integrity": "sha1-GwuP+ayceIklBYK3C3ExXZ2m2aM=", + "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha1-2+w7OrdZdYBxtY/ln8QYca8hQA4=", + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha1-G3eTz3JZ6jj7NmHU04syYK+K5Oc=" + }, + "log-driver": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", + "integrity": "sha1-Y7lQIfBwL+36LJuwok53l9cYcdg=", + "dev": true + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "lru-cache": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", + "integrity": "sha1-Yi4y6CSItJJ5EUpPns9F581rulU=", + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "mapnik-reference": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/mapnik-reference/-/mapnik-reference-8.10.0.tgz", + "integrity": "sha512-BuvyCeE9Glf6YmMtTy+s4BhJAwFNygwcwKVJ4gRN4gJLQmDASmotNCwf9A3sw2JO/ynfYLFXpCpOCms2L77Nbg==", + "requires": { + "lodash": "^4.11.0", + "semver": "^5.1.0" + } + }, + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "mime-db": { + "version": "1.37.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", + "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==", + "dev": true + }, + "mime-types": { + "version": "2.1.21", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", + "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", + "dev": true, + "requires": { + "mime-db": "~1.37.0" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha1-ggyGo5M0ZA6ZUWkovQP8qIBX0CI=" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "mocha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha1-bYrlCPWRZ/lA8rWzxKYSrlDJCuY=", + "dev": true, + "requires": { + "browser-stdout": "1.3.1", + "commander": "2.15.1", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.5", + "he": "1.1.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "supports-color": "5.4.0" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha1-HGszdALCE3YF7+GfEP7DkPb6q1Q=", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "mocha-eslint": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mocha-eslint/-/mocha-eslint-4.1.0.tgz", + "integrity": "sha512-y+TIaoozAiuksnsr/7GVw7F2nAqotrZ06SHIw8wMR6PVWipXre5Hz59bsqLX1n2Lqu2YDebUX1A4qF/rtmWsYQ==", + "dev": true, + "requires": { + "chalk": "^1.1.0", + "eslint": "^4.2.0", + "glob-all": "^3.0.1", + "replaceall": "^0.1.6" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "requires": { + "path-key": "^2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" + }, + "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + } + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" + } + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha1-QrwpAKa1uL0XN2yOiCtlr8zyS/I=", + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + }, + "p-limit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.0.0.tgz", + "integrity": "sha1-5iTtVO6MRgp3izyfNnBJb/ileuw=", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha1-Mi1poFwCZLJZl9n0DNiokasAZKQ=", + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", + "integrity": "sha1-hQgLuHxkaI+keZb+j3376CEXYLE=" + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha1-KYuJ34uTsCIdv0Ia0rGx6iP8Z3c=", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + }, + "psl": { + "version": "1.1.31", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", + "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "regexpp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", + "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "replaceall": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/replaceall/-/replaceall-0.1.6.tgz", + "integrity": "sha1-gdgax663LX9cSUKt8ml6MiBojY4=", + "dev": true + }, + "request": { + "version": "2.88.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", + "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "^0.1.0", + "resolve-from": "^1.0.0" + } + }, + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "optional": true, + "requires": { + "align-text": "^0.1.1" + } + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + }, + "dependencies": { + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "^2.1.0" + } + }, + "rx-lite": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", + "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", + "dev": true + }, + "rx-lite-aggregates": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", + "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "dev": true, + "requires": { + "rx-lite": "*" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=", + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=", + "dev": true + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + }, + "slice-ansi": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0" + } + }, + "source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "dev": true, + "optional": true, + "requires": { + "amdefine": ">=0.0.4" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "table": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "dev": true, + "requires": { + "ajv": "^5.2.3", + "ajv-keywords": "^2.1.0", + "chalk": "^2.1.0", + "lodash": "^4.17.4", + "slice-ansi": "1.0.0", + "string-width": "^2.1.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha1-bTQzWIl2jSGyvNoKonfO07G/rfk=", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + } + } + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "optional": true, + "requires": { + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" + }, + "dependencies": { + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true, + "optional": true + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "optional": true, + "requires": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "optional": true + }, + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true, + "optional": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "optional": true, + "requires": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + } + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha1-/wS9/AEO5UfXgL7DjhrBwnd9JTo=", + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true, + "optional": true + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, + "xregexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/xregexp/-/xregexp-4.0.0.tgz", + "integrity": "sha1-5pgYneSd0qGMxWh7BeF8jkOUMCA=" + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha1-le+U+F7MgdAHwmThkKEg8KPIVms=" + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + }, + "yargs": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.1.tgz", + "integrity": "sha1-ZDLlYSO7Tnw1YhFUAemDdAYCYcI=", + "requires": { + "cliui": "^4.0.0", + "decamelize": "^2.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^10.1.0" + }, + "dependencies": { + "decamelize": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-2.0.0.tgz", + "integrity": "sha1-ZW17vICUxMeI6lPFhAkIycfQY8c=", + "requires": { + "xregexp": "4.0.0" + } + } + } + }, + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha1-cgImW4n36eny5XZeD+c1qQXtuqg=", + "requires": { + "camelcase": "^4.1.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..90fbbd9 --- /dev/null +++ b/package.json @@ -0,0 +1,56 @@ +{ + "name": "carto", + "version": "1.2.0", + "description": "Mapnik Stylesheet Compiler", + "url": "https://github.com/mapbox/carto", + "repository": { + "type": "git", + "url": "http://github.com/mapbox/carto.git" + }, + "author": { + "name": "Mapbox", + "url": "http://mapbox.com/", + "email": "info@mapbox.com" + }, + "keywords": [ + "mapnik", + "maps", + "css", + "stylesheets" + ], + "contributors": [ + "Tom MacWright ", + "Konstantin Käfer", + "Alexis Sellier " + ], + "license": "Apache-2.0", + "bin": { + "carto": "./bin/carto" + }, + "man": "./man/carto.1", + "main": "./lib/carto/index", + "engines": { + "node": ">=0.5.x" + }, + "dependencies": { + "chroma-js": "~1.3.5", + "hsluv": "~0.0.1", + "js-yaml": "~3.12.0", + "lodash": "~4.17.10", + "mapnik-reference": "~8.10.0", + "semver": "~5.6.0", + "yargs": "~12.0.1" + }, + "devDependencies": { + "coveralls": "~3.0.0", + "istanbul": "~0.4.5", + "mocha": "~5.2.0", + "mocha-eslint": "^4.0.0", + "sax": "~1.2.1" + }, + "scripts": { + "pretest": "npm install && mocha -R spec --timeout 50000 -f jslint", + "test": "mocha -R spec --timeout 50000 -i -f jslint", + "coverage": "istanbul cover ./node_modules/.bin/_mocha -- -R spec --timeout 50000 -i -f jslint && coveralls < ./coverage/lcov.info" + } +} diff --git a/test/benchmark/opened.mml b/test/benchmark/opened.mml new file mode 100644 index 0000000..e5ce4ee --- /dev/null +++ b/test/benchmark/opened.mml @@ -0,0 +1,15 @@ +{ + "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", + "Stylesheet": [ + "opened.mss" + ], + "Layer": [{ + "id": "data", + "name": "data", + "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", + "Datasource": { + "file": "http://client-data.s3.amazonaws.com/ndi-afghanistan/district_boundaries.zip", + "type": "shape" + } + }] +} diff --git a/test/benchmark/opened.mss b/test/benchmark/opened.mss new file mode 100644 index 0000000..ecb6d3e --- /dev/null +++ b/test/benchmark/opened.mss @@ -0,0 +1,2392 @@ +#data[Dist_ID = 1001] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1002] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1003] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1004] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1005] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1006] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1007] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 101] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 102] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 103] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 104] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 105] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 106] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 107] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 108] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 109] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 110] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1101] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1102] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1103] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1104] { + polygon-fill: #E30; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1105] { + polygon-fill: #E30; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1106] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1107] { + polygon-fill: #E30; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1108] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1109] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 111] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1110] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1111] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1112] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1113] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1114] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1115] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1116] { + polygon-fill: #E30; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1117] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1118] { + polygon-fill: #E30; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1119] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 112] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 113] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 114] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 115] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1201] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1202] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1203] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1204] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1205] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1206] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1207] { + polygon-fill: #E30; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1208] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1209] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1210] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1211] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1301] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1302] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1303] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1304] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1305] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1306] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1307] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1308] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1309] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1310] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1311] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1312] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1313] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1314] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1315] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1401] { + polygon-fill: #E30; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1402] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1403] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1404] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1405] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1406] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1407] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1408] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1501] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1502] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1503] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1504] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1505] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1506] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1507] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1508] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1509] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1510] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1511] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1512] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1513] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1514] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1515] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1516] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1517] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1518] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1519] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1520] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1521] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1522] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1523] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1524] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1525] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1526] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1527] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1528] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1601] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1602] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1603] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1604] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1605] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1606] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1607] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1608] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1609] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1610] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1611] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1612] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1613] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1614] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1615] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1616] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1617] { + polygon-fill: #E30; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1701] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1702] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1703] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1704] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1705] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1706] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1707] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1801] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1802] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1803] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1804] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1805] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1806] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1807] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1808] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1809] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1810] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1811] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1812] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1813] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1814] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1815] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1816] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1901] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1902] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1903] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1904] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1905] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1906] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 1907] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2001] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2002] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2003] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2004] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2005] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2006] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2007] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 201] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 202] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 203] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 204] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 205] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 206] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 207] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2101] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2102] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2103] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2104] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2105] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2106] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2107] { + polygon-fill: #E30; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2108] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2109] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2110] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2201] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2202] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2203] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2204] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2205] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2206] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2207] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2208] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2209] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2301] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2302] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2303] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2304] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2305] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2401] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2402] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2403] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2404] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2405] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2406] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2407] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2408] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2409] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2410] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2411] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2501] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2502] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2503] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2504] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2505] { + polygon-fill: #E30; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2506] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2507] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2508] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2509] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2510] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2511] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2512] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2513] { + polygon-fill: #E30; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2514] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2515] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2516] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2517] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2518] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2519] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2601] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2602] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2603] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2604] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2605] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2606] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2607] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2608] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2609] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2610] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2611] { + polygon-fill: #E30; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2612] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2613] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2701] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2702] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2703] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2704] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2705] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2706] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2707] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2708] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2709] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2710] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2711] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2801] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2802] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2803] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2804] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2805] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2806] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2807] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2808] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2809] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2810] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2811] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2812] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2813] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2814] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2901] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2902] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2903] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2904] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2905] { + polygon-fill: #E30; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2906] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 2907] { + polygon-fill: #E30; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3001] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3002] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3003] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3004] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3005] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3006] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3007] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3008] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3009] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 301] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3010] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3011] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3012] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3013] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3014] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3015] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3016] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 302] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 303] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 304] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 305] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 306] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 307] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 308] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 309] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 310] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3101] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3102] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3103] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3104] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3105] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3106] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3107] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3108] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3109] { + polygon-fill: #E30; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3110] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3111] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3201] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3202] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3203] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3204] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3205] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3206] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3207] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3208] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3209] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3210] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3211] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3212] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3213] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3301] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3302] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3303] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3304] { + polygon-fill: #E30; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3305] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3306] { + polygon-fill: #E30; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3307] { + polygon-fill: #E30; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3308] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3309] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3310] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3311] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3312] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3313] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3314] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3315] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3316] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3401] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3402] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3403] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3404] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 3405] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 401] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 402] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 403] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 404] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 405] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 406] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 407] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 408] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 409] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 501] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 502] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 503] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 504] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 505] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 506] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 507] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 601] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 602] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 603] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 604] { + polygon-fill: #E30; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 605] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 606] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 607] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 608] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 609] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 610] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 611] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 612] { + polygon-fill: #F73; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 613] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 614] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 615] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 616] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 617] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 618] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 619] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 620] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 621] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 622] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 701] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 702] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 703] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 704] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 705] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 801] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 802] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 803] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 804] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 805] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 806] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 807] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 901] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 902] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 903] { + polygon-fill: #666; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 904] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 905] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 906] { + polygon-fill: #E30; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 907] { + polygon-fill: #FFF; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 908] { + polygon-fill: #FDC; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 909] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 910] { + polygon-fill: #F96; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 911] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 912] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 913] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 914] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} + + +#data[Dist_ID = 915] { + polygon-fill: #FBA; + polygon-opacity: 0.6; +} diff --git a/test/benchmark/opened.result b/test/benchmark/opened.result new file mode 100644 index 0000000..623f7be --- /dev/null +++ b/test/benchmark/opened.result @@ -0,0 +1,2014 @@ + + + + + + + + data-polygon + + [absolute path] + shape + + + + \ No newline at end of file diff --git a/test/bincarto.test.js b/test/bincarto.test.js new file mode 100644 index 0000000..59e9552 --- /dev/null +++ b/test/bincarto.test.js @@ -0,0 +1,55 @@ +var assert = require('assert'); +var exec = require('child_process').exec; +var path = require('path'); +var util = require('util'); +var helper = require('./support/helper'); +var bin = path.resolve(path.join(__dirname, '..', 'bin', 'carto')); +var fs = require('fs'); + +describe('bin/carto', function() { + it('errors on no input', function(done) { + exec(util.format('node %s', bin), function(err, stdout, stderr) { + assert.equal(1, err.code); + assert.equal("carto: no input files ('carto -h or --help' for help)\n", stderr); + done(); + }); + }); + it('errors on unsupported api version', function(done) { + var file = path.join('test', 'rendering', 'identity.mml'); + var api = '1.0.0'; + exec(util.format('node %s -a %s %s', bin, api, file), function(err, stdout, stderr) { + assert.equal(1, err.code); + assert.equal("Error: Version 1.0.0 is not supported\n", stderr); + done(); + }); + }); + it('errors on wrongly formatted api version', function(done) { + var file = path.join('test', 'rendering', 'identity.mml'); + var api = 'api'; + exec(util.format('node %s -a %s %s', bin, api, file), function(err, stdout, stderr) { + assert.equal(1, err.code); + assert.equal("Error: Invalid API version. A valid version is e.g. 3.0.0 or 3.0.10\n", stderr); + done(); + }); + }); + it('renders mml', function(done) { + var file = path.join('test', 'rendering', 'identity.mml'); + exec(util.format('node %s %s', bin, file), function(err, stdout) { + assert.ifError(err); + helper.compareToXMLFile(helper.resultFile(file), stdout, done, [ + helper.removeAbsoluteImages, + helper.removeAbsoluteDatasources + ]); + }); + }); + it('renders mss', function(done) { + var file = path.join('test', 'rendering-mss', 'empty_name.mss'); + exec(util.format('node %s %s', bin, file), function(err, stdout) { + assert.ifError(err); + var expected = file.replace(path.extname(file),'')+'.xml'; + var expected_data = fs.readFileSync(expected, 'utf8'); + assert.equal(stdout.trim(),expected_data.trim()); + done(); + }); + }); +}); diff --git a/test/color.test.js b/test/color.test.js new file mode 100644 index 0000000..ac246fe --- /dev/null +++ b/test/color.test.js @@ -0,0 +1,25 @@ +var assert = require('assert'); +var tree = require('../lib/carto/tree.js'); +require('../lib/carto/functions'); +require('../lib/carto/tree/color'); +require('../lib/carto/tree/dimension'); + +describe('Color', function() { + describe('basic functionality', function() { + it('should be constructed', function() { + var f = new tree.Color([0, 0, 0], 1); + assert.deepEqual(f.getComponents(), {"h":0,"s":0,"l":0,"a":1,"perceptual":false}); + assert.ok(f); + }); + }); + describe('functions', function() { + it('should be constructed', function() { + assert.deepEqual(tree.functions.rgb(0, 0, 0), new tree.Color([0, 0, 0], 1)); + assert.deepEqual(tree.functions.hue(new tree.Color([0, 0, 0], 1)), new tree.Dimension(0)); + assert.deepEqual(tree.functions.saturation(new tree.Color([0, 0, 0], 1)), new tree.Dimension(0, '%')); + assert.deepEqual(tree.functions.lightness(new tree.Color([0, 0, 0], 1)), new tree.Dimension(0, '%')); + assert.deepEqual(tree.functions.alpha(new tree.Color([0, 0, 0], 1)), new tree.Dimension(1)); + assert.deepEqual(tree.functions.greyscale(new tree.Color([0, 0, 0], 1)), new tree.Color([0, 0, 0], 1)); + }); + }); +}); diff --git a/test/comment.test.js b/test/comment.test.js new file mode 100644 index 0000000..bc6b01e --- /dev/null +++ b/test/comment.test.js @@ -0,0 +1,14 @@ +var assert = require('assert'); +var tree = require('../lib/carto/tree.js'); +require('../lib/carto/tree/comment'); + +describe('Comment', function() { + describe('basic functionality', function() { + it('should be constructed', function() { + var f = new tree.Comment('hello world'); + assert.deepEqual(f.toString(), ''); + assert.deepEqual(f.ev(), f); + assert.ok(f); + }); + }); +}); diff --git a/test/eclint.test.js b/test/eclint.test.js new file mode 100644 index 0000000..cbce110 --- /dev/null +++ b/test/eclint.test.js @@ -0,0 +1,13 @@ +var lint = require('mocha-eslint'); + +describe('jslint', function() { + var paths = [ + 'bin', + 'lib', + 'test' + ]; + + var options = {}; + options.formatter = 'compact'; + lint(paths, options); +}); diff --git a/test/errorhandling.test.js b/test/errorhandling.test.js new file mode 100644 index 0000000..72f35d7 --- /dev/null +++ b/test/errorhandling.test.js @@ -0,0 +1,66 @@ +var path = require('path'), + assert = require('assert'), + fs = require('fs'); + +var carto = require('../lib/carto'), + helper = require('./support/helper'), + util = require('../lib/carto/util'); + +describe('Error handling mml+mss', function() { +helper.files('errorhandling', 'mml', function(file) { + var basename = path.basename(file); + it('should handle errors in ' + basename, function(done) { + helper.mml(file, function (err, mml) { + var output = { + msg: null, + data: null + }; + + if (!err) { + output = new carto.Renderer({ + paths: [ path.dirname(file) ], + data_dir: path.join(__dirname, '../data'), + local_data_dir: path.join(__dirname, 'rendering'), + filename: file + }).render(mml); + } + else { + output.msg = err; + } + // @TODO for some reason, fs.readFile includes an additional \n + // at the end of read files. Determine why. + // fs.writeFileSync(helper.resultFile(file), output); + var data = fs.readFileSync(helper.resultFile(file), 'utf8'); + assert.deepEqual(util.getMessagesToPrint(output.msg), data); + done(); + }); + }); +}); +}); + +describe('Error handling mss', function() { +helper.files('errorhandling', 'mss', function(file) { + var basename = path.basename(file); + if (basename == 'multi_stylesheets_a.mss' || + basename == 'issue_29.mss') { + return; + } + it('should handle errors in ' + basename, function(done) { + var mss = helper.mss(file); + var output = new carto.Renderer({ + paths: [ path.dirname(file) ], + data_dir: path.join(__dirname, '../data'), + local_data_dir: path.join(__dirname, 'rendering'), + // note: we use the basename here so that the expected error result + // will match if the style was loaded from mml + filename: basename + }).renderMSS(mss); + // @TODO for some reason, fs.readFile includes an additional \n + // at the end of read files. Determine why. + // fs.writeFileSync(helper.resultFile(file), output); + var data = fs.readFileSync(helper.resultFile(file), 'utf8'); + assert.deepEqual(util.getMessagesToPrint(output.msg), data); + done(); + }); +}); +}); diff --git a/test/errorhandling/bad_filter.mml b/test/errorhandling/bad_filter.mml new file mode 100644 index 0000000..52ea349 --- /dev/null +++ b/test/errorhandling/bad_filter.mml @@ -0,0 +1,10 @@ +{ + "Layer": [ + { + "id": "a" + } + ], + "Stylesheet": [ + "bad_filter.mss" + ] +} diff --git a/test/errorhandling/bad_filter.mss b/test/errorhandling/bad_filter.mss new file mode 100644 index 0000000..9aa3d27 --- /dev/null +++ b/test/errorhandling/bad_filter.mss @@ -0,0 +1,3 @@ +Map { } +@x: 'X'; +[CODE='X'][CODE!=@x] { } diff --git a/test/errorhandling/bad_filter.result b/test/errorhandling/bad_filter.result new file mode 100644 index 0000000..091bc43 --- /dev/null +++ b/test/errorhandling/bad_filter.result @@ -0,0 +1 @@ +Error: bad_filter.mss:3:10 [[CODE]!=@x] added to [CODE]=X produces an invalid filter \ No newline at end of file diff --git a/test/errorhandling/bad_op.mml b/test/errorhandling/bad_op.mml new file mode 100644 index 0000000..93632ce --- /dev/null +++ b/test/errorhandling/bad_op.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "bad_op.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/errorhandling/bad_op.mss b/test/errorhandling/bad_op.mss new file mode 100644 index 0000000..dac63df --- /dev/null +++ b/test/errorhandling/bad_op.mss @@ -0,0 +1,3 @@ +#world { + line-width: 20% + 2px; +} diff --git a/test/errorhandling/bad_op.result b/test/errorhandling/bad_op.result new file mode 100644 index 0000000..f63dd5d --- /dev/null +++ b/test/errorhandling/bad_op.result @@ -0,0 +1 @@ +Error: bad_op.mss:2:4 If two operands differ, the first must not be % \ No newline at end of file diff --git a/test/errorhandling/bad_op_2.mml b/test/errorhandling/bad_op_2.mml new file mode 100644 index 0000000..1acf819 --- /dev/null +++ b/test/errorhandling/bad_op_2.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "bad_op_2.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/errorhandling/bad_op_2.mss b/test/errorhandling/bad_op_2.mss new file mode 100644 index 0000000..a50ca10 --- /dev/null +++ b/test/errorhandling/bad_op_2.mss @@ -0,0 +1,3 @@ +#world { + line-width: 20px * 2%; +} diff --git a/test/errorhandling/bad_op_2.result b/test/errorhandling/bad_op_2.result new file mode 100644 index 0000000..a06f545 --- /dev/null +++ b/test/errorhandling/bad_op_2.result @@ -0,0 +1 @@ +Error: bad_op_2.mss:2:4 Percent values can only be added or subtracted from other values \ No newline at end of file diff --git a/test/errorhandling/color_functions.mml b/test/errorhandling/color_functions.mml new file mode 100644 index 0000000..5440f61 --- /dev/null +++ b/test/errorhandling/color_functions.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "color_functions.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/errorhandling/color_functions.mss b/test/errorhandling/color_functions.mss new file mode 100644 index 0000000..fab6235 --- /dev/null +++ b/test/errorhandling/color_functions.mss @@ -0,0 +1,4 @@ +@foo: 'bar'; +#world { + polygon-fill: hsl(1, @foo, 3); +} diff --git a/test/errorhandling/color_functions.result b/test/errorhandling/color_functions.result new file mode 100644 index 0000000..b9b8085 --- /dev/null +++ b/test/errorhandling/color_functions.result @@ -0,0 +1 @@ +Error: color_functions.mss:3:31 incorrect arguments given to hsl() \ No newline at end of file diff --git a/test/errorhandling/contradiction.mml b/test/errorhandling/contradiction.mml new file mode 100644 index 0000000..8f47e6b --- /dev/null +++ b/test/errorhandling/contradiction.mml @@ -0,0 +1,15 @@ +{ + "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", + "Stylesheet": [ + "contradiction.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/district.geojson", + "type": "ogr", + "layer": "OGRGeoJSON" + } + }] +} diff --git a/test/errorhandling/contradiction.mss b/test/errorhandling/contradiction.mss new file mode 100644 index 0000000..648bf1f --- /dev/null +++ b/test/errorhandling/contradiction.mss @@ -0,0 +1,3 @@ +#world[FeatureCla!=""][FeatureCla=""] { + polygon-fill: #fff; +} diff --git a/test/errorhandling/contradiction.result b/test/errorhandling/contradiction.result new file mode 100644 index 0000000..39f168f --- /dev/null +++ b/test/errorhandling/contradiction.result @@ -0,0 +1 @@ +Error: contradiction.mss:1:37 [[FeatureCla]=] added to [FeatureCla]!= produces an invalid filter \ No newline at end of file diff --git a/test/errorhandling/contradiction_2.mss b/test/errorhandling/contradiction_2.mss new file mode 100644 index 0000000..2aaa907 --- /dev/null +++ b/test/errorhandling/contradiction_2.mss @@ -0,0 +1,3 @@ +#world[FeatureCla=""][FeatureCla!=""] { + polygon-fill: #fff; +} diff --git a/test/errorhandling/contradiction_2.result b/test/errorhandling/contradiction_2.result new file mode 100644 index 0000000..b6e7607 --- /dev/null +++ b/test/errorhandling/contradiction_2.result @@ -0,0 +1 @@ +Error: contradiction_2.mss:1:37 [[FeatureCla]!=] added to [FeatureCla]= produces an invalid filter \ No newline at end of file diff --git a/test/errorhandling/function_args.mml b/test/errorhandling/function_args.mml new file mode 100644 index 0000000..df092cc --- /dev/null +++ b/test/errorhandling/function_args.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "function_args.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/errorhandling/function_args.mss b/test/errorhandling/function_args.mss new file mode 100644 index 0000000..f3ad8e2 --- /dev/null +++ b/test/errorhandling/function_args.mss @@ -0,0 +1,4 @@ +#world { + point-transform: scale(2, 2); + image-filters: agg-stack-blu(2, 1); +} diff --git a/test/errorhandling/function_args.result b/test/errorhandling/function_args.result new file mode 100644 index 0000000..2ed5f44 --- /dev/null +++ b/test/errorhandling/function_args.result @@ -0,0 +1 @@ +Error: function_args.mss:3:38 unknown function agg-stack-blu(), did you mean agg-stack-blur(2) \ No newline at end of file diff --git a/test/errorhandling/invalid_attachment.mml b/test/errorhandling/invalid_attachment.mml new file mode 100644 index 0000000..ca10826 --- /dev/null +++ b/test/errorhandling/invalid_attachment.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "invalid_attachment.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/errorhandling/invalid_attachment.mss b/test/errorhandling/invalid_attachment.mss new file mode 100644 index 0000000..35dc2da --- /dev/null +++ b/test/errorhandling/invalid_attachment.mss @@ -0,0 +1,3 @@ +#world::test::test2 { + polygon-fill: #f00; +} diff --git a/test/errorhandling/invalid_attachment.result b/test/errorhandling/invalid_attachment.result new file mode 100644 index 0000000..d9a7f9f --- /dev/null +++ b/test/errorhandling/invalid_attachment.result @@ -0,0 +1 @@ +Error: invalid_attachment.mss:1:19 Encountered second attachment name. \ No newline at end of file diff --git a/test/errorhandling/invalid_color_in_fn.mss b/test/errorhandling/invalid_color_in_fn.mss new file mode 100644 index 0000000..235d06c --- /dev/null +++ b/test/errorhandling/invalid_color_in_fn.mss @@ -0,0 +1,3 @@ +#world { + polygon-fill: spin(#f00f00f, 10); +} diff --git a/test/errorhandling/invalid_color_in_fn.result b/test/errorhandling/invalid_color_in_fn.result new file mode 100644 index 0000000..5ae1ef9 --- /dev/null +++ b/test/errorhandling/invalid_color_in_fn.result @@ -0,0 +1 @@ +Error: invalid_color_in_fn.mss:2:34 incorrect arguments given to spin() \ No newline at end of file diff --git a/test/errorhandling/invalid_property.mml b/test/errorhandling/invalid_property.mml new file mode 100644 index 0000000..99c7d91 --- /dev/null +++ b/test/errorhandling/invalid_property.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "invalid_property.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/errorhandling/invalid_property.mss b/test/errorhandling/invalid_property.mss new file mode 100644 index 0000000..02b72d9 --- /dev/null +++ b/test/errorhandling/invalid_property.mss @@ -0,0 +1,4 @@ +#world[zoom=5] { + polygon-fill: #f00; + polygonopacity: 0.5; +} diff --git a/test/errorhandling/invalid_property.result b/test/errorhandling/invalid_property.result new file mode 100644 index 0000000..0104058 --- /dev/null +++ b/test/errorhandling/invalid_property.result @@ -0,0 +1 @@ +Error: invalid_property.mss:3:2 Unrecognized rule: polygonopacity. Did you mean polygon-opacity? \ No newline at end of file diff --git a/test/errorhandling/invalid_value.mml b/test/errorhandling/invalid_value.mml new file mode 100644 index 0000000..4a97c1e --- /dev/null +++ b/test/errorhandling/invalid_value.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "invalid_value.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/errorhandling/invalid_value.mss b/test/errorhandling/invalid_value.mss new file mode 100644 index 0000000..eb60b56 --- /dev/null +++ b/test/errorhandling/invalid_value.mss @@ -0,0 +1,4 @@ +#world[zoom=5] { + text-face-name: 2; + text-name: 'foo'; +} diff --git a/test/errorhandling/invalid_value.result b/test/errorhandling/invalid_value.result new file mode 100644 index 0000000..56819fb --- /dev/null +++ b/test/errorhandling/invalid_value.result @@ -0,0 +1 @@ +Error: invalid_value.mss:2:2 Invalid value for text-face-name, the type font is expected. 2 (of type float) was given. \ No newline at end of file diff --git a/test/errorhandling/invaliddimension.mml b/test/errorhandling/invaliddimension.mml new file mode 100644 index 0000000..9185d6c --- /dev/null +++ b/test/errorhandling/invaliddimension.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "invaliddimension.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/errorhandling/invaliddimension.mss b/test/errorhandling/invaliddimension.mss new file mode 100644 index 0000000..d753c13 --- /dev/null +++ b/test/errorhandling/invaliddimension.mss @@ -0,0 +1,3 @@ +#world { + line-width: 10wifflewaffles; +} diff --git a/test/errorhandling/invaliddimension.result b/test/errorhandling/invaliddimension.result new file mode 100644 index 0000000..955ddcb --- /dev/null +++ b/test/errorhandling/invaliddimension.result @@ -0,0 +1 @@ +Error: invaliddimension.mss:2:4 Invalid unit: 'wifflewaffles' \ No newline at end of file diff --git a/test/errorhandling/issue119.mml b/test/errorhandling/issue119.mml new file mode 100644 index 0000000..3d51b97 --- /dev/null +++ b/test/errorhandling/issue119.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "issue119.mss" + ], + "Layer": [{ + "id": "countries", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/errorhandling/issue119.mss b/test/errorhandling/issue119.mss new file mode 100644 index 0000000..2781cb4 --- /dev/null +++ b/test/errorhandling/issue119.mss @@ -0,0 +1,3 @@ +#countries { + background-color:#f00; +} diff --git a/test/errorhandling/issue119.result b/test/errorhandling/issue119.result new file mode 100644 index 0000000..e0ec901 --- /dev/null +++ b/test/errorhandling/issue119.result @@ -0,0 +1 @@ +Error: issue119.mss:2:2 Map properties are not permitted in other rules \ No newline at end of file diff --git a/test/errorhandling/issue123.mml b/test/errorhandling/issue123.mml new file mode 100644 index 0000000..d53b316 --- /dev/null +++ b/test/errorhandling/issue123.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "issue123.mss" + ], + "Layer": [{ + "id": "countries", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/errorhandling/issue123.mss b/test/errorhandling/issue123.mss new file mode 100644 index 0000000..5c010e4 --- /dev/null +++ b/test/errorhandling/issue123.mss @@ -0,0 +1,8 @@ +#countries { + ::outline { + line-color: darken(#85c5d3); + line-width: 2; + line-join: round; + } + polygon-fill: #fff; +} diff --git a/test/errorhandling/issue123.result b/test/errorhandling/issue123.result new file mode 100644 index 0000000..e397688 --- /dev/null +++ b/test/errorhandling/issue123.result @@ -0,0 +1 @@ +Error: issue123.mss:3:31 incorrect number of arguments for darken(). 2 expected. \ No newline at end of file diff --git a/test/errorhandling/issue124.mml b/test/errorhandling/issue124.mml new file mode 100644 index 0000000..0268a32 --- /dev/null +++ b/test/errorhandling/issue124.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "issue124.mss" + ], + "Layer": [{ + "id": "countries", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/errorhandling/issue124.mss b/test/errorhandling/issue124.mss new file mode 100644 index 0000000..2dca68b --- /dev/null +++ b/test/errorhandling/issue124.mss @@ -0,0 +1,5 @@ +#countries { + [NAME = 14]{ + polygon-pattern-file: url(stripe8.png; + } +} diff --git a/test/errorhandling/issue124.result b/test/errorhandling/issue124.result new file mode 100644 index 0000000..be915ba --- /dev/null +++ b/test/errorhandling/issue124.result @@ -0,0 +1 @@ +Error: issue124.mss:6:0 missing closing `}` \ No newline at end of file diff --git a/test/errorhandling/issue165.mml b/test/errorhandling/issue165.mml new file mode 100644 index 0000000..b3db1f8 --- /dev/null +++ b/test/errorhandling/issue165.mml @@ -0,0 +1,12 @@ +{ + "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", + "Stylesheet": [ + ], + "Layer": [{ + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/errorhandling/issue165.result b/test/errorhandling/issue165.result new file mode 100644 index 0000000..a60d63f --- /dev/null +++ b/test/errorhandling/issue165.result @@ -0,0 +1 @@ +Error: The id attribute is required for layers. \ No newline at end of file diff --git a/test/errorhandling/issue297.mml b/test/errorhandling/issue297.mml new file mode 100644 index 0000000..b6076c3 --- /dev/null +++ b/test/errorhandling/issue297.mml @@ -0,0 +1,8 @@ +{ + "Stylesheet": [ + "issue297.mss" + ], + "Layer": [{ + "id": "t" + }] +} diff --git a/test/errorhandling/issue297.mss b/test/errorhandling/issue297.mss new file mode 100644 index 0000000..04629a7 --- /dev/null +++ b/test/errorhandling/issue297.mss @@ -0,0 +1,4 @@ +#t { + text-name: valid; + text-face-name: 2; +} diff --git a/test/errorhandling/issue297.result b/test/errorhandling/issue297.result new file mode 100644 index 0000000..c99a299 --- /dev/null +++ b/test/errorhandling/issue297.result @@ -0,0 +1 @@ +Error: issue297.mss:3:2 Invalid value for text-face-name, the type font is expected. 2 (of type float) was given. \ No newline at end of file diff --git a/test/errorhandling/issue_204_a.mss b/test/errorhandling/issue_204_a.mss new file mode 100644 index 0000000..3fce78a --- /dev/null +++ b/test/errorhandling/issue_204_a.mss @@ -0,0 +1,3 @@ +#countries { + polygon-fill: green; +}} \ No newline at end of file diff --git a/test/errorhandling/issue_204_a.result b/test/errorhandling/issue_204_a.result new file mode 100644 index 0000000..f2d5cec --- /dev/null +++ b/test/errorhandling/issue_204_a.result @@ -0,0 +1 @@ +Error: issue_204_a.mss:3:1 missing opening `{` \ No newline at end of file diff --git a/test/errorhandling/issue_204_b.mss b/test/errorhandling/issue_204_b.mss new file mode 100644 index 0000000..2f7bb39 --- /dev/null +++ b/test/errorhandling/issue_204_b.mss @@ -0,0 +1,3 @@ +#countries { + polygon-fill: green; +}} \ No newline at end of file diff --git a/test/errorhandling/issue_204_b.result b/test/errorhandling/issue_204_b.result new file mode 100644 index 0000000..7f1968d --- /dev/null +++ b/test/errorhandling/issue_204_b.result @@ -0,0 +1 @@ +Error: issue_204_b.mss:3:3 missing opening `{` \ No newline at end of file diff --git a/test/errorhandling/issue_204_c.mss b/test/errorhandling/issue_204_c.mss new file mode 100644 index 0000000..e81b795 --- /dev/null +++ b/test/errorhandling/issue_204_c.mss @@ -0,0 +1,3 @@ +#countries { + polygon-fill: green; +}} diff --git a/test/errorhandling/issue_204_c.result b/test/errorhandling/issue_204_c.result new file mode 100644 index 0000000..88a2328 --- /dev/null +++ b/test/errorhandling/issue_204_c.result @@ -0,0 +1 @@ +Error: issue_204_c.mss:4:0 missing opening `{` \ No newline at end of file diff --git a/test/errorhandling/issue_218.mss b/test/errorhandling/issue_218.mss new file mode 100644 index 0000000..ad67e3f --- /dev/null +++ b/test/errorhandling/issue_218.mss @@ -0,0 +1,5 @@ +#country-label { + [one = 2] + marker-width:1; + } +} \ No newline at end of file diff --git a/test/errorhandling/issue_218.result b/test/errorhandling/issue_218.result new file mode 100644 index 0000000..7f66466 --- /dev/null +++ b/test/errorhandling/issue_218.result @@ -0,0 +1 @@ +Error: issue_218.mss:5:2 missing opening `{` \ No newline at end of file diff --git a/test/errorhandling/issue_29.mml b/test/errorhandling/issue_29.mml new file mode 100644 index 0000000..a47cc70 --- /dev/null +++ b/test/errorhandling/issue_29.mml @@ -0,0 +1,12 @@ +{ + "name": "", + "scale": 1, + "Stylesheet": [ + "issue_29.mss" + ], + "Layer": [ + { + "id": "test" + } + ] +} diff --git a/test/errorhandling/issue_29.mss b/test/errorhandling/issue_29.mss new file mode 100644 index 0000000..fbfb21e --- /dev/null +++ b/test/errorhandling/issue_29.mss @@ -0,0 +1,3 @@ +#bla { + marker-fill: black; +} diff --git a/test/errorhandling/issue_29.result b/test/errorhandling/issue_29.result new file mode 100644 index 0000000..52e585a --- /dev/null +++ b/test/errorhandling/issue_29.result @@ -0,0 +1,2 @@ +Warning: Layer test has no styles associated with it. +Warning: issue_29.mss:2:4 Styles do not match layer selector #bla. \ No newline at end of file diff --git a/test/errorhandling/issue_462.mss b/test/errorhandling/issue_462.mss new file mode 100644 index 0000000..36fe49b --- /dev/null +++ b/test/errorhandling/issue_462.mss @@ -0,0 +1,6 @@ +#test { + shield: auto; + text: auto; + line-pattern: auto; + polygon-pattern: auto; +} diff --git a/test/errorhandling/issue_462.result b/test/errorhandling/issue_462.result new file mode 100644 index 0000000..511a6c0 --- /dev/null +++ b/test/errorhandling/issue_462.result @@ -0,0 +1,8 @@ +Warning: issue_462.mss:2:4 shield is unstable. It may change in the future. +Error: issue_462.mss:2:4 Invalid value for shield, the type keyword (options: none) is expected. auto (of type keyword) was given. +Warning: issue_462.mss:3:4 text is unstable. It may change in the future. +Error: issue_462.mss:3:4 Invalid value for text, the type keyword (options: none) is expected. auto (of type keyword) was given. +Warning: issue_462.mss:4:4 line-pattern is unstable. It may change in the future. +Error: issue_462.mss:4:4 Invalid value for line-pattern, the type keyword (options: none) is expected. auto (of type keyword) was given. +Warning: issue_462.mss:5:4 polygon-pattern is unstable. It may change in the future. +Error: issue_462.mss:5:4 Invalid value for polygon-pattern, the type keyword (options: none) is expected. auto (of type keyword) was given. \ No newline at end of file diff --git a/test/errorhandling/issue_474.mss b/test/errorhandling/issue_474.mss new file mode 100644 index 0000000..14aa32a --- /dev/null +++ b/test/errorhandling/issue_474.mss @@ -0,0 +1,7 @@ +#test { + marker-type: ellipse; + line-offset: 2; + text-name: [name]; + text-face-name: Arial; + text-largest-bbox-only: true; +} diff --git a/test/errorhandling/issue_474.result b/test/errorhandling/issue_474.result new file mode 100644 index 0000000..9ccd316 --- /dev/null +++ b/test/errorhandling/issue_474.result @@ -0,0 +1,3 @@ +Warning: issue_474.mss:2:4 marker-type is deprecated. It may be removed in the future. +Warning: issue_474.mss:3:4 line-offset is unstable. It may change in the future. +Warning: issue_474.mss:6:4 text-largest-bbox-only is experimental. It may change, be renamed or removed in the future. \ No newline at end of file diff --git a/test/errorhandling/mapnik_keyword.mml b/test/errorhandling/mapnik_keyword.mml new file mode 100644 index 0000000..ec9e1fe --- /dev/null +++ b/test/errorhandling/mapnik_keyword.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "mapnik_keyword.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/errorhandling/mapnik_keyword.mss b/test/errorhandling/mapnik_keyword.mss new file mode 100644 index 0000000..86f6477 --- /dev/null +++ b/test/errorhandling/mapnik_keyword.mss @@ -0,0 +1,3 @@ +#world[[FOO]=nul] { + line-width:2; +} diff --git a/test/errorhandling/mapnik_keyword.result b/test/errorhandling/mapnik_keyword.result new file mode 100644 index 0000000..30cdefa --- /dev/null +++ b/test/errorhandling/mapnik_keyword.result @@ -0,0 +1 @@ +Error: mapnik_keyword.mss:1:6 nul is not a valid keyword in a filter expression \ No newline at end of file diff --git a/test/errorhandling/missing_close.mml b/test/errorhandling/missing_close.mml new file mode 100644 index 0000000..fb79a63 --- /dev/null +++ b/test/errorhandling/missing_close.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "missing_close.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/errorhandling/missing_close.mss b/test/errorhandling/missing_close.mss new file mode 100644 index 0000000..9f2efe1 --- /dev/null +++ b/test/errorhandling/missing_close.mss @@ -0,0 +1,4 @@ +#world[natural="water" +{ + polygon-fill: blue; +} diff --git a/test/errorhandling/missing_close.result b/test/errorhandling/missing_close.result new file mode 100644 index 0000000..64da572 --- /dev/null +++ b/test/errorhandling/missing_close.result @@ -0,0 +1 @@ +Error: missing_close.mss:1:5 Missing closing ] of filter. \ No newline at end of file diff --git a/test/errorhandling/multi_stylesheets.mml b/test/errorhandling/multi_stylesheets.mml new file mode 100644 index 0000000..867978c --- /dev/null +++ b/test/errorhandling/multi_stylesheets.mml @@ -0,0 +1,15 @@ +{ + "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", + "Stylesheet": [ + "multi_stylesheets_b.mss", + "multi_stylesheets_a.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/errorhandling/multi_stylesheets.result b/test/errorhandling/multi_stylesheets.result new file mode 100644 index 0000000..678d384 --- /dev/null +++ b/test/errorhandling/multi_stylesheets.result @@ -0,0 +1 @@ +Error: multi_stylesheets_b.mss:2:2 Unrecognized rule: polygonopacity. Did you mean polygon-opacity? \ No newline at end of file diff --git a/test/errorhandling/multi_stylesheets_a.mss b/test/errorhandling/multi_stylesheets_a.mss new file mode 100644 index 0000000..2db5417 --- /dev/null +++ b/test/errorhandling/multi_stylesheets_a.mss @@ -0,0 +1,6 @@ +#world { + polygon-opacity: 0.5; + line-width:4; + line-color:#fff; + line-opacity:0.3; +} diff --git a/test/errorhandling/multi_stylesheets_b.mss b/test/errorhandling/multi_stylesheets_b.mss new file mode 100644 index 0000000..0c58439 --- /dev/null +++ b/test/errorhandling/multi_stylesheets_b.mss @@ -0,0 +1,3 @@ +#world { + polygonopacity: 0.5; +} diff --git a/test/errorhandling/multi_stylesheets_b.result b/test/errorhandling/multi_stylesheets_b.result new file mode 100644 index 0000000..678d384 --- /dev/null +++ b/test/errorhandling/multi_stylesheets_b.result @@ -0,0 +1 @@ +Error: multi_stylesheets_b.mss:2:2 Unrecognized rule: polygonopacity. Did you mean polygon-opacity? \ No newline at end of file diff --git a/test/errorhandling/no_stylesheet.mml b/test/errorhandling/no_stylesheet.mml new file mode 100644 index 0000000..7b79e7a --- /dev/null +++ b/test/errorhandling/no_stylesheet.mml @@ -0,0 +1,7 @@ +{ + "Layer": [ + { + "id": "a" + } + ] +} diff --git a/test/errorhandling/no_stylesheet.result b/test/errorhandling/no_stylesheet.result new file mode 100644 index 0000000..4ef899d --- /dev/null +++ b/test/errorhandling/no_stylesheet.result @@ -0,0 +1 @@ +Error: Expecting a Stylesheet property containing an (array of) stylesheet object(s) of the form { id: 'x', 'data': 'y' }. \ No newline at end of file diff --git a/test/errorhandling/nopound.mml b/test/errorhandling/nopound.mml new file mode 100644 index 0000000..3e34689 --- /dev/null +++ b/test/errorhandling/nopound.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "nopound.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/errorhandling/nopound.mss b/test/errorhandling/nopound.mss new file mode 100644 index 0000000..32bc8d3 --- /dev/null +++ b/test/errorhandling/nopound.mss @@ -0,0 +1,8 @@ +world { + ::outline { + line-color: #85c5d3; + line-width: 2; + line-join: round; + } + polygon-fill: #fff; +} diff --git a/test/errorhandling/nopound.result b/test/errorhandling/nopound.result new file mode 100644 index 0000000..973453f --- /dev/null +++ b/test/errorhandling/nopound.result @@ -0,0 +1 @@ +Error: nopound.mss:1:0 Invalid code: world { \ No newline at end of file diff --git a/test/errorhandling/notenoughargs.mml b/test/errorhandling/notenoughargs.mml new file mode 100644 index 0000000..578fdd5 --- /dev/null +++ b/test/errorhandling/notenoughargs.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "notenoughargs.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/errorhandling/notenoughargs.mss b/test/errorhandling/notenoughargs.mss new file mode 100644 index 0000000..e123edb --- /dev/null +++ b/test/errorhandling/notenoughargs.mss @@ -0,0 +1,8 @@ +#world { + ::outline { + line-color: darken(#85c5d3); + line-width: 2; + line-join: round; + } + polygon-fill: #fff; +} diff --git a/test/errorhandling/notenoughargs.result b/test/errorhandling/notenoughargs.result new file mode 100644 index 0000000..375fc19 --- /dev/null +++ b/test/errorhandling/notenoughargs.result @@ -0,0 +1 @@ +Error: notenoughargs.mss:3:31 incorrect number of arguments for darken(). 2 expected. \ No newline at end of file diff --git a/test/errorhandling/stylesheet_absolute_file.mml b/test/errorhandling/stylesheet_absolute_file.mml new file mode 100644 index 0000000..a1fec3b --- /dev/null +++ b/test/errorhandling/stylesheet_absolute_file.mml @@ -0,0 +1,5 @@ +{ + "Stylesheet": [ + "/home/test/test.mss" + ] +} diff --git a/test/errorhandling/stylesheet_absolute_file.result b/test/errorhandling/stylesheet_absolute_file.result new file mode 100644 index 0000000..b6f7ad6 --- /dev/null +++ b/test/errorhandling/stylesheet_absolute_file.result @@ -0,0 +1 @@ +Error: Failed to load file /home/test/test.mss. \ No newline at end of file diff --git a/test/errorhandling/stylesheet_absolute_file_syswin.result b/test/errorhandling/stylesheet_absolute_file_syswin.result new file mode 100644 index 0000000..d244a3e --- /dev/null +++ b/test/errorhandling/stylesheet_absolute_file_syswin.result @@ -0,0 +1 @@ +Error: Failed to load file C:\home\test\test.mss. \ No newline at end of file diff --git a/test/errorhandling/stylesheet_no_data.mml b/test/errorhandling/stylesheet_no_data.mml new file mode 100644 index 0000000..7df69e2 --- /dev/null +++ b/test/errorhandling/stylesheet_no_data.mml @@ -0,0 +1,10 @@ +{ + "Layer": [ + { + "id": "a" + } + ], + "Stylesheet": [{ + "id": "b" + }] +} diff --git a/test/errorhandling/stylesheet_no_data.result b/test/errorhandling/stylesheet_no_data.result new file mode 100644 index 0000000..2a170a2 --- /dev/null +++ b/test/errorhandling/stylesheet_no_data.result @@ -0,0 +1 @@ +Error: Expecting a stylesheet object of the form { id: 'x', 'data': 'y' } for the Stylesheet property. \ No newline at end of file diff --git a/test/errorhandling/stylesheet_no_id.mml b/test/errorhandling/stylesheet_no_id.mml new file mode 100644 index 0000000..57ded32 --- /dev/null +++ b/test/errorhandling/stylesheet_no_id.mml @@ -0,0 +1,10 @@ +{ + "Layer": [ + { + "id": "a" + } + ], + "Stylesheet": [{ + "data": "test" + }] +} diff --git a/test/errorhandling/stylesheet_no_id.result b/test/errorhandling/stylesheet_no_id.result new file mode 100644 index 0000000..2a170a2 --- /dev/null +++ b/test/errorhandling/stylesheet_no_id.result @@ -0,0 +1 @@ +Error: Expecting a stylesheet object of the form { id: 'x', 'data': 'y' } for the Stylesheet property. \ No newline at end of file diff --git a/test/errorhandling/undefined_variable.mml b/test/errorhandling/undefined_variable.mml new file mode 100644 index 0000000..74880a8 --- /dev/null +++ b/test/errorhandling/undefined_variable.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "undefined_variable.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/errorhandling/undefined_variable.mss b/test/errorhandling/undefined_variable.mss new file mode 100644 index 0000000..15789b0 --- /dev/null +++ b/test/errorhandling/undefined_variable.mss @@ -0,0 +1,5 @@ +#world[zoom=5] { + polygon-fill: @something; + line-color: @something + #111; + marker-fill: darken(@something, 10); +} diff --git a/test/errorhandling/undefined_variable.result b/test/errorhandling/undefined_variable.result new file mode 100644 index 0000000..70e9e2a --- /dev/null +++ b/test/errorhandling/undefined_variable.result @@ -0,0 +1,3 @@ +Error: undefined_variable.mss:2:16 variable @something is undefined +Error: undefined_variable.mss:3:14 variable @something is undefined +Error: undefined_variable.mss:4:22 variable @something is undefined \ No newline at end of file diff --git a/test/errorhandling/zoom_as_var.mml b/test/errorhandling/zoom_as_var.mml new file mode 100644 index 0000000..6202d59 --- /dev/null +++ b/test/errorhandling/zoom_as_var.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "zoom_as_var.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/errorhandling/zoom_as_var.mss b/test/errorhandling/zoom_as_var.mss new file mode 100644 index 0000000..98baa8c --- /dev/null +++ b/test/errorhandling/zoom_as_var.mss @@ -0,0 +1,3 @@ +#world[zoom=5] { + polygon-opacity: zoom / 0.5; +} diff --git a/test/errorhandling/zoom_as_var.result b/test/errorhandling/zoom_as_var.result new file mode 100644 index 0000000..b3eb277 --- /dev/null +++ b/test/errorhandling/zoom_as_var.result @@ -0,0 +1 @@ +Error: zoom_as_var.mss:2:2 Cannot do math with type keyword. \ No newline at end of file diff --git a/test/errorhandling/zoommax.mml b/test/errorhandling/zoommax.mml new file mode 100644 index 0000000..464abc7 --- /dev/null +++ b/test/errorhandling/zoommax.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "zoommax.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/errorhandling/zoommax.mss b/test/errorhandling/zoommax.mss new file mode 100644 index 0000000..5c23489 --- /dev/null +++ b/test/errorhandling/zoommax.mss @@ -0,0 +1,3 @@ +#world[zoom > 40] { + polygon-fill: #fff; +} diff --git a/test/errorhandling/zoommax.result b/test/errorhandling/zoommax.result new file mode 100644 index 0000000..2e8453e --- /dev/null +++ b/test/errorhandling/zoommax.result @@ -0,0 +1 @@ +Error: zoommax.mss:1:6 Only zoom levels between 0 and 25 supported. \ No newline at end of file diff --git a/test/field.test.js b/test/field.test.js new file mode 100644 index 0000000..66db99d --- /dev/null +++ b/test/field.test.js @@ -0,0 +1,18 @@ +var assert = require('assert'); +var tree = require('../lib/carto/tree.js'); +require('../lib/carto/tree/field'); + +describe('Field', function() { + describe('basic functionality', function() { + it('should be constructed', function() { + var f = new tree.Field("foo"); + assert.ok(f); + assert.equal(f.is, 'field'); + }); + it('should produce xml-friendly output', function() { + var f = new tree.Field("bar"); + assert.ok(f); + assert.equal(f.toString(), "[bar]"); + }); + }); +}); diff --git a/test/filter.test.js b/test/filter.test.js new file mode 100644 index 0000000..e223bc2 --- /dev/null +++ b/test/filter.test.js @@ -0,0 +1,26 @@ +var assert = require('assert'); +var tree = require('../lib/carto/tree.js'); +require('../lib/carto/tree/field'); +require('../lib/carto/tree/dimension'); +require('../lib/carto/tree/filter'); + +describe('Field', function() { + describe('basic functionality', function() { + var ref = new tree.Reference(); + ref.setVersion(ref.getLatest()); + it('should be constructed', function() { + var f = new tree.Filter(new tree.Field('foo'), '=', new tree.Dimension(1)); + assert.ok(f); + }); + it('can be evaluated', function() { + var f = new tree.Filter(new tree.Field('foo'), '=', new tree.Dimension(1)); + f.ev({ ref: ref }); + assert.ok(f); + }); + it('yields object', function() { + var f = new tree.Filter(new tree.Field('foo'), '=', new tree.Dimension(1)); + f.ev({ ref: ref }); + assert.equal(f.toObject({ ref: ref }), '[foo] = 1'); + }); + }); +}); diff --git a/test/filterset.test.js b/test/filterset.test.js new file mode 100644 index 0000000..cfdca17 --- /dev/null +++ b/test/filterset.test.js @@ -0,0 +1,280 @@ +var assert = require('assert'); +var tree = require('../lib/carto/tree.js'); +require('../lib/carto/tree/filterset'); + +describe('Filtersets', function() { + describe('basic functionality', function() { + it('should be constructed', function() { + var f = new tree.Filterset(); + assert.ok(f); + assert.ok(f.filters); + }); + it('yields object', function() { + var f = new tree.Filterset(); + assert.deepEqual(f.toObject({}), {}); + }); + it('yields a clone', function() { + var f = new tree.Filterset(); + assert.ok(f.clone() instanceof tree.Filterset); + }); + }); + + describe('should add filters correctly', function() { + it('adding to empty set', function() { + var f = new tree.Filterset(); + assert.ok(true === f.addable({ key: 'TOTAL', op: '=', val: '11' }), '=11'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '!=', val: '90' }), '!=90'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '>', val: 9 }), '>9'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '>=', val: 9 }), '>=9'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '<', val: 90 }), '<90'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '<=', val: 90 }), '<=90'); + }); + + it('adding to set with one and same key', function() { + var f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '=', val: '11' }); + assert.ok(null === f.addable({ key: 'TOTAL', op: '=', val: '11' }), '=11 =11'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '!=', val: '90' }), '=11 !=90'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '>', val: '9' }), '=11 >9'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '>=', val: '9' }), '=11 >=9'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '<', val: '90' }), '=11 <90'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '<=', val: '90' }), '=11 <=90'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '=', val: '90' }), '=11 =90'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '!=', val: '11' }), '=11 !=11'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '>', val: 90 }), '=11 >90'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '>=', val: 90 }), '=11 >=90'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '<', val: 9 }), '=11 <9'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '<=', val: 9 }), '=11 <=9'); + }); + + it('adding to set with one and same key and !=', function() { + var f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '!=', val: '11' }); + assert.ok(false === f.addable({ key: 'TOTAL', op: '=', val: '11' }), '!=11 =11'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '!=', val: '11' }), '!=11 !=11'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '!=', val: '9' }), '!=11 !=9'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '!=', val: '90' }), '!=11 !=90'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '>', val: 9 }), '!=11 >9'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '>=', val: 9 }), '!=11 >=9'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '>', val: 90 }), '!=11 >90'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '>=', val: 90 }), '!=11 >=90'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '<', val: 9 }), '!=11 <9'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '<=', val: 9 }), '!=11 <=9'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '<', val: 90 }), '!=11 <90'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '<=', val: 90 }), '!=11 <=90'); + }); + + it('adding to set with one and same key and >', function() { + var f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '>', val: 11 }); + assert.ok(false === f.addable({ key: 'TOTAL', op: '=', val: '11' }), '>11 =11'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '!=', val: '11' }), '>11 !=11'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '>', val: 11 }), '>11 >11'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '>=', val: 11 }), '>11 >=11'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '<', val: 11 }), '>11 <11'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '<=', val: 11 }), '>11 <=11'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '=', val: '90' }), '>11 =90'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '!=', val: '90' }), '>11 !=90'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '>', val: 90 }), '>11 >90'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '>=', val: 90 }), '>11 >=90'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '<', val: 90 }), '>11 <90'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '<=', val: 90 }), '>11 <=90'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '=', val: '9' }), '>11 =9'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '!=', val: '9' }), '>11 !=9'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '>', val: 9 }), '>11 >9'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '>=', val: 9 }), '>11 >=9'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '<', val: 9 }), '>11 <9'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '<=', val: 9 }), '>11 <=9'); + }); + + it('adding to set with one and same key and >=', function() { + var f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '>=', val: 11 }); + assert.ok(true === f.addable({ key: 'TOTAL', op: '=', val: '11' }), '>=11 =11'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '!=', val: '11' }), '>=11 !=11'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '>', val: 11 }), '>=11 >11'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '>=', val: 11 }), '>=11 >=11'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '<', val: 11 }), '>=11 <11'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '<=', val: 11 }), '>=11 <=11'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '=', val: '90' }), '>=11 =90'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '!=', val: '90' }), '>=11 !=90'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '>', val: 90 }), '>=11 >90'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '>=', val: 90 }), '>=11 >=90'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '<', val: 90 }), '>=11 <90'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '<=', val: 90 }), '>=11 <=90'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '=', val: '9' }), '>=11 =9'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '!=', val: '9' }), '>=11 !=9'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '>', val: 9 }), '>=11 >9'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '>=', val: 9 }), '>=11 >=9'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '<', val: 9 }), '>=11 <9'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '<=', val: 9 }), '>=11 <=9'); + }); + + it('adding to set with one and same key and <', function() { + var f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '<', val: 11 }); + assert.ok(false === f.addable({ key: 'TOTAL', op: '=', val: '11' }), '<11 =11'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '!=', val: '11' }), '<11 !=11'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '>', val: 11 }), '<11 >11'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '>=', val: 11 }), '<11 >=11'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '<', val: 11 }), '<11 <11'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '<=', val: 11 }), '<11 <=11'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '=', val: '90' }), '<11 =90'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '!=', val: '90' }), '<11 !=90'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '>', val: 90 }), '<11 >90'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '>=', val: 90 }), '<11 >=90'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '<', val: 90 }), '<11 <90'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '<=', val: 90 }), '<11 <=90'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '=', val: '9' }), '<11 =9'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '!=', val: '9' }), '<11 !=9'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '>', val: 9 }), '<11 >9'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '>=', val: 9 }), '<11 >=9'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '<', val: 9 }), '<11 <9'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '<=', val: 9 }), '<11 <=9'); + }); + + it('adding to set with one and same key and <=', function() { + var f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '<=', val: 11 }); + assert.ok(true === f.addable({ key: 'TOTAL', op: '=', val: '11' }), '<=11 =11'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '!=', val: '11' }), '<=11 !=11'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '>', val: 11 }), '<=11 >11'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '>=', val: 11 }), '<=11 >=11'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '<', val: 11 }), '<=11 <11'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '<=', val: 11 }), '<=11 <=11'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '=', val: '90' }), '<=11 =90'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '!=', val: '90' }), '<=11 !=90'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '>', val: 90 }), '<=11 >90'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '>=', val: 90 }), '<=11 >=90'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '<', val: 90 }), '<=11 <90'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '<=', val: 90 }), '<=11 <=90'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '=', val: '9' }), '<=11 =9'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '!=', val: '9' }), '<=11 !=9'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '>', val: 9 }), '<=11 >9'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '>=', val: 9 }), '<=11 >=9'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '<', val: 9 }), '<=11 <9'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '<=', val: 9 }), '<=11 <=9'); + }); + + it('adding to filterset with three filters', function() { + var f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '<=', val: 11 }); + f.add({ key: 'TOTAL', op: '>', val: 9 }); + f.add({ key: 'TOTAL', op: '!=', val: '10' }); + assert.ok(false === f.addable({ key: 'TOTAL', op: '=', val: '10' }), '<=11 >9 !=10 =10'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '=', val: '10.5' }), '<=11 >9 !=10 =10.5'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '=', val: '9' }), '<=11 >9 !=10 =9'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '=', val: '8' }), '<=11 >9 !=10 =8'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '=', val: '11' }), '<=11 >9 !=10 =11'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '!=', val: '10' }), '<=11 >9 !=10 !=10'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '!=', val: '10.5' }), '<=11 >9 !=10 !=10.5'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '!=', val: '9' }), '<=11 >9 !=10 !=9'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '!=', val: '8' }), '<=11 >9 !=10 !=8'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '!=', val: '11' }), '<=11 >9 !=10 !=11'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '>', val: 11 }), '<=11 >9 !=10 >11'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '>=', val: 11 }), '<=11 >9 !=10 >=11'); + assert.ok(true === f.addable({ key: 'TOTAL', op: '<', val: 11 }), '<=11 >9 !=10 <11'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '<=', val: 11 }), '<=11 >9 !=10 <=11'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '>', val: 90 }), '<=11 >9 !=10 >90'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '>=', val: 90 }), '<=11 >9 !=10 >=90'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '<', val: 90 }), '<=11 >9 !=10 <90'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '<=', val: 90 }), '<=11 >9 !=10 <=90'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '>', val: 9 }), '<=11 >9 !=10 >9'); + assert.ok(null === f.addable({ key: 'TOTAL', op: '>=', val: 9 }), '<=11 >9 !=10 >=9'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '<', val: 9 }), '<=11 >9 !=10 <9'); + assert.ok(false === f.addable({ key: 'TOTAL', op: '<=', val: 9 }), '<=11 >9 !=10 <=9'); + }); + }); + + + it('should add filtersets', function() { + var f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '=', val: '11' }); + assert.deepEqual(f.filters, { 'TOTAL=': { key: 'TOTAL', op: '=', val: '11' }}); + + f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '!=', val: '4' }); + assert.deepEqual(f.filters, { 'TOTAL!=4': { key: 'TOTAL', op: '!=', val: '4' }}); + + f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '>', val: '4' }); + assert.deepEqual(f.filters, { 'TOTAL>': { key: 'TOTAL', op: '>', val: '4' }}); + + f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '>=', val: '4' }); + assert.deepEqual(f.filters, { 'TOTAL>=': { key: 'TOTAL', op: '>=', val: '4' }}); + + f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '<', val: '4' }); + assert.deepEqual(f.filters, { 'TOTAL<': { key: 'TOTAL', op: '<', val: '4' }}); + + f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '<=', val: '4' }); + assert.deepEqual(f.filters, { 'TOTAL<=': { key: 'TOTAL', op: '<=', val: '4' }}); + + f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '!=', val: '11' }); + f.add({ key: 'TOTAL', op: '!=', val: '9' }); + assert.deepEqual(f.filters, { 'TOTAL!=9': { key: 'TOTAL', op: '!=', val: '9' }, 'TOTAL!=11': { key: 'TOTAL', op: '!=', val: '11' }}); + + f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '!=', val: '11' }); + f.add({ key: 'TOTAL', op: '>', val: 9 }); + assert.deepEqual(f.filters, { 'TOTAL>': { key: 'TOTAL', op: '>', val: 9 }, 'TOTAL!=11': { key: 'TOTAL', op: '!=', val: '11' }}); + + f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '!=', val: '11' }); + f.add({ key: 'TOTAL', op: '>', val: 11 }); + assert.deepEqual(f.filters, {"TOTAL!=11":{"key":"TOTAL","op":"!=","val":"11"},"TOTAL>":{"key":"TOTAL","op":">","val":11}}); + + f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '!=', val: '11' }); + f.add({ key: 'TOTAL', op: '>', val: 90 }); + assert.deepEqual(f.filters, {"TOTAL!=11":{"key":"TOTAL","op":"!=","val":"11"},"TOTAL>":{"key":"TOTAL","op":">","val":90}}); + + f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '!=', val: '11' }); + f.add({ key: 'TOTAL', op: '>=', val: 9 }); + assert.deepEqual(f.filters, { 'TOTAL>=': { key: 'TOTAL', op: '>=', val: 9 }, 'TOTAL!=11': { key: 'TOTAL', op: '!=', val: '11' }}); + + f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '!=', val: '11' }); + f.add({ key: 'TOTAL', op: '>=', val: 11 }); + assert.deepEqual(f.filters, { 'TOTAL>': { key: 'TOTAL', op: '>', val: 11 }}); + + f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '!=', val: '11' }); + f.add({ key: 'TOTAL', op: '>=', val: 90 }); + assert.deepEqual(f.filters, { 'TOTAL>=': { key: 'TOTAL', op: '>=', val: 90 }}); + + f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '!=', val: '11' }); + f.add({ key: 'TOTAL', op: '<', val: 9 }); + assert.deepEqual(f.filters, { 'TOTAL<': { key: 'TOTAL', op: '<', val: 9 }}); + + f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '!=', val: '11' }); + f.add({ key: 'TOTAL', op: '<', val: 11 }); + assert.deepEqual(f.filters, { 'TOTAL<': { key: 'TOTAL', op: '<', val: 11 }}); + + f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '!=', val: '11' }); + f.add({ key: 'TOTAL', op: '<', val: 90 }); + assert.deepEqual(f.filters, { 'TOTAL<': { key: 'TOTAL', op: '<', val: 90 }, 'TOTAL!=11': { key: 'TOTAL', op: '!=', val: '11' }}); + + f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '!=', val: '11' }); + f.add({ key: 'TOTAL', op: '<=', val: 9 }); + assert.deepEqual(f.filters, { 'TOTAL<=': { key: 'TOTAL', op: '<=', val: 9 }}); + + f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '!=', val: '11' }); + f.add({ key: 'TOTAL', op: '<=', val: 11 }); + assert.deepEqual(f.filters, { 'TOTAL<': { key: 'TOTAL', op: '<', val: 11 }}); + + f = new tree.Filterset(); + f.add({ key: 'TOTAL', op: '!=', val: '11' }); + f.add({ key: 'TOTAL', op: '<=', val: 90 }); + assert.deepEqual(f.filters, { 'TOTAL<=': { key: 'TOTAL', op: '<=', val: 90 }, 'TOTAL!=11': { key: 'TOTAL', op: '!=', val: '11' }}); + }); +}); diff --git a/test/operation.test.js b/test/operation.test.js new file mode 100644 index 0000000..a0a52ab --- /dev/null +++ b/test/operation.test.js @@ -0,0 +1,45 @@ +var assert = require('assert'); +var tree = require('../lib/carto/tree.js'); +require('../lib/carto/tree/operation'); +require('../lib/carto/tree/dimension'); +require('../lib/carto/tree/color'); +require('../lib/carto/tree/field'); +require('../lib/carto/tree/literal'); +require('../lib/carto/tree/quoted'); + +describe('Operation', function() { + it('should work with percent', function() { + var env = { ppi:72, error:function(err) { console.log(err.message); } }; + + var o = new tree.Operation("+", [ new tree.Dimension(2), new tree.Dimension(10, "%") ]); + assert.equal(o.ev(env).value, 2.2); + }); + + it('should work with units', function() { + var env = { ppi:72, error:function(err) { console.log(err.message); } }; + + var o1 = new tree.Operation("+", [ new tree.Dimension(2.54, 'cm'), new tree.Dimension(0.0254, 'm') ]); + assert.equal(o1.ev(env).value, 144); + + var o2 = new tree.Operation("+", [ new tree.Dimension(25.4, 'mm'), new tree.Dimension(72, 'pt') ]); + assert.equal(o2.ev(env).value, 144); + + var o3 = new tree.Operation("+", [ new tree.Dimension(72, 'pt'), new tree.Dimension(6, 'pc') ]); + assert.equal(o3.ev(env).value, 144); + }); + + it('should work with different ppi', function() { + var env = { ppi:300, error:function(err) { console.log(err.message); } }; + + var o1 = new tree.Operation("+", [ new tree.Dimension(2.54, 'cm'), new tree.Dimension(0.0254, 'm') ]); + assert.equal(o1.ev(env).value, 600); + + var o2 = new tree.Operation("+", [ new tree.Dimension(25.4, 'mm'), new tree.Dimension(72, 'pt') ]); + assert.equal(o2.ev(env).value, 600); + + var o3 = new tree.Operation("+", [ new tree.Dimension(72, 'pt'), new tree.Dimension(6, 'pc') ]); + assert.equal(o3.ev(env).value, 600); + }); + + +}); diff --git a/test/quoted.test.js b/test/quoted.test.js new file mode 100644 index 0000000..0ed8807 --- /dev/null +++ b/test/quoted.test.js @@ -0,0 +1,23 @@ +var assert = require('assert'); +var tree = require('../lib/carto/tree.js'); +require('../lib/carto/tree/quoted'); + +describe('Quoted', function() { + describe('basic functionality', function() { + it('should be constructed', function() { + var f = new tree.Quoted("Tom's & \"\""); + assert.ok(f); + assert.equal(f.is, 'string'); + }); + it('should produce normal output', function() { + var f = new tree.Quoted("Tom's & \"\""); + assert.ok(f); + assert.equal(f.toString(), "Tom's & \"\""); + }); + it('should produce xml-friendly output', function() { + var f = new tree.Quoted("Tom's & \"\""); + assert.ok(f); + assert.equal(f.toString(true), "'Tom\\'s & "<quoted>"'"); + }); + }); +}); diff --git a/test/reference.test.js b/test/reference.test.js new file mode 100644 index 0000000..b44a00a --- /dev/null +++ b/test/reference.test.js @@ -0,0 +1,87 @@ +var assert = require('assert'), + _ = require('lodash'); + +var carto = require('../lib/carto'); + +describe('Reference', function() { + it('should accept custom reference adhering to spec', function(done) { + var customRef = { + load: function (wanted) { + return { + version: wanted, + style: {}, + layer: {}, + symbolizers: { + bla: { + width: { + css: 'bla-width', + type: 'float' + } + } + }, + colors: {}, + datasources: {} + }; + }, + latest: '1.5.0', + versions: [ + '1.0.0', + '1.5.0' + ] + }; + var renderer = new carto.Renderer({ + reference: customRef + }), + output = renderer.renderMSS('#test { bla-width: 1; }'); + assert.equal(output.msg, null); + assert.equal(output.data, '\n'); + done(); + }); + + it('should reject custom reference not adhering to spec', function(done) { + var customRef = { + load: function (wanted) { + return wanted; + }, + latest: '1.5.0', + versions: [ + '1.0.0', + '1.5.0' + ] + }; + var renderer = new carto.Renderer({ + reference: customRef + }), + output = renderer.renderMSS('#test { marker-color: #fff; }'); + assert.ok(!_.isNil(output.msg) && output.msg.length > 0); + assert.equal(output.msg[0].message, 'Could not use the given reference, because it does not adhere to the specification. See the documentation for details.'); + done(); + }); + + it('should error on no rules', function(done) { + var customRef = { + load: function (wanted) { + return { + version: wanted, + style: {}, + layer: {}, + symbolizers: {}, + colors: {}, + datasources: {} + }; + }, + latest: '1.5.0', + versions: [ + '1.0.0', + '1.5.0' + ] + }; + var renderer = new carto.Renderer({ + reference: customRef + }), + output = renderer.renderMSS('#test { marker-width: 1; }'); + assert.ok(!_.isNil(output.msg) && output.msg.length > 0); + assert.equal(output.msg[0].message, 'Unrecognized rule: marker-width.'); + done(); + }); +}); diff --git a/test/rendering-mss.test.js b/test/rendering-mss.test.js new file mode 100644 index 0000000..10dc537 --- /dev/null +++ b/test/rendering-mss.test.js @@ -0,0 +1,46 @@ +var path = require('path'), + assert = require('assert'), + fs = require('fs'), + _ = require('lodash'), + existsSync = require('fs').existsSync || require('path').existsSync; + +var carto = require('../lib/carto'), + helper = require('./support/helper'), + util = require('../lib/carto/util'); + +describe('Rendering mss', function() { +helper.files('rendering-mss', 'mss', function(file) { + it('should render mss ' + path.basename(file) + ' correctly', function(done) { + var mss = helper.mss(file), + output = new carto.Renderer({ + paths: [ path.dirname(file) ], + data_dir: path.join(__dirname, '../data'), + local_data_dir: path.join(__dirname, 'rendering'), + filename: file + }).renderMSS(mss); + if (!_.isNil(output.data)) { + var expected = file.replace(path.extname(file),'')+'.xml'; + if (!existsSync(expected)) { + fs.writeFileSync(expected,output); + } + var expected_data = fs.readFileSync(expected).toString(); + assert.equal(output.data.trim(),expected_data.trim()); + } + else { + if (_.has(output, 'msg') && _.isArray(output.msg) && + output.msg.length > 0) { + _.forEach(output.msg, function (v) { + if (v.type === 'error') { + console.error(util.getMessageToPrint(v)); + } + else if (v.type === 'warning') { + console.warn(util.getMessageToPrint(v)); + } + }); + } + assert.ok(false); + } + done(); + }); +}); +}); diff --git a/test/rendering-mss/basic_attachment_internal.mss b/test/rendering-mss/basic_attachment_internal.mss new file mode 100644 index 0000000..ca0c38b --- /dev/null +++ b/test/rendering-mss/basic_attachment_internal.mss @@ -0,0 +1,9 @@ +#layer { + // default attachement comes before + line-color: chartreuse; + line-width: 10; + ::inline { + line-color: lime; + line-width: 5; + } +} \ No newline at end of file diff --git a/test/rendering-mss/basic_attachment_internal.xml b/test/rendering-mss/basic_attachment_internal.xml new file mode 100644 index 0000000..03e35c7 --- /dev/null +++ b/test/rendering-mss/basic_attachment_internal.xml @@ -0,0 +1,10 @@ + + diff --git a/test/rendering-mss/basic_attachment_internal_before.mss b/test/rendering-mss/basic_attachment_internal_before.mss new file mode 100644 index 0000000..3aa1911 --- /dev/null +++ b/test/rendering-mss/basic_attachment_internal_before.mss @@ -0,0 +1,9 @@ +#layer { + ::outline { + line-color: aliceblue; + line-width: 5; + } + // default attachement comes after + line-color: orchid; + line-width: 10; +} \ No newline at end of file diff --git a/test/rendering-mss/basic_attachment_internal_before.xml b/test/rendering-mss/basic_attachment_internal_before.xml new file mode 100644 index 0000000..2bbcc88 --- /dev/null +++ b/test/rendering-mss/basic_attachment_internal_before.xml @@ -0,0 +1,10 @@ + + diff --git a/test/rendering-mss/basic_attachment_internal_before_and_after.mss b/test/rendering-mss/basic_attachment_internal_before_and_after.mss new file mode 100644 index 0000000..0734f91 --- /dev/null +++ b/test/rendering-mss/basic_attachment_internal_before_and_after.mss @@ -0,0 +1,12 @@ +#layer { + ::outline { + line-color: salmon; + line-width: 10; + } + line-color: coral; + line-width: 5; + ::inline { + line-color: moccasin; + line-width: 1; + } +} \ No newline at end of file diff --git a/test/rendering-mss/basic_attachment_internal_before_and_after.xml b/test/rendering-mss/basic_attachment_internal_before_and_after.xml new file mode 100644 index 0000000..35fcc87 --- /dev/null +++ b/test/rendering-mss/basic_attachment_internal_before_and_after.xml @@ -0,0 +1,15 @@ + + + diff --git a/test/rendering-mss/basic_attachment_internal_double.mss b/test/rendering-mss/basic_attachment_internal_double.mss new file mode 100644 index 0000000..618c224 --- /dev/null +++ b/test/rendering-mss/basic_attachment_internal_double.mss @@ -0,0 +1,10 @@ +#layer { + ::outline { + line-color: whitesmoke; + line-width: 10; + } + ::inline { + line-color: mintcream; + line-width: 5; + } +} \ No newline at end of file diff --git a/test/rendering-mss/basic_attachment_internal_double.xml b/test/rendering-mss/basic_attachment_internal_double.xml new file mode 100644 index 0000000..e43a2c5 --- /dev/null +++ b/test/rendering-mss/basic_attachment_internal_double.xml @@ -0,0 +1,10 @@ + + diff --git a/test/rendering-mss/basic_attachment_internal_with_label.mss b/test/rendering-mss/basic_attachment_internal_with_label.mss new file mode 100644 index 0000000..842ee10 --- /dev/null +++ b/test/rendering-mss/basic_attachment_internal_with_label.mss @@ -0,0 +1,11 @@ +#places { + marker-width: 10; + marker-allow-overlap: true; + marker-fill: peru; + ::label { + text-face-name: "DejaVu Sans Book"; + text-name: "'1'"; + text-fill: tomato; + text-allow-overlap: true; + } +} diff --git a/test/rendering-mss/basic_attachment_internal_with_label.xml b/test/rendering-mss/basic_attachment_internal_with_label.xml new file mode 100644 index 0000000..c80a85b --- /dev/null +++ b/test/rendering-mss/basic_attachment_internal_with_label.xml @@ -0,0 +1,10 @@ + + diff --git a/test/rendering-mss/basic_attachment_separate.mss b/test/rendering-mss/basic_attachment_separate.mss new file mode 100644 index 0000000..081c81f --- /dev/null +++ b/test/rendering-mss/basic_attachment_separate.mss @@ -0,0 +1,9 @@ +#layer { + // default attachement comes before + line-color: chartreuse; + line-width: 10; +} +#layer::inline { + line-color: lime; + line-width: 5; +} \ No newline at end of file diff --git a/test/rendering-mss/basic_attachment_separate.xml b/test/rendering-mss/basic_attachment_separate.xml new file mode 100644 index 0000000..03e35c7 --- /dev/null +++ b/test/rendering-mss/basic_attachment_separate.xml @@ -0,0 +1,10 @@ + + diff --git a/test/rendering-mss/basic_attachment_separate_before.mss b/test/rendering-mss/basic_attachment_separate_before.mss new file mode 100644 index 0000000..574f314 --- /dev/null +++ b/test/rendering-mss/basic_attachment_separate_before.mss @@ -0,0 +1,9 @@ +#layer::outline { + line-color: aliceblue; + line-width: 10; +} +#layer { + // default attachment comes after + line-color: orchid; + line-width: 5; +} \ No newline at end of file diff --git a/test/rendering-mss/basic_attachment_separate_before.xml b/test/rendering-mss/basic_attachment_separate_before.xml new file mode 100644 index 0000000..58b4aef --- /dev/null +++ b/test/rendering-mss/basic_attachment_separate_before.xml @@ -0,0 +1,10 @@ + + diff --git a/test/rendering-mss/basic_attachment_separate_before_and_after.mss b/test/rendering-mss/basic_attachment_separate_before_and_after.mss new file mode 100644 index 0000000..202144c --- /dev/null +++ b/test/rendering-mss/basic_attachment_separate_before_and_after.mss @@ -0,0 +1,12 @@ +#layer::outline { + line-color: salmon; + line-width: 10; +} +#layer { + line-color: coral; + line-width: 5; +} +#layer::inline { + line-color: moccasin; + line-width: 1; +} \ No newline at end of file diff --git a/test/rendering-mss/basic_attachment_separate_before_and_after.xml b/test/rendering-mss/basic_attachment_separate_before_and_after.xml new file mode 100644 index 0000000..35fcc87 --- /dev/null +++ b/test/rendering-mss/basic_attachment_separate_before_and_after.xml @@ -0,0 +1,15 @@ + + + diff --git a/test/rendering-mss/basic_attachment_separate_double.mss b/test/rendering-mss/basic_attachment_separate_double.mss new file mode 100644 index 0000000..8a7e32a --- /dev/null +++ b/test/rendering-mss/basic_attachment_separate_double.mss @@ -0,0 +1,8 @@ +#layer::outline { + line-color: whitesmoke; + line-width: 10; +} +#layer::inline { + line-color: mintcream; + line-width: 5; +} \ No newline at end of file diff --git a/test/rendering-mss/basic_attachment_separate_double.xml b/test/rendering-mss/basic_attachment_separate_double.xml new file mode 100644 index 0000000..e43a2c5 --- /dev/null +++ b/test/rendering-mss/basic_attachment_separate_double.xml @@ -0,0 +1,10 @@ + + diff --git a/test/rendering-mss/basic_attachment_separate_with_label.mss b/test/rendering-mss/basic_attachment_separate_with_label.mss new file mode 100644 index 0000000..c7891bb --- /dev/null +++ b/test/rendering-mss/basic_attachment_separate_with_label.mss @@ -0,0 +1,11 @@ +#layer { + marker-width: 10; + marker-allow-overlap: true; + marker-fill: peru; +} +#layer::label { + text-face-name: "DejaVu Sans Book"; + text-name: "'1'"; + text-fill: tomato; + text-allow-overlap: true; +} diff --git a/test/rendering-mss/basic_attachment_separate_with_label.xml b/test/rendering-mss/basic_attachment_separate_with_label.xml new file mode 100644 index 0000000..c80a85b --- /dev/null +++ b/test/rendering-mss/basic_attachment_separate_with_label.xml @@ -0,0 +1,10 @@ + + diff --git a/test/rendering-mss/color_functions.mss b/test/rendering-mss/color_functions.mss new file mode 100644 index 0000000..9e65d11 --- /dev/null +++ b/test/rendering-mss/color_functions.mss @@ -0,0 +1,68 @@ +#world { + name/line-color: green; + + hex-3/line-color: #BED; + hex-6/line-color: #DEADBE; + + rgb/line-color: rgb(123, 45, 67); + rgba/line-color: rgba(123, 45, 67, 89%); + rgba-d/line-color: rgba(123, 45, 67, .89); + + hsl/line-color: hsl(123, 45%, 67%); + hsl-d/line-color: hsl(123, .45, .67); + hsla/line-color: hsla(123, 45%, 67%, 89%); + hsla-d/line-color: hsla(123, 45%, 67%, .89); + + hsluv/line-color: hsluv(123, 45%, 67%); + hsluv-d/line-color: hsluv(123, .45, .67); + hsluva/line-color: hsluva(123, 45%, 67%, 89%); + hsluva-d/line-color: hsluva(123, 45%, 67%, .89); + + hsl-darken/line-color: darken(hsl(209, 81%, 64%), 10%); + hsl-lighten/line-color: lighten(hsl(209, 81%, 64%), 10%); + hsl-saturate/line-color: saturate(hsl(209, 81%, 64%), 10%); + hsl-desaturate/line-color: desaturate(hsl(209, 81%, 64%), 10%); + hsl-spin/line-color: spin(hsl(209, 81%, 64%), 10); + hsl-fadein/line-color: fadein(hsla(209, 81%, 64%, 80%), 10%); + hsl-fadeout/line-color: fadeout(hsla(209, 81%, 64%, 80%), 10%); + hsl-greyscale/line-color: greyscale(hsl(209, 81%, 64%)); + + percept-darken/line-color: darken(hsluv(209, 81%, 64%), 10%); + percept-lighten/line-color: lighten(hsluv(209, 81%, 64%), 10%); + percept-saturate/line-color: saturate(hsluv(209, 81%, 64%), 10%); + percept-desaturate/line-color: desaturate(hsluv(209, 81%, 64%), 10%); + percept-spin/line-color: spin(hsluv(209, 81%, 64%), 10); + percept-fadein/line-color: fadein(hsluva(209, 81%, 64%, 80%), 10%); + percept-fadeout/line-color: fadeout(hsluva(209, 81%, 64%, 80%), 10%); + percept-greyscale/line-color: greyscale(hsluv(209, 81%, 64%)); + + force-percept-darken/line-color: darkenp(hsl(209, 81%, 64%), 10%); + force-percept-lighten/line-color: lightenp(hsl(209, 81%, 64%), 10%); + force-percept-saturate/line-color: saturatep(hsl(209, 81%, 64%), 10%); + force-percept-desaturate/line-color: desaturatep(hsl(209, 81%, 64%), 10%); + force-percept-spin/line-color: spinp(hsl(209, 81%, 64%), 10); + force-percept-fadein/line-color: fadeinp(hsla(209, 81%, 64%, 80%), 10%); + force-percept-fadeout/line-color: fadeoutp(hsla(209, 81%, 64%, 80%), 10%); + force-percept-greyscale/line-color: greyscalep(hsl(209, 81%, 64%)); + + mix/line-color: mix(hsl(209, 81%, 64%), hsl(109, 81%, 64%), 20%); + mix2/line-color: mix(#5ba2a2, #0080ff, 50%); + mix3/line-color: mix(#ff0000, #00ff00, 0%); + mix4/line-color: mix(#ff0000, #00ff00, 100%); + mix5/line-color: mix(rgba(255, 0, 0, 0.2), rgba(0, 255, 0, 0.8), 20%); + percept-mix/line-color: mix(hsl(109, 81%, 64%), hsluv(209, 81%, 64%), 20%); + percept-mix2/line-color: mix(hsluv(109, 81%, 64%), hsluv(209, 81%, 64%), 20%); + + multiply/line-color: #f8f4f0 * 0.8; + divide/line-color: #f8f4f0 / 1.2; + add/line-color: #f8f4f0 + 0.8; + subtract/line-color: #f8f4f0 - 0.8; + + multiply2/line-color: #252525 * #020202; + divide2/line-color: #f8f4f0 / #83b7eb; + add2/line-color: #f8f4f0 + #020202; + subtract2/line-color: #f8f4f0 - #83b7eb; + + components/line-color: hsl(hue(hsl(209, 81%, 64%)), saturation(hsl(209, 81%, 64%)), lightness(hsl(209, 81%, 64%))); + percept-components/line-color: hsluv(huep(hsl(209, 81%, 64%)), saturationp(hsl(209, 81%, 64%)), lightnessp(hsl(209, 81%, 64%))); +} diff --git a/test/rendering-mss/color_functions.xml b/test/rendering-mss/color_functions.xml new file mode 100644 index 0000000..9139e28 --- /dev/null +++ b/test/rendering-mss/color_functions.xml @@ -0,0 +1,59 @@ + diff --git a/test/rendering-mss/empty_name.mss b/test/rendering-mss/empty_name.mss new file mode 100644 index 0000000..d05bb16 --- /dev/null +++ b/test/rendering-mss/empty_name.mss @@ -0,0 +1,6 @@ +#poi-point { + text-name: ""; + text-face-name: "DejaVu Sans Book"; + text-size: 10; + text-fill: chocolate; +} \ No newline at end of file diff --git a/test/rendering-mss/empty_name.xml b/test/rendering-mss/empty_name.xml new file mode 100644 index 0000000..6c60a01 --- /dev/null +++ b/test/rendering-mss/empty_name.xml @@ -0,0 +1,5 @@ + diff --git a/test/rendering-mss/image-filters.mss b/test/rendering-mss/image-filters.mss new file mode 100644 index 0000000..a333aa4 --- /dev/null +++ b/test/rendering-mss/image-filters.mss @@ -0,0 +1,5 @@ +#layer { + image-filters:invert(); + image-filters-inflate:true; + direct-image-filters:invert(); +} \ No newline at end of file diff --git a/test/rendering-mss/image-filters.xml b/test/rendering-mss/image-filters.xml new file mode 100644 index 0000000..99c5c12 --- /dev/null +++ b/test/rendering-mss/image-filters.xml @@ -0,0 +1 @@ + diff --git a/test/rendering-mss/issue_121.mss b/test/rendering-mss/issue_121.mss new file mode 100644 index 0000000..6e4bce1 --- /dev/null +++ b/test/rendering-mss/issue_121.mss @@ -0,0 +1,3 @@ +#data { + [[dem] > [rep]] { marker-fill: #00f;} +} diff --git a/test/rendering-mss/issue_121.xml b/test/rendering-mss/issue_121.xml new file mode 100644 index 0000000..d5d9026 --- /dev/null +++ b/test/rendering-mss/issue_121.xml @@ -0,0 +1,6 @@ + diff --git a/test/rendering-mss/issue_197.mss b/test/rendering-mss/issue_197.mss new file mode 100644 index 0000000..aa22ee0 --- /dev/null +++ b/test/rendering-mss/issue_197.mss @@ -0,0 +1,5 @@ +@foo: 6; +@a: 8; + +#bar[zoom > @foo] { marker-width: 1; } +#a[zoom = @a] { marker-width: 1; } diff --git a/test/rendering-mss/issue_197.xml b/test/rendering-mss/issue_197.xml new file mode 100644 index 0000000..1abfc0a --- /dev/null +++ b/test/rendering-mss/issue_197.xml @@ -0,0 +1,11 @@ + diff --git a/test/rendering-mss/issue_214.mss b/test/rendering-mss/issue_214.mss new file mode 100644 index 0000000..3bdf260 --- /dev/null +++ b/test/rendering-mss/issue_214.mss @@ -0,0 +1,83 @@ +#world { + line-dasharray: none; + line-dash-offset: none; + line-geometry-transform: none; + line-join: none; + line-cap: none; + line-gamma-method: none; + line-simplify-algorithm: none; + line-rasterizer: none; + line-comp-op: none; + + point-transform: none; + point-placement: none; + point-comp-op: none; + + line-pattern-file: none; + line-pattern-transform: none; + line-pattern-geometry-transform: none; + line-pattern-simplify-algorithm: none; + line-pattern-comp-op: none; + + polygon-pattern-file: none; + polygon-pattern-transform: none; + polygon-pattern-geometry-transform: none; + polygon-pattern-alignment: none; + polygon-pattern-simplify-algorithm: none; + polygon-pattern-comp-op: none; + + marker-transform: none; + marker-geometry-transform: none; + marker-placement: none; + marker-multi-policy: none; + marker-type: none; + marker-simplify-algorithm: none; + marker-comp-op: none; + marker-direction: none; + + shield-file: none; + shield-face-name: none; + shield-transform: none; + shield-text-transform: none; + shield-placement: none; + shield-halo-rasterizer: none; + shield-halo-comp-op: none; + shield-horizontal-alignment: none; + shield-vertical-alignment: none; + shield-placement-type: none; + shield-justify-alignment: none; + shield-simplify-algorithm: none; + shield-comp-op: none; + + polygon-geometry-transform: none; + polygon-gamma-method: none; + polygon-simplify-algorithm: none; + polygon-comp-op: none; + + image-filters: none; + direct-image-filters: none; + comp-op: none; + + raster-scaling: none; + raster-comp-op: none; + raster-colorizer-default-mode: none; + + text-name: [name]; + text-face-name: 'Arial'; + text-spacing: none; + text-character-spacing: none; + text-line-spacing: none; + text-label-position-tolerance: none; + text-halo-rasterizer: none; + text-vertical-alignment: none; + text-upright: none; + text-placement: none; + text-placement-type: none; + text-horizontal-alignment: none; + text-align: none; + text-simplify-algorithm: none; + text-comp-op: none; + text-halo-comp-op: none; + + dot-comp-op: none; +} diff --git a/test/rendering-mss/issue_214.xml b/test/rendering-mss/issue_214.xml new file mode 100644 index 0000000..1b333b3 --- /dev/null +++ b/test/rendering-mss/issue_214.xml @@ -0,0 +1,14 @@ + diff --git a/test/rendering-mss/issue_232.mss b/test/rendering-mss/issue_232.mss new file mode 100644 index 0000000..c2fd201 --- /dev/null +++ b/test/rendering-mss/issue_232.mss @@ -0,0 +1,14 @@ +@sans_bold: 'Helvetica Neue', 'Foo Bar'; +#world[zoom>=11][zoom<=22][reflen<=8][type='bicycle'] { + [network='ncn'],[network='rcn'] { + shield-name: "[ref]"; + shield-face-name: @sans_bold; + shield-file: url(img/shield-motorway-1.png); + [network='ncn'] { + [reflen=8] { shield-file: url(img/shield-motorway-8.png); } + } + [network='rcn'] { + [reflen=8] { shield-file: url(img/shield-trunk-8.png); } + } + } +} diff --git a/test/rendering-mss/issue_232.xml b/test/rendering-mss/issue_232.xml new file mode 100644 index 0000000..4fe0c9d --- /dev/null +++ b/test/rendering-mss/issue_232.xml @@ -0,0 +1,26 @@ + diff --git a/test/rendering-mss/issue_247_1.mss b/test/rendering-mss/issue_247_1.mss new file mode 100644 index 0000000..2e1e0ad --- /dev/null +++ b/test/rendering-mss/issue_247_1.mss @@ -0,0 +1,12 @@ +#countries { + ::outline { + line-color: #85c5d3; + line-width: 4; + line-join: round; + //[ne_10m_adm = 'AAA'] { } + } + ::inline { + line-color: black; + line-width: 1; + } +} \ No newline at end of file diff --git a/test/rendering-mss/issue_247_1.xml b/test/rendering-mss/issue_247_1.xml new file mode 100644 index 0000000..7e21b2d --- /dev/null +++ b/test/rendering-mss/issue_247_1.xml @@ -0,0 +1,10 @@ + + diff --git a/test/rendering-mss/issue_247_2.mss b/test/rendering-mss/issue_247_2.mss new file mode 100644 index 0000000..f6adbb0 --- /dev/null +++ b/test/rendering-mss/issue_247_2.mss @@ -0,0 +1,12 @@ +#countries { + ::outline { + line-color: #85c5d3; + line-width: 4; + line-join: round; + [ne_10m_adm = 'AAA'] { } + } + ::inline { + line-color: black; + line-width: 1; + } +} \ No newline at end of file diff --git a/test/rendering-mss/issue_247_2.xml b/test/rendering-mss/issue_247_2.xml new file mode 100644 index 0000000..11c9ec9 --- /dev/null +++ b/test/rendering-mss/issue_247_2.xml @@ -0,0 +1,15 @@ + + + diff --git a/test/rendering-mss/issue_284.mss b/test/rendering-mss/issue_284.mss new file mode 100644 index 0000000..e53218f --- /dev/null +++ b/test/rendering-mss/issue_284.mss @@ -0,0 +1,17 @@ +#roads_high::outline { + [type='primary'] { + line-color: red; + } + [foo='bar'] { + line-width: 10; + } +} + +#roads_high { + [type='primary'] { + line-color: red; + } + [foo='bar'] { + line-width: 10; + } +} diff --git a/test/rendering-mss/issue_284.xml b/test/rendering-mss/issue_284.xml new file mode 100644 index 0000000..20fd377 --- /dev/null +++ b/test/rendering-mss/issue_284.xml @@ -0,0 +1,28 @@ + + diff --git a/test/rendering-mss/issue_284_b.mss b/test/rendering-mss/issue_284_b.mss new file mode 100644 index 0000000..9fe1387 --- /dev/null +++ b/test/rendering-mss/issue_284_b.mss @@ -0,0 +1,18 @@ +#roads_high::inline { + [type='primary'] { + line-color: darkred; + } + [foo='bar'] { + line-width: 11; + } +} + +#roads_high::outline { + [type='primary'] { + line-color: red; + } + [foo='bar'] { + line-width: 10; + } +} + diff --git a/test/rendering-mss/issue_284_b.xml b/test/rendering-mss/issue_284_b.xml new file mode 100644 index 0000000..58c5cc5 --- /dev/null +++ b/test/rendering-mss/issue_284_b.xml @@ -0,0 +1,28 @@ + + diff --git a/test/rendering-mss/issue_284_c.mss b/test/rendering-mss/issue_284_c.mss new file mode 100644 index 0000000..e2a9a19 --- /dev/null +++ b/test/rendering-mss/issue_284_c.mss @@ -0,0 +1,18 @@ +#roads_high { + [type='primary'] { + line-color: darkred; + } + [foo='bar'] { + line-width: 11; + } +} + +#roads_high { + [type='primary'] { + line-color: red; + } + [foo='bar'] { + line-width: 10; + } +} + diff --git a/test/rendering-mss/issue_284_c.xml b/test/rendering-mss/issue_284_c.xml new file mode 100644 index 0000000..615d13c --- /dev/null +++ b/test/rendering-mss/issue_284_c.xml @@ -0,0 +1,14 @@ + diff --git a/test/rendering-mss/issue_303.mss b/test/rendering-mss/issue_303.mss new file mode 100644 index 0000000..a64adee --- /dev/null +++ b/test/rendering-mss/issue_303.mss @@ -0,0 +1,4 @@ +#layer["Hello&Goodbye"="yes"] { + text-name: [name]; + text-face-name: "El&Font Bubble Regular"; +} \ No newline at end of file diff --git a/test/rendering-mss/issue_303.xml b/test/rendering-mss/issue_303.xml new file mode 100644 index 0000000..ac36264 --- /dev/null +++ b/test/rendering-mss/issue_303.xml @@ -0,0 +1,6 @@ + diff --git a/test/rendering-mss/issue_339.mss b/test/rendering-mss/issue_339.mss new file mode 100644 index 0000000..6135740 --- /dev/null +++ b/test/rendering-mss/issue_339.mss @@ -0,0 +1 @@ +#poi_label[maki=''] { opacity:.5; } \ No newline at end of file diff --git a/test/rendering-mss/issue_339.xml b/test/rendering-mss/issue_339.xml new file mode 100644 index 0000000..3f4d4b1 --- /dev/null +++ b/test/rendering-mss/issue_339.xml @@ -0,0 +1 @@ + diff --git a/test/rendering-mss/issue_339b.mss b/test/rendering-mss/issue_339b.mss new file mode 100644 index 0000000..7a59067 --- /dev/null +++ b/test/rendering-mss/issue_339b.mss @@ -0,0 +1,4 @@ +#poi_label[maki=''] { + opacity:1.0; + comp-op:src-over; +} \ No newline at end of file diff --git a/test/rendering-mss/issue_339b.xml b/test/rendering-mss/issue_339b.xml new file mode 100644 index 0000000..e69de29 diff --git a/test/rendering-mss/issue_370.mss b/test/rendering-mss/issue_370.mss new file mode 100644 index 0000000..6cd02b1 --- /dev/null +++ b/test/rendering-mss/issue_370.mss @@ -0,0 +1,3 @@ +[way_pixels < 192000][way_pixels > 3000] { + line-width: 1; +} \ No newline at end of file diff --git a/test/rendering-mss/issue_370.xml b/test/rendering-mss/issue_370.xml new file mode 100644 index 0000000..4da5e84 --- /dev/null +++ b/test/rendering-mss/issue_370.xml @@ -0,0 +1,6 @@ + diff --git a/test/rendering-mss/issue_370_b.mss b/test/rendering-mss/issue_370_b.mss new file mode 100644 index 0000000..97acbdc --- /dev/null +++ b/test/rendering-mss/issue_370_b.mss @@ -0,0 +1,3 @@ +[way_pixels <= 192000][way_pixels >= 3000] { + line-width: 1; +} \ No newline at end of file diff --git a/test/rendering-mss/issue_370_b.xml b/test/rendering-mss/issue_370_b.xml new file mode 100644 index 0000000..3d10672 --- /dev/null +++ b/test/rendering-mss/issue_370_b.xml @@ -0,0 +1,6 @@ + diff --git a/test/rendering-mss/issue_377.mss b/test/rendering-mss/issue_377.mss new file mode 100644 index 0000000..0e0e750 --- /dev/null +++ b/test/rendering-mss/issue_377.mss @@ -0,0 +1,3 @@ +[[height] % 50 = 0] { + marker-fill: red; +} diff --git a/test/rendering-mss/issue_377.xml b/test/rendering-mss/issue_377.xml new file mode 100644 index 0000000..bd992d1 --- /dev/null +++ b/test/rendering-mss/issue_377.xml @@ -0,0 +1,6 @@ + diff --git a/test/rendering-mss/issue_443.mss b/test/rendering-mss/issue_443.mss new file mode 100644 index 0000000..0c52cb7 --- /dev/null +++ b/test/rendering-mss/issue_443.mss @@ -0,0 +1,5 @@ +@water: #a0c8f0; + +#water { + polygon-fill: @water - #111; +} \ No newline at end of file diff --git a/test/rendering-mss/issue_443.xml b/test/rendering-mss/issue_443.xml new file mode 100644 index 0000000..932310f --- /dev/null +++ b/test/rendering-mss/issue_443.xml @@ -0,0 +1,5 @@ + diff --git a/test/rendering-mss/issue_462.mss b/test/rendering-mss/issue_462.mss new file mode 100644 index 0000000..3f50557 --- /dev/null +++ b/test/rendering-mss/issue_462.mss @@ -0,0 +1,10 @@ +#foo { + line: none; + line-width: 2; + [feature = 'bar'] { + line-color: red; + } + [feature = 'baz'] { + line-color: blue; + } +} diff --git a/test/rendering-mss/issue_462.xml b/test/rendering-mss/issue_462.xml new file mode 100644 index 0000000..a57e211 --- /dev/null +++ b/test/rendering-mss/issue_462.xml @@ -0,0 +1,10 @@ + diff --git a/test/rendering-mss/issue_462a.mss b/test/rendering-mss/issue_462a.mss new file mode 100644 index 0000000..d7c4bc3 --- /dev/null +++ b/test/rendering-mss/issue_462a.mss @@ -0,0 +1,9 @@ +#foo { + line: auto; + [feature = 'bar'] { + line-color: red; + } + [feature = 'baz'] { + line-color: blue; + } +} diff --git a/test/rendering-mss/issue_462a.xml b/test/rendering-mss/issue_462a.xml new file mode 100644 index 0000000..65b321c --- /dev/null +++ b/test/rendering-mss/issue_462a.xml @@ -0,0 +1,13 @@ + diff --git a/test/rendering-mss/issue_462b.mss b/test/rendering-mss/issue_462b.mss new file mode 100644 index 0000000..cb8065d --- /dev/null +++ b/test/rendering-mss/issue_462b.mss @@ -0,0 +1,15 @@ +#foo { + shield: none; + [feature = 'bar'] { + shield-name: "[refs]"; + shield-face-name: "Arial"; + shield-file: url('test.svg'); + shield-fill: red; + } + [feature = 'baz'] { + shield-name: "[refs]"; + shield-face-name: "Arial"; + shield-file: url('test.svg'); + shield-fill: blue; + } +} diff --git a/test/rendering-mss/issue_462b.xml b/test/rendering-mss/issue_462b.xml new file mode 100644 index 0000000..dc8da4b --- /dev/null +++ b/test/rendering-mss/issue_462b.xml @@ -0,0 +1,10 @@ + diff --git a/test/rendering-mss/line-width-zoom.mss b/test/rendering-mss/line-width-zoom.mss new file mode 100644 index 0000000..e7d9741 --- /dev/null +++ b/test/rendering-mss/line-width-zoom.mss @@ -0,0 +1,3 @@ +#layer { + line-width:"@zoom"; +} \ No newline at end of file diff --git a/test/rendering-mss/line-width-zoom.xml b/test/rendering-mss/line-width-zoom.xml new file mode 100644 index 0000000..d744c2d --- /dev/null +++ b/test/rendering-mss/line-width-zoom.xml @@ -0,0 +1,5 @@ + diff --git a/test/rendering-mss/quoted_attr.mss b/test/rendering-mss/quoted_attr.mss new file mode 100644 index 0000000..957feb4 --- /dev/null +++ b/test/rendering-mss/quoted_attr.mss @@ -0,0 +1,3 @@ +#layer[power = 'generator']['generator:source' = 'wind']::power { + marker-width:0; +} \ No newline at end of file diff --git a/test/rendering-mss/quoted_attr.xml b/test/rendering-mss/quoted_attr.xml new file mode 100644 index 0000000..83c3a95 --- /dev/null +++ b/test/rendering-mss/quoted_attr.xml @@ -0,0 +1,6 @@ + diff --git a/test/rendering-mss/scale-hsla-filter.mss b/test/rendering-mss/scale-hsla-filter.mss new file mode 100644 index 0000000..84843ed --- /dev/null +++ b/test/rendering-mss/scale-hsla-filter.mss @@ -0,0 +1,5 @@ +#layer { + polygon-fill:red; + image-filters:scale-hsla(.5,.5,.5,.5,.5,.5,.5,.5); + direct-image-filters:scale-hsla(.5,.5,.5,.5,.5,.5,.5,.5); +} \ No newline at end of file diff --git a/test/rendering-mss/scale-hsla-filter.xml b/test/rendering-mss/scale-hsla-filter.xml new file mode 100644 index 0000000..7cbc0ea --- /dev/null +++ b/test/rendering-mss/scale-hsla-filter.xml @@ -0,0 +1,5 @@ + diff --git a/test/rendering-mss/should-discard-empty-style-and-attach.mss b/test/rendering-mss/should-discard-empty-style-and-attach.mss new file mode 100644 index 0000000..2966458 --- /dev/null +++ b/test/rendering-mss/should-discard-empty-style-and-attach.mss @@ -0,0 +1,4 @@ +#landcover { + ::foo { + } +} \ No newline at end of file diff --git a/test/rendering-mss/should-discard-empty-style-and-attach.xml b/test/rendering-mss/should-discard-empty-style-and-attach.xml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/test/rendering-mss/should-discard-empty-style-and-attach.xml @@ -0,0 +1 @@ + diff --git a/test/rendering-mss/should-discard-empty-style.mss b/test/rendering-mss/should-discard-empty-style.mss new file mode 100644 index 0000000..10c9a63 --- /dev/null +++ b/test/rendering-mss/should-discard-empty-style.mss @@ -0,0 +1,2 @@ +#landcover { +} \ No newline at end of file diff --git a/test/rendering-mss/should-discard-empty-style.xml b/test/rendering-mss/should-discard-empty-style.xml new file mode 100644 index 0000000..e69de29 diff --git a/test/rendering-mss/should-discard-empty-style2.mss b/test/rendering-mss/should-discard-empty-style2.mss new file mode 100644 index 0000000..f6a427c --- /dev/null +++ b/test/rendering-mss/should-discard-empty-style2.mss @@ -0,0 +1,8 @@ +#landcover { + ::a { + //polygon-fill: #aacbaf; + } + ::b { + // marker-width:4; + } +} \ No newline at end of file diff --git a/test/rendering-mss/should-discard-empty-style2.xml b/test/rendering-mss/should-discard-empty-style2.xml new file mode 100644 index 0000000..139597f --- /dev/null +++ b/test/rendering-mss/should-discard-empty-style2.xml @@ -0,0 +1,2 @@ + + diff --git a/test/rendering-mss/style-level-prop-only.mss b/test/rendering-mss/style-level-prop-only.mss new file mode 100644 index 0000000..d849912 --- /dev/null +++ b/test/rendering-mss/style-level-prop-only.mss @@ -0,0 +1,3 @@ +#landcover { + opacity:.5; +} \ No newline at end of file diff --git a/test/rendering-mss/style-level-prop-only.xml b/test/rendering-mss/style-level-prop-only.xml new file mode 100644 index 0000000..3f4d4b1 --- /dev/null +++ b/test/rendering-mss/style-level-prop-only.xml @@ -0,0 +1 @@ + diff --git a/test/rendering-mss/style-level-prop-only2.mss b/test/rendering-mss/style-level-prop-only2.mss new file mode 100644 index 0000000..d7b7e49 --- /dev/null +++ b/test/rendering-mss/style-level-prop-only2.mss @@ -0,0 +1,3 @@ +#landcover { + comp-op:color-burn; +} \ No newline at end of file diff --git a/test/rendering-mss/style-level-prop-only2.xml b/test/rendering-mss/style-level-prop-only2.xml new file mode 100644 index 0000000..3fb96a9 --- /dev/null +++ b/test/rendering-mss/style-level-prop-only2.xml @@ -0,0 +1 @@ + diff --git a/test/rendering-mss/style-level-prop-only3.mss b/test/rendering-mss/style-level-prop-only3.mss new file mode 100644 index 0000000..d003eb2 --- /dev/null +++ b/test/rendering-mss/style-level-prop-only3.mss @@ -0,0 +1,3 @@ +#landcover { + image-filters:invert(); +} \ No newline at end of file diff --git a/test/rendering-mss/style-level-prop-only3.xml b/test/rendering-mss/style-level-prop-only3.xml new file mode 100644 index 0000000..ce42551 --- /dev/null +++ b/test/rendering-mss/style-level-prop-only3.xml @@ -0,0 +1 @@ + diff --git a/test/rendering-mss/text-face-name-escaping.mss b/test/rendering-mss/text-face-name-escaping.mss new file mode 100644 index 0000000..ec02985 --- /dev/null +++ b/test/rendering-mss/text-face-name-escaping.mss @@ -0,0 +1,4 @@ +#layer { + text-name: [name]; + text-face-name: "El&Font Bubble Regular"; +} diff --git a/test/rendering-mss/text-face-name-escaping.xml b/test/rendering-mss/text-face-name-escaping.xml new file mode 100644 index 0000000..dc97306 --- /dev/null +++ b/test/rendering-mss/text-face-name-escaping.xml @@ -0,0 +1,5 @@ + diff --git a/test/rendering-mss/variable-quoting-of-enum.mss b/test/rendering-mss/variable-quoting-of-enum.mss new file mode 100644 index 0000000..e7655aa --- /dev/null +++ b/test/rendering-mss/variable-quoting-of-enum.mss @@ -0,0 +1,5 @@ +#world { + line-rasterizer: 'fast'; + // carto should collapse to one + line-rasterizer: fast; +} diff --git a/test/rendering-mss/variable-quoting-of-enum.xml b/test/rendering-mss/variable-quoting-of-enum.xml new file mode 100644 index 0000000..5570fa5 --- /dev/null +++ b/test/rendering-mss/variable-quoting-of-enum.xml @@ -0,0 +1,5 @@ + diff --git a/test/rendering-mss/zoom-like-field-name.mss b/test/rendering-mss/zoom-like-field-name.mss new file mode 100644 index 0000000..9cc5772 --- /dev/null +++ b/test/rendering-mss/zoom-like-field-name.mss @@ -0,0 +1,3 @@ +#world[zoomy > 2] { + polygon-fill:#f00; +} \ No newline at end of file diff --git a/test/rendering-mss/zoom-like-field-name.xml b/test/rendering-mss/zoom-like-field-name.xml new file mode 100644 index 0000000..6dd4c2d --- /dev/null +++ b/test/rendering-mss/zoom-like-field-name.xml @@ -0,0 +1,6 @@ + diff --git a/test/rendering-mss/zoom_space.mss b/test/rendering-mss/zoom_space.mss new file mode 100644 index 0000000..5c813f4 --- /dev/null +++ b/test/rendering-mss/zoom_space.mss @@ -0,0 +1,3 @@ +#world[ zoom > 2] { + polygon-fill:#f00; +} diff --git a/test/rendering-mss/zoom_space.xml b/test/rendering-mss/zoom_space.xml new file mode 100644 index 0000000..98bcbea --- /dev/null +++ b/test/rendering-mss/zoom_space.xml @@ -0,0 +1,6 @@ + diff --git a/test/rendering.test.js b/test/rendering.test.js new file mode 100644 index 0000000..66dd87a --- /dev/null +++ b/test/rendering.test.js @@ -0,0 +1,102 @@ +var path = require('path'), + fs = require('fs'), + assert = require('assert'), + semver = require('semver'), + _ = require('lodash'); + +var carto = require('../lib/carto'), + helper = require('./support/helper'), + util = require('../lib/carto/util'); + +describe('Rendering', function() { + + it('should support rendering without Stylesheet (for non-styling/vector tile usage)', function(done) { + + // note: this intentionally does not have a `"Stylesheet":[]` property + // so we should skip trying to validate it + var opts = {"name":"","description":"", + "attribution":"", + "center":[0,0,3], + "format":"pbf", + "minzoom":0, + "maxzoom":6, + "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", + "Layer":[], + "json":"{\"vector_layers\":[]}"}; + var renderer = new carto.Renderer(null).render(opts); + assert.ok(renderer); + done(); + }); + + +helper.files('rendering', 'mml', function(file) { + var api = null, + filename = path.basename(file); + if (filename.indexOf('_api') !== -1) { + api = filename.substring(filename.indexOf('_api') + 4, filename.length - 4); + if (!semver.valid(api)) { + api = null; + } + } + it('should render ' + path.basename(file) + ' correctly', function(done) { + helper.mml(file, function (err, mml) { + var output = { + msg: null, + data: null + }; + if (!err) { + var env = { + paths: [ path.dirname(file) ], + data_dir: path.join(__dirname, '../data'), + local_data_dir: path.join(__dirname, 'rendering'), + filename: file + }, + renderer = null; + + if (api) { + env.version = api + } + renderer = new carto.Renderer(env); + output = renderer.render(mml); + } + else { + output.msg = err; + } + if (!_.isNil(output.data)) { + var result = helper.resultFile(file); + helper.compareToXMLFile(result, output.data, function(err,expected_json,actual_json) { + var actual = file.replace(path.extname(file),'') + '-actual.json'; + var expected = file.replace(path.extname(file),'') + '-expected.json'; + if (err) { + fs.writeFileSync(actual,JSON.stringify(actual_json,null,4)); + fs.writeFileSync(expected,JSON.stringify(expected_json,null,4)); + throw new Error('failed: xml ' + result + ' in json form does not match expected result:\n' + actual + ' (actual)\n' + expected + ' (expected)'); + } else { + // cleanup any actual renders that no longer fail + try { + fs.unlinkSync(actual); + fs.unlinkSync(expected); + } catch (err) { + // do nothing + } + } + done(); + }, [ + helper.removeAbsoluteImages, + helper.removeAbsoluteDatasources + ]); + } + else { + if (_.has(output, 'msg') && _.isArray(output.msg) && + output.msg.length > 0) { + assert.fail('','', util.getMessagesToPrint(output.msg)); + } + else { + assert.fail('', '', 'Output was nil but no msg property found.'); + } + done(); + } + }); + }); +}); +}); diff --git a/test/rendering/afghanistan_votes.mml b/test/rendering/afghanistan_votes.mml new file mode 100644 index 0000000..d5b437d --- /dev/null +++ b/test/rendering/afghanistan_votes.mml @@ -0,0 +1,15 @@ +{ + "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", + "Stylesheet": [ + "afghanistan_votes.mss" + ], + "Layer": [{ + "id": "data", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/district.geojson", + "type": "ogr", + "layer": "OGRGeoJSON" + } + }] +} diff --git a/test/rendering/afghanistan_votes.mss b/test/rendering/afghanistan_votes.mss new file mode 100644 index 0000000..f1eae0d --- /dev/null +++ b/test/rendering/afghanistan_votes.mss @@ -0,0 +1,69 @@ +#data[_votes_total_null = 0][votes_total >= 3][votes_total <= 34730.2] { + marker-allow-overlap: true; + marker-width: 2; + marker-height: 2; + marker-fill: #222; + marker-opacity: 0.8; + marker-line-width: 0; + marker-line-color: #222; + marker-line-opacity: 0.8; +} + +#data[_votes_total_null = 0][votes_total >= 34730.2][votes_total <= 69457.4] { + marker-allow-overlap: true; + marker-width: 5; + marker-height: 5; + marker-fill: #222; + marker-opacity: .8; + marker-line-width: 0; + marker-line-color: #222; + marker-line-opacity: .8; +} + + +#data[_votes_total_null = 0][votes_total >= 69457.4][votes_total <= 104184.59999999999] { + marker-allow-overlap: true; + marker-width: 8; + marker-height: 8; + marker-fill: #222; + marker-opacity: .8; + marker-line-width: 0; + marker-line-color: #222; + marker-line-opacity: .8; +} + + +#data[_votes_total_null = 0][votes_total >= 104184.59999999999][votes_total <= 138911.8] { + marker-allow-overlap: true; + marker-width: 11; + marker-height: 11; + marker-fill: #222; + marker-opacity: .8; + marker-line-width: 0; + marker-line-color: #222; + marker-line-opacity: .8; +} + + +#data[_votes_total_null = 0][votes_total >= 138911.8][votes_total <= 173639] { + marker-allow-overlap: true; + marker-width: 14; + marker-height: 14; + marker-fill: #222; + marker-opacity: .8; + marker-line-width: 0; + marker-line-color: #222; + marker-line-opacity: .8; +} + + +#data[_votes_total_null = 0][votes_total >= 173639][votes_total <= 208366.2] { + marker-allow-overlap: true; + marker-width: 17; + marker-height: 17; + marker-fill: #222; + marker-opacity: .8; + marker-line-width: 0; + marker-line-color: #222; + marker-line-opacity: .8; +} diff --git a/test/rendering/afghanistan_votes.result b/test/rendering/afghanistan_votes.result new file mode 100644 index 0000000..c8d31bc --- /dev/null +++ b/test/rendering/afghanistan_votes.result @@ -0,0 +1,39 @@ + + + + + + data + + + + + + + diff --git a/test/rendering/background_attributes.mml b/test/rendering/background_attributes.mml new file mode 100644 index 0000000..f375514 --- /dev/null +++ b/test/rendering/background_attributes.mml @@ -0,0 +1,7 @@ +{ + "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", + "Stylesheet": [ + "background_attributes.mss" + ], + "Layer": [] +} diff --git a/test/rendering/background_attributes.mss b/test/rendering/background_attributes.mss new file mode 100644 index 0000000..df14b9f --- /dev/null +++ b/test/rendering/background_attributes.mss @@ -0,0 +1,3 @@ +Map { + background-color: #fff; +} diff --git a/test/rendering/background_attributes.result b/test/rendering/background_attributes.result new file mode 100644 index 0000000..a37b50e --- /dev/null +++ b/test/rendering/background_attributes.result @@ -0,0 +1,3 @@ + + + diff --git a/test/rendering/buffersize.mml b/test/rendering/buffersize.mml new file mode 100644 index 0000000..52995a1 --- /dev/null +++ b/test/rendering/buffersize.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "buffersize.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/buffersize.mss b/test/rendering/buffersize.mss new file mode 100644 index 0000000..8c160b8 --- /dev/null +++ b/test/rendering/buffersize.mss @@ -0,0 +1,10 @@ +Map { + buffer-size: 256; +} + +#world { + text-name: "[NAME]"; + text-size: 11; + text-face-name: "Georgia Regular", "Arial Italic"; +} + diff --git a/test/rendering/buffersize.result b/test/rendering/buffersize.result new file mode 100644 index 0000000..325a7ab --- /dev/null +++ b/test/rendering/buffersize.result @@ -0,0 +1,22 @@ + + + + + + + + + + world + + + + + + + diff --git a/test/rendering/building_height.mml b/test/rendering/building_height.mml new file mode 100644 index 0000000..93122eb --- /dev/null +++ b/test/rendering/building_height.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "building_height.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/building_height.mss b/test/rendering/building_height.mss new file mode 100644 index 0000000..6122c84 --- /dev/null +++ b/test/rendering/building_height.mss @@ -0,0 +1,4 @@ +@n: 4; +#world { + building-height: 2 * 3 * [HEIGHT] + 2 + [NOTHEIGHT] + (@n * 2); +} diff --git a/test/rendering/building_height.result b/test/rendering/building_height.result new file mode 100644 index 0000000..f1da5a5 --- /dev/null +++ b/test/rendering/building_height.result @@ -0,0 +1,20 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/combined_class.mml b/test/rendering/combined_class.mml new file mode 100644 index 0000000..6ba4d7b --- /dev/null +++ b/test/rendering/combined_class.mml @@ -0,0 +1,26 @@ +{ + "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", + "Stylesheet": [ + "combined_class.mss" + ], + "Layer": [ + { + "id": "just_land", + "class": "land", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }, + { + "id": "lakes", + "class": "land", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + } + ] +} diff --git a/test/rendering/combined_class.mss b/test/rendering/combined_class.mss new file mode 100644 index 0000000..f035dca --- /dev/null +++ b/test/rendering/combined_class.mss @@ -0,0 +1,11 @@ +/* Applies to all layers with .land class */ +.land { + line-color: #ccc; + line-width: 0.5; + polygon-fill: #eee; +} +.land#lakes { + line-color: #ccc; + line-width: 0.5; + polygon-fill: #000; +} diff --git a/test/rendering/combined_class.result b/test/rendering/combined_class.result new file mode 100644 index 0000000..f6f6071 --- /dev/null +++ b/test/rendering/combined_class.result @@ -0,0 +1,36 @@ + + + + + + + + just_land + + + + + + + + + lakes + + + + + + + diff --git a/test/rendering/complex_cascades.mml b/test/rendering/complex_cascades.mml new file mode 100644 index 0000000..9f92000 --- /dev/null +++ b/test/rendering/complex_cascades.mml @@ -0,0 +1,23 @@ +{ + "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", + "Stylesheet": [ + "complex_cascades.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }, + { + "class": "new", + "id": "countries", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/complex_cascades.mss b/test/rendering/complex_cascades.mss new file mode 100644 index 0000000..13f6fa3 --- /dev/null +++ b/test/rendering/complex_cascades.mss @@ -0,0 +1,31 @@ +#world { + polygon-fill: #FFF; + line-color:#F00; + line-width: 0.5; +} + +#world[NAME='United States'] { + polygon-fill:#CCC; + [zoom > 6] { polygon-fill:#DDD; } + [zoom > 7] { polygon-fill:#999; } + [zoom > 5] { polygon-fill:#666; } +} + +#world[NAME='Canada'], +#countries { + polygon-fill: #eee; + line-color: #ccc; + line-width: 1; + + .new { + polygon-fill: #CCC; + } + + .new[zoom > 5] { + line-width:0.5; + + [NAME='United States'] { + polygon-fill:#AFC; + } + } +} diff --git a/test/rendering/complex_cascades.result b/test/rendering/complex_cascades.result new file mode 100644 index 0000000..577f019 --- /dev/null +++ b/test/rendering/complex_cascades.result @@ -0,0 +1,71 @@ + + + + + + + + world + + + + + + + + + countries + + + + + + + diff --git a/test/rendering/complexfontset.mml b/test/rendering/complexfontset.mml new file mode 100644 index 0000000..0107848 --- /dev/null +++ b/test/rendering/complexfontset.mml @@ -0,0 +1,23 @@ +{ + "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", + "Stylesheet": [ + "complexfontset.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }, + { + "class": "new", + "id": "countries", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/complexfontset.mss b/test/rendering/complexfontset.mss new file mode 100644 index 0000000..fae4aea --- /dev/null +++ b/test/rendering/complexfontset.mss @@ -0,0 +1,11 @@ +#world { + text-name: "[NAME]"; + text-size: 11; + text-face-name: "Georgia Regular", "Arial Italic"; +} + +#countries { + text-name: "[NAME]"; + text-size: 11; + text-face-name: "Georgia Regular", "Arial Italic"; +} diff --git a/test/rendering/complexfontset.result b/test/rendering/complexfontset.result new file mode 100644 index 0000000..119cb54 --- /dev/null +++ b/test/rendering/complexfontset.result @@ -0,0 +1,37 @@ + + + + + + + + + + + world + + + + + + + + + countries + + + + + + + diff --git a/test/rendering/cross_stylesheet_variable.mml b/test/rendering/cross_stylesheet_variable.mml new file mode 100644 index 0000000..b53bd2a --- /dev/null +++ b/test/rendering/cross_stylesheet_variable.mml @@ -0,0 +1,15 @@ +{ + "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", + "Stylesheet": [ + "cross_stylesheet_variable_a.mss", + "cross_stylesheet_variable_b.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/cross_stylesheet_variable.result b/test/rendering/cross_stylesheet_variable.result new file mode 100644 index 0000000..f31943f --- /dev/null +++ b/test/rendering/cross_stylesheet_variable.result @@ -0,0 +1,21 @@ + + + + + + + + world + + [absolute path] + shape + + + + diff --git a/test/rendering/cross_stylesheet_variable_a.mss b/test/rendering/cross_stylesheet_variable_a.mss new file mode 100644 index 0000000..e78a26f --- /dev/null +++ b/test/rendering/cross_stylesheet_variable_a.mss @@ -0,0 +1 @@ +@b: #f00; diff --git a/test/rendering/cross_stylesheet_variable_b.mss b/test/rendering/cross_stylesheet_variable_b.mss new file mode 100644 index 0000000..0f95410 --- /dev/null +++ b/test/rendering/cross_stylesheet_variable_b.mss @@ -0,0 +1,3 @@ +#world { + polygon-fill: @b; +} diff --git a/test/rendering/data_only.mml b/test/rendering/data_only.mml new file mode 100644 index 0000000..472964a --- /dev/null +++ b/test/rendering/data_only.mml @@ -0,0 +1,12 @@ +{ + "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", + "Stylesheet": [], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/data_only.result b/test/rendering/data_only.result new file mode 100644 index 0000000..d7ae309 --- /dev/null +++ b/test/rendering/data_only.result @@ -0,0 +1,14 @@ + + + + + + + + + + + + + diff --git a/test/rendering/empty_style.mml b/test/rendering/empty_style.mml new file mode 100644 index 0000000..159efce --- /dev/null +++ b/test/rendering/empty_style.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "empty_style.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/empty_style.mss b/test/rendering/empty_style.mss new file mode 100644 index 0000000..22cf7c3 --- /dev/null +++ b/test/rendering/empty_style.mss @@ -0,0 +1,8 @@ +#world { + ::outline { + line-color: #000000; + } + ::fill { + line-color: #ffffff; + } +} diff --git a/test/rendering/empty_style.result b/test/rendering/empty_style.result new file mode 100644 index 0000000..13402cc --- /dev/null +++ b/test/rendering/empty_style.result @@ -0,0 +1,26 @@ + + + + + + + + + world-outline + world-fill + + + + + + + diff --git a/test/rendering/empty_url.mml b/test/rendering/empty_url.mml new file mode 100644 index 0000000..1317e71 --- /dev/null +++ b/test/rendering/empty_url.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "empty_url.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/empty_url.mss b/test/rendering/empty_url.mss new file mode 100644 index 0000000..5f0fc86 --- /dev/null +++ b/test/rendering/empty_url.mss @@ -0,0 +1,3 @@ +#world { + marker-file:url(""); +} diff --git a/test/rendering/empty_url.result b/test/rendering/empty_url.result new file mode 100644 index 0000000..fac8060 --- /dev/null +++ b/test/rendering/empty_url.result @@ -0,0 +1,20 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/external_image.mml b/test/rendering/external_image.mml new file mode 100644 index 0000000..84c20f0 --- /dev/null +++ b/test/rendering/external_image.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "external_image.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/external_image.mss b/test/rendering/external_image.mss new file mode 100644 index 0000000..49e7282 --- /dev/null +++ b/test/rendering/external_image.mss @@ -0,0 +1,3 @@ +#world { + polygon-pattern-file: url('http://a.tile.openstreetmap.org/0/0/0.png'); +} diff --git a/test/rendering/external_image.result b/test/rendering/external_image.result new file mode 100644 index 0000000..b4fbc05 --- /dev/null +++ b/test/rendering/external_image.result @@ -0,0 +1,21 @@ + + + + + + + + world + + [absolute path] + shape + + + + diff --git a/test/rendering/fadeout.mml b/test/rendering/fadeout.mml new file mode 100644 index 0000000..da1cdc3 --- /dev/null +++ b/test/rendering/fadeout.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "fadeout.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/fadeout.mss b/test/rendering/fadeout.mss new file mode 100644 index 0000000..071cbe7 --- /dev/null +++ b/test/rendering/fadeout.mss @@ -0,0 +1,3 @@ +#world { + marker-fill: fadeout(#000, 50%); +} diff --git a/test/rendering/fadeout.result b/test/rendering/fadeout.result new file mode 100644 index 0000000..91ef42d --- /dev/null +++ b/test/rendering/fadeout.result @@ -0,0 +1,20 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/field.mml b/test/rendering/field.mml new file mode 100644 index 0000000..633a86c --- /dev/null +++ b/test/rendering/field.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "field.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/field.mss b/test/rendering/field.mss new file mode 100644 index 0000000..5cd939b --- /dev/null +++ b/test/rendering/field.mss @@ -0,0 +1,6 @@ +#world { + text-name: "hello " + [NAME] + " hello"; + text-size: 11; + text-face-name: "Georgia Regular", "Arial Italic"; +} + diff --git a/test/rendering/field.result b/test/rendering/field.result new file mode 100644 index 0000000..b4a56d9 --- /dev/null +++ b/test/rendering/field.result @@ -0,0 +1,23 @@ + + + + + + + + + + + world + + + + + + + diff --git a/test/rendering/field_advanced.mml b/test/rendering/field_advanced.mml new file mode 100644 index 0000000..d74d082 --- /dev/null +++ b/test/rendering/field_advanced.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "field_advanced.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/field_advanced.mss b/test/rendering/field_advanced.mss new file mode 100644 index 0000000..68f41e8 --- /dev/null +++ b/test/rendering/field_advanced.mss @@ -0,0 +1,6 @@ +#world { + text-name: "hello " + [NAME] + " hello" + 2; + text-size: 11; + text-face-name: "Georgia Regular", "Arial Italic"; +} + diff --git a/test/rendering/field_advanced.result b/test/rendering/field_advanced.result new file mode 100644 index 0000000..9673df2 --- /dev/null +++ b/test/rendering/field_advanced.result @@ -0,0 +1,23 @@ + + + + + + + + + + + world + + + + + + + diff --git a/test/rendering/filter_comparing_fields.mml b/test/rendering/filter_comparing_fields.mml new file mode 100644 index 0000000..f43c1d5 --- /dev/null +++ b/test/rendering/filter_comparing_fields.mml @@ -0,0 +1,15 @@ +{ + "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", + "Stylesheet": [ + "filter_comparing_fields.mss" + ], + "Layer": [{ + "id": "world", + "class": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/filter_comparing_fields.mss b/test/rendering/filter_comparing_fields.mss new file mode 100644 index 0000000..50e8d3b --- /dev/null +++ b/test/rendering/filter_comparing_fields.mss @@ -0,0 +1,23 @@ +#world[[FOO] = [BAR]] { + polygon-fill: #FFF; + line-color:#F00; + line-width: 0.5; +} + +#world[[BAR] = [HI]] { + polygon-fill: #FFF; + line-color:#F00; + line-width: 0.5; +} + +#world[[BAR] = [HI]] { + polygon-fill: #FFF; + line-color:#F00; + line-width: 5; +} + +#world[[BAR] > [HI]] { + polygon-fill: #FFF; + line-color:#F00; + line-width: 5; +} diff --git a/test/rendering/filter_comparing_fields.result b/test/rendering/filter_comparing_fields.result new file mode 100644 index 0000000..93c8eb4 --- /dev/null +++ b/test/rendering/filter_comparing_fields.result @@ -0,0 +1,32 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/filterexp.mml b/test/rendering/filterexp.mml new file mode 100644 index 0000000..a940221 --- /dev/null +++ b/test/rendering/filterexp.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "filterexp.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/filterexp.mss b/test/rendering/filterexp.mss new file mode 100644 index 0000000..ca51149 --- /dev/null +++ b/test/rendering/filterexp.mss @@ -0,0 +1 @@ +#world [a = 1.2e3][b = 1.2e-3][c = 1.2e+3] { polygon-fill:#fff; } diff --git a/test/rendering/filterexp.result b/test/rendering/filterexp.result new file mode 100644 index 0000000..ef6845a --- /dev/null +++ b/test/rendering/filterexp.result @@ -0,0 +1,21 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/filterquote.mml b/test/rendering/filterquote.mml new file mode 100644 index 0000000..a67a0ac --- /dev/null +++ b/test/rendering/filterquote.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "filterquote.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/filterquote.mss b/test/rendering/filterquote.mss new file mode 100644 index 0000000..7e10fc8 --- /dev/null +++ b/test/rendering/filterquote.mss @@ -0,0 +1,3 @@ +#world[name2=" Sa'ad"] { + polygon-fill:#fff; +} diff --git a/test/rendering/filterquote.result b/test/rendering/filterquote.result new file mode 100644 index 0000000..c8a4806 --- /dev/null +++ b/test/rendering/filterquote.result @@ -0,0 +1,21 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/filters.mml b/test/rendering/filters.mml new file mode 100644 index 0000000..3968ba2 --- /dev/null +++ b/test/rendering/filters.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "filters.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/filters.mss b/test/rendering/filters.mss new file mode 100644 index 0000000..2d63cc8 --- /dev/null +++ b/test/rendering/filters.mss @@ -0,0 +1,5 @@ +#world[[POP2005] > 100.1] { + polygon-fill: #FFF; + line-color:#F00; + line-width: 0.5; +} diff --git a/test/rendering/filters.result b/test/rendering/filters.result new file mode 100644 index 0000000..a667499 --- /dev/null +++ b/test/rendering/filters.result @@ -0,0 +1,22 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/filtervariable.mml b/test/rendering/filtervariable.mml new file mode 100644 index 0000000..5d14084 --- /dev/null +++ b/test/rendering/filtervariable.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "filtervariable.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/filtervariable.mss b/test/rendering/filtervariable.mss new file mode 100644 index 0000000..e0d4ffb --- /dev/null +++ b/test/rendering/filtervariable.mss @@ -0,0 +1,9 @@ +@us: 'US'; +@thing: [COUNTRY]; + +#world[COUNTRY=@us] { + polygon-fill: #000; +} +#world[@thing != 'US'] { + polygon-fill: #f00; + } diff --git a/test/rendering/filtervariable.result b/test/rendering/filtervariable.result new file mode 100644 index 0000000..723c7fc --- /dev/null +++ b/test/rendering/filtervariable.result @@ -0,0 +1,26 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/filtervariable2.mml b/test/rendering/filtervariable2.mml new file mode 100644 index 0000000..3bda673 --- /dev/null +++ b/test/rendering/filtervariable2.mml @@ -0,0 +1,10 @@ +{ + "Layer": [ + { + "id": "a" + } + ], + "Stylesheet": [ + "filtervariable2.mss" + ] +} diff --git a/test/rendering/filtervariable2.mss b/test/rendering/filtervariable2.mss new file mode 100644 index 0000000..ff98746 --- /dev/null +++ b/test/rendering/filtervariable2.mss @@ -0,0 +1,6 @@ +Map { } +@x: 'X'; +[CODE!=@x] { + line-color: red; + [zoom>=15] { line-color: green; } +} diff --git a/test/rendering/filtervariable2.result b/test/rendering/filtervariable2.result new file mode 100644 index 0000000..bb99398 --- /dev/null +++ b/test/rendering/filtervariable2.result @@ -0,0 +1,22 @@ + + + + + + + + a + + diff --git a/test/rendering/fontset-duplication.mml b/test/rendering/fontset-duplication.mml new file mode 100644 index 0000000..1e0a601 --- /dev/null +++ b/test/rendering/fontset-duplication.mml @@ -0,0 +1,28 @@ +{ + "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", + "Stylesheet":[ + "fontset-duplication.mss" + ], + "Layer":[ + { + "id":"city", + "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", + "class":"", + "Datasource":{ + "file":"http://tilemill-data.s3.amazonaws.com/natural-earth-10m-1.3.0/populated_places_simple.zip", + "type":"shape" + }, + "geometry":"point" + }, + { + "id":"country-label", + "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", + "class":"", + "Datasource":{ + "file":"http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type":"shape" + }, + "geometry":"point" + } + ] +} diff --git a/test/rendering/fontset-duplication.mss b/test/rendering/fontset-duplication.mss new file mode 100644 index 0000000..e158cbe --- /dev/null +++ b/test/rendering/fontset-duplication.mss @@ -0,0 +1,141 @@ +/* Font sets */ +@gothic_book: "Franklin Gothic FS Book","DejaVu Sans Book"; +@gothic_med: "Franklin Gothic FS Medium","DejaVu Sans Book"; + +/* ---- COUNTRIES ---- */ +#country-label[zoom>1][zoom<10]{ + text-face-name: @gothic_book; + text-fill:rgba(0,0,0,0.5); + text-size:9; + text-transform:uppercase; + text-halo-fill:rgba(255,255,255,0.5); + text-halo-radius:1; + text-character-spacing:1; + text-line-spacing:1; + text-wrap-width:20; + text-name:"''"; + [zoom=3] { + text-size:9; + } + [zoom=4] { + text-size:11; + } + [zoom=5] { + text-size:12; + text-character-spacing:1; + text-line-spacing:1; + } + [zoom=6] { + text-size:14; + text-character-spacing:2; + text-line-spacing:2; + } + [zoom>6][zoom<10] { + text-size:16; + text-character-spacing:2; + text-line-spacing:4; + } + + [zoom>=2][Z_ABBREV = 2], + [zoom>=3][Z_ABBREV = 3], + [zoom>=4][Z_ABBREV = 4], + [zoom>=5][Z_ABBREV = 5], + [zoom>=6][Z_ABBREV = 6] { text-name: "[ABBREV]"; } + + [zoom>=2][Z_NAME = 2], + [zoom>=3][Z_NAME = 3], + [zoom>=4][Z_NAME = 4], + [zoom>=5][Z_NAME = 5], + [zoom>=6][Z_NAME = 6] { text-name: "[NAME]"; } + + [zoom>=2][Z_ADMIN = 2], + [zoom>=3][Z_ADMIN = 3], + [zoom>=4][Z_ADMIN = 4], + [zoom>=5][Z_ADMIN = 5], + [zoom>=6][Z_ADMIN = 6] { text-name: "[ADMIN]"; } +} + +/* ---- CITIES ---- */ +#city { + [SCALERANK<3][zoom>=4], + [SCALERANK=3][zoom>=5], + [SCALERANK=4][zoom>=5], + [SCALERANK=5][zoom>=6], + [SCALERANK=6][zoom>=6], + [SCALERANK=7][zoom>=7], + [SCALERANK=8][zoom>=7], + [SCALERANK=9][zoom>=8], + [SCALERANK=10][zoom>=8] { + text-name: "[NAMEASCII]"; + text-face-name: @gothic_med; + text-size: 10; + text-fill: rgba(0,0,0,0.6); + text-halo-radius: 1; + text-halo-fill: rgba(255,255,255,0.4); + } + [zoom=4] { + [SCALERANK<3] { text-size: 12; } + } + [zoom=5] { + [SCALERANK<3] { text-size: 13; } + [SCALERANK=3] { text-size: 12; } + [SCALERANK=4] { text-size: 11; } + } + [zoom=6] { + [SCALERANK<3] { text-size: 14; } + [SCALERANK=3] { text-size: 13; } + [SCALERANK=4] { text-size: 12; } + [SCALERANK=5] { text-size: 11; } + } + [zoom=7] { + [SCALERANK<3] { text-size: 15; } + [SCALERANK=3] { text-size: 14; } + [SCALERANK=4] { text-size: 13; } + [SCALERANK=5] { text-size: 12; } + [SCALERANK=6] { text-size: 11; } + [SCALERANK=7] { text-size: 11; } + } + [zoom=8] { + [SCALERANK<3] { text-size: 15; } + [SCALERANK=3] { text-size: 15; } + [SCALERANK=4] { text-size: 14; } + [SCALERANK=5] { text-size: 14; } + [SCALERANK=6] { text-size: 13; } + [SCALERANK=7] { text-size: 13; } + [SCALERANK=8] { text-size: 12; } + [SCALERANK=9] { text-size: 11; } + } + [zoom=9] { + [SCALERANK<3] { text-size: 16; } + [SCALERANK=3] { text-size: 16; } + [SCALERANK=4] { text-size: 15; } + [SCALERANK=5] { text-size: 15; } + [SCALERANK=6] { text-size: 14; } + [SCALERANK=7] { text-size: 14; } + [SCALERANK=8] { text-size: 13; } + [SCALERANK=9] { text-size: 13; } + [SCALERANK=10] { text-size: 12; } + } + [zoom=10] { + [SCALERANK<3] { text-size: 16; text-character-spacing:2; } + [SCALERANK=3] { text-size: 16; text-character-spacing:2; } + [SCALERANK=4] { text-size: 15; text-character-spacing:1; } + [SCALERANK=5] { text-size: 15; text-character-spacing:1; } + [SCALERANK=6] { text-size: 15; text-character-spacing:1; } + [SCALERANK=7] { text-size: 14; } + [SCALERANK=8] { text-size: 14; } + [SCALERANK=9] { text-size: 13; } + [SCALERANK=10] { text-size: 13; } + } + [zoom>10] { + [SCALERANK<3] { text-size: 16; text-character-spacing:3; } + [SCALERANK=3] { text-size: 16; text-character-spacing:3; } + [SCALERANK=4] { text-size: 16; text-character-spacing:3; } + [SCALERANK=5] { text-size: 15; text-character-spacing:2; } + [SCALERANK=6] { text-size: 15; text-character-spacing:2; } + [SCALERANK=7] { text-size: 15; text-character-spacing:2; } + [SCALERANK=8] { text-size: 14; text-character-spacing:1; } + [SCALERANK=9] { text-size: 14; text-character-spacing:1; } + [SCALERANK=10] { text-size: 14; text-character-spacing:1; } + } +} diff --git a/test/rendering/fontset-duplication.result b/test/rendering/fontset-duplication.result new file mode 100644 index 0000000..5428542 --- /dev/null +++ b/test/rendering/fontset-duplication.result @@ -0,0 +1,5228 @@ + + + + + + + + + + + + + + + city + + + + + + + + + country-label + + + + + + + diff --git a/test/rendering/gray_function.mml b/test/rendering/gray_function.mml new file mode 100644 index 0000000..38f611b --- /dev/null +++ b/test/rendering/gray_function.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "gray_function.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/gray_function.mss b/test/rendering/gray_function.mss new file mode 100644 index 0000000..e2bdcfc --- /dev/null +++ b/test/rendering/gray_function.mss @@ -0,0 +1,3 @@ +#world { + polygon-fill:gray; +} diff --git a/test/rendering/gray_function.result b/test/rendering/gray_function.result new file mode 100644 index 0000000..68f0e57 --- /dev/null +++ b/test/rendering/gray_function.result @@ -0,0 +1,20 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/highzooms.mml b/test/rendering/highzooms.mml new file mode 100644 index 0000000..06164e8 --- /dev/null +++ b/test/rendering/highzooms.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "highzooms.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/highzooms.mss b/test/rendering/highzooms.mss new file mode 100644 index 0000000..bfc40d5 --- /dev/null +++ b/test/rendering/highzooms.mss @@ -0,0 +1,9 @@ +#world { + polygon-fill: #000; + [zoom=22] { polygon-fill: #f00000; } + [zoom=21] { polygon-fill: #0f0000; } + [zoom=20] { polygon-fill: #00f000; } + [zoom=19] { polygon-fill: #000f00; } + [zoom=18] { polygon-fill: #0000f0; } + [zoom=17] { polygon-fill: #00000f; } +} diff --git a/test/rendering/highzooms.result b/test/rendering/highzooms.result new file mode 100644 index 0000000..5973517 --- /dev/null +++ b/test/rendering/highzooms.result @@ -0,0 +1,51 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/identity.mml b/test/rendering/identity.mml new file mode 100644 index 0000000..b8de3d2 --- /dev/null +++ b/test/rendering/identity.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "identity.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/identity.mss b/test/rendering/identity.mss new file mode 100644 index 0000000..1af2b90 --- /dev/null +++ b/test/rendering/identity.mss @@ -0,0 +1,5 @@ +#world[foo='bar'] { + #world[foo='bar'] { + marker-width: 5; + } +} diff --git a/test/rendering/identity.result b/test/rendering/identity.result new file mode 100644 index 0000000..1df3752 --- /dev/null +++ b/test/rendering/identity.result @@ -0,0 +1,21 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/image_filters.mml b/test/rendering/image_filters.mml new file mode 100644 index 0000000..2ba9ed1 --- /dev/null +++ b/test/rendering/image_filters.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "image_filters.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/image_filters.mss b/test/rendering/image_filters.mss new file mode 100644 index 0000000..66b7db2 --- /dev/null +++ b/test/rendering/image_filters.mss @@ -0,0 +1,8 @@ +#world { + polygon-fill: #FFF; + line-color:#F00; + line-width: 0.5; + image-filters: blur(), sharpen(), agg-stack-blur(2, 2); + comp-op: src-in; + line-dasharray: 2, 3; +} diff --git a/test/rendering/image_filters.result b/test/rendering/image_filters.result new file mode 100644 index 0000000..6a39666 --- /dev/null +++ b/test/rendering/image_filters.result @@ -0,0 +1,21 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/imagefilter-duplication.mml b/test/rendering/imagefilter-duplication.mml new file mode 100644 index 0000000..ab2032c --- /dev/null +++ b/test/rendering/imagefilter-duplication.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "imagefilter-duplication.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/imagefilter-duplication.mss b/test/rendering/imagefilter-duplication.mss new file mode 100644 index 0000000..0c65c5f --- /dev/null +++ b/test/rendering/imagefilter-duplication.mss @@ -0,0 +1,5 @@ +#world { + image-filters:agg-stack-blur(3,3); + [zoom=2] { line-width: 3; } + [zoom=3] { line-width: 5; } +} diff --git a/test/rendering/imagefilter-duplication.result b/test/rendering/imagefilter-duplication.result new file mode 100644 index 0000000..9e9832d --- /dev/null +++ b/test/rendering/imagefilter-duplication.result @@ -0,0 +1,27 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/instance_names.mml b/test/rendering/instance_names.mml new file mode 100644 index 0000000..150abb2 --- /dev/null +++ b/test/rendering/instance_names.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "instance_names.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/instance_names.mss b/test/rendering/instance_names.mss new file mode 100644 index 0000000..86e631c --- /dev/null +++ b/test/rendering/instance_names.mss @@ -0,0 +1,15 @@ +#world[zoom >= 13] { + center/line-width: 1; + center/line-color: black; +} + +#world[zoom >= 14] { + center/line-width: 5; + center/line-color: blue; +} + +#world[highway='primary'][zoom >= 14] { + dash/line-color: red; + dash/line-width: 15; + dash/line-dasharray: 5,15; +} diff --git a/test/rendering/instance_names.result b/test/rendering/instance_names.result new file mode 100644 index 0000000..482d6b1 --- /dev/null +++ b/test/rendering/instance_names.result @@ -0,0 +1,38 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/issue294.mml b/test/rendering/issue294.mml new file mode 100644 index 0000000..14e4cd6 --- /dev/null +++ b/test/rendering/issue294.mml @@ -0,0 +1,11 @@ +{ + "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", + "Stylesheet": [], + "Layer": [{ + "id": "world", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/issue294.result b/test/rendering/issue294.result new file mode 100644 index 0000000..2cd0e7d --- /dev/null +++ b/test/rendering/issue294.result @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + diff --git a/test/rendering/issue32.mml b/test/rendering/issue32.mml new file mode 100644 index 0000000..0bda48d --- /dev/null +++ b/test/rendering/issue32.mml @@ -0,0 +1,15 @@ +{ + "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", + "Stylesheet": [ + "issue32a.mss", + "issue32.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/issue32.mss b/test/rendering/issue32.mss new file mode 100644 index 0000000..29154e6 --- /dev/null +++ b/test/rendering/issue32.mss @@ -0,0 +1,4 @@ +Map { + background-color: #aaaaff; +} + diff --git a/test/rendering/issue32.result b/test/rendering/issue32.result new file mode 100644 index 0000000..43936e2 --- /dev/null +++ b/test/rendering/issue32.result @@ -0,0 +1,26 @@ + + + + + + + + + world-outline + world + + + + + + + diff --git a/test/rendering/issue32a.mss b/test/rendering/issue32a.mss new file mode 100644 index 0000000..688419d --- /dev/null +++ b/test/rendering/issue32a.mss @@ -0,0 +1,8 @@ +#world { + ::outline { + line-color: #000000; + line-width: 8.0; + } + line-color: #ffffff; + line-width: 6.0; +} diff --git a/test/rendering/issue60.mml b/test/rendering/issue60.mml new file mode 100644 index 0000000..b7e4f79 --- /dev/null +++ b/test/rendering/issue60.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "issue60.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/issue60.mss b/test/rendering/issue60.mss new file mode 100644 index 0000000..baf44fa --- /dev/null +++ b/test/rendering/issue60.mss @@ -0,0 +1,6 @@ +#world { + [NET_INFLOW > -30000] { polygon-fill: #f00; } + [NET_INFLOW > -10000] { polygon-fill: #0f0; } +} + +#world [OBJECTID=12] { polygon-pattern-file:url(../resources/textures/stripe.png); } diff --git a/test/rendering/issue60.result b/test/rendering/issue60.result new file mode 100644 index 0000000..bf7f8cb --- /dev/null +++ b/test/rendering/issue60.result @@ -0,0 +1,40 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/issue_100_filters.mml b/test/rendering/issue_100_filters.mml new file mode 100644 index 0000000..6bd2bea --- /dev/null +++ b/test/rendering/issue_100_filters.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "issue_100_filters.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/issue_100_filters.mss b/test/rendering/issue_100_filters.mss new file mode 100644 index 0000000..bc86a43 --- /dev/null +++ b/test/rendering/issue_100_filters.mss @@ -0,0 +1,16 @@ +#world[zoom>10][area>16000000], +#world[zoom>11][area>4000000], +#world[zoom>12][area>1000000], +#world[zoom>13][area>500000], +#world[zoom>14][area>250000], +#world[zoom>15][area>125000], +#world[zoom>16][area>62500], +#world[zoom>17] { + text-name:'[name]'; + text-face-name:'Helvetica'; + text-halo-fill:#fff; + text-halo-radius:2; + text-placement:interior; + text-size:11; + text-wrap-width:20; +} diff --git a/test/rendering/issue_100_filters.result b/test/rendering/issue_100_filters.result new file mode 100644 index 0000000..7707301 --- /dev/null +++ b/test/rendering/issue_100_filters.result @@ -0,0 +1,56 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/issue_121.mml b/test/rendering/issue_121.mml new file mode 100644 index 0000000..3ccdec6 --- /dev/null +++ b/test/rendering/issue_121.mml @@ -0,0 +1,36 @@ +{ + "bounds": [ + -180, + -85.05112877980659, + 180, + 85.05112877980659 + ], + "center": [ + 0, + 0, + 2 + ], + "format": "png", + "interactivity": false, + "minzoom": 0, + "maxzoom": 22, + "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", + "Stylesheet": [ + "issue_121.mss" + ], + "Layer": [ + { + "id": "filtertest", + "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", + "geometry": "polygon", + "Datasource": { + "file": "http://mapbox-geodata.s3.amazonaws.com/natural-earth-1.4.0/cultural/10m-admin-0-countries.zip", + "type": "shape" + } + } + ], + "scale": 1, + "metatile": 2, + "name": "", + "description": "" +} diff --git a/test/rendering/issue_121.mss b/test/rendering/issue_121.mss new file mode 100644 index 0000000..cdc63a0 --- /dev/null +++ b/test/rendering/issue_121.mss @@ -0,0 +1,11 @@ +#filtertest[[a] > [b]] { + marker-fill: #ff0000; +} + +#filtertest[[a] > [b] * 2] { + marker-fill: #00ff00; +} + +#filtertest[[a] > 10 * 2] { + marker-fill: #0000ff; +} diff --git a/test/rendering/issue_121.result b/test/rendering/issue_121.result new file mode 100644 index 0000000..a81a6c4 --- /dev/null +++ b/test/rendering/issue_121.result @@ -0,0 +1,39 @@ + + + + + + -180,-85.05112877980659,180,85.05112877980659 + 0,0,2 + png + 0 + 22 + 1 + 2 + + + + + + filtertest + + [absolute path] + + + + + diff --git a/test/rendering/issue_239.mml b/test/rendering/issue_239.mml new file mode 100644 index 0000000..1e5b624 --- /dev/null +++ b/test/rendering/issue_239.mml @@ -0,0 +1,37 @@ +{ + "bounds": [ + -180, + -85.05112877980659, + 180, + 85.05112877980659 + ], + "center": [ + 0, + 0, + 2 + ], + "format": "png", + "interactivity": false, + "minzoom": 0, + "maxzoom": 22, + "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", + "Stylesheet": [ + "issue_239_a.mss", + "issue_239_b.mss" + ], + "Layer": [ + { + "id": "countries", + "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", + "geometry": "polygon", + "Datasource": { + "file": "http://mapbox-geodata.s3.amazonaws.com/natural-earth-1.4.0/cultural/10m-admin-0-countries.zip", + "type": "shape" + } + } + ], + "scale": 1, + "metatile": 2, + "name": "", + "description": "" +} diff --git a/test/rendering/issue_239.result b/test/rendering/issue_239.result new file mode 100644 index 0000000..0d67704 --- /dev/null +++ b/test/rendering/issue_239.result @@ -0,0 +1,36 @@ + + + + + + -180,-85.05112877980659,180,85.05112877980659 + 0,0,2 + png + 0 + 22 + 1 + 2 + + + + + + + countries-fill + countries-outline + + [absolute path] + + + + + diff --git a/test/rendering/issue_239_a.mss b/test/rendering/issue_239_a.mss new file mode 100644 index 0000000..9ee5375 --- /dev/null +++ b/test/rendering/issue_239_a.mss @@ -0,0 +1,7 @@ +// Only the coastlines should be visible, +// not land boundaries. +#countries::outline { + line-color: #024; + line-width: 2; + line-join: round; +} \ No newline at end of file diff --git a/test/rendering/issue_239_b.mss b/test/rendering/issue_239_b.mss new file mode 100644 index 0000000..dc00477 --- /dev/null +++ b/test/rendering/issue_239_b.mss @@ -0,0 +1,5 @@ +// This attachment should cover most of the outlines +#countries::fill { + polygon-fill: #ace; + polygon-gamma: 0.3; +} diff --git a/test/rendering/issue_273.mml b/test/rendering/issue_273.mml new file mode 100644 index 0000000..652962f --- /dev/null +++ b/test/rendering/issue_273.mml @@ -0,0 +1,37 @@ +{ + "bounds": [ + -180, + -85.05112877980659, + 180, + 85.05112877980659 + ], + "center": [ + 0, + 0, + 2 + ], + "format": "png", + "interactivity": false, + "minzoom": 0, + "maxzoom": 22, + "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", + "Stylesheet": [ + "issue_273.mss" + ], + "Layer": [ + { + "id": "countries & states", + "class": "countries-and-states", + "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", + "geometry": "polygon", + "Datasource": { + "file": "http://mapbox-geodata.s3.amazonaws.com/natural-earth-1.4.0/cultural/10m-admin-0-countries.zip", + "type": "shape" + } + } + ], + "scale": 1, + "metatile": 2, + "name": "", + "description": "" +} diff --git a/test/rendering/issue_273.mss b/test/rendering/issue_273.mss new file mode 100644 index 0000000..99f643b --- /dev/null +++ b/test/rendering/issue_273.mss @@ -0,0 +1,5 @@ +.countries-and-states { + line-color: #024; + line-width: 2; + line-join: round; +} diff --git a/test/rendering/issue_273.result b/test/rendering/issue_273.result new file mode 100644 index 0000000..e3b8582 --- /dev/null +++ b/test/rendering/issue_273.result @@ -0,0 +1,30 @@ + + + + + + -180,-85.05112877980659,180,85.05112877980659 + 0,0,2 + png + 0 + 22 + 1 + 2 + + + + + + countries & states + + [absolute path] + + + + + diff --git a/test/rendering/issue_291.mml b/test/rendering/issue_291.mml new file mode 100644 index 0000000..c7a7c44 --- /dev/null +++ b/test/rendering/issue_291.mml @@ -0,0 +1,24 @@ +{ + "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", + "Stylesheet": [ + "issue_291.mss" + ], + "Layer": [{ + "id": "test", + "class": "a", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }, + { + "id": "test2", + "class": "a b", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/issue_291.mss b/test/rendering/issue_291.mss new file mode 100644 index 0000000..bad2fdc --- /dev/null +++ b/test/rendering/issue_291.mss @@ -0,0 +1,6 @@ +.a { + line-width: 1; + .b { + line-width: 8; + } +} diff --git a/test/rendering/issue_291.result b/test/rendering/issue_291.result new file mode 100644 index 0000000..6cb92b7 --- /dev/null +++ b/test/rendering/issue_291.result @@ -0,0 +1,35 @@ + + + + + + + + test + + + + + + + + test2 + + + + + + + diff --git a/test/rendering/issue_296.mml b/test/rendering/issue_296.mml new file mode 100644 index 0000000..bb28da6 --- /dev/null +++ b/test/rendering/issue_296.mml @@ -0,0 +1,13 @@ +{ + "Stylesheet": [ + "issue_296.mss" + ], + "Layer": [ + { + "id": "world" + }, + { + "id": "sea" + } + ] +} diff --git a/test/rendering/issue_296.mss b/test/rendering/issue_296.mss new file mode 100644 index 0000000..4df03fb --- /dev/null +++ b/test/rendering/issue_296.mss @@ -0,0 +1,11 @@ +#world { + polygon-fill: grey; + [data_column = null] { polygon-fill: red; polygon-opacity: 0.5; } + [data_column >= 100] { polygon-fill: blue; } +} + +#sea { + polygon-fill: grey; + [data_column = null] { polygon-fill: red; } + [data_column >= 100] { polygon-fill: blue; } +} diff --git a/test/rendering/issue_296.result b/test/rendering/issue_296.result new file mode 100644 index 0000000..48b5bbd --- /dev/null +++ b/test/rendering/issue_296.result @@ -0,0 +1,37 @@ + + + + + + world + + + + sea + + + diff --git a/test/rendering/issue_333.mml b/test/rendering/issue_333.mml new file mode 100644 index 0000000..f4d2b03 --- /dev/null +++ b/test/rendering/issue_333.mml @@ -0,0 +1,10 @@ +{ + "Stylesheet": [ + "issue_333.mss" + ], + "Layer": [ + { + "id": "world" + } + ] +} diff --git a/test/rendering/issue_333.mss b/test/rendering/issue_333.mss new file mode 100644 index 0000000..0b0e004 --- /dev/null +++ b/test/rendering/issue_333.mss @@ -0,0 +1,8 @@ +@fonts-a: "Arial", "Helvetica Neue"; +@fonts-b: "Roboto", @fonts-a; + +#world { + text-face-name: @fonts-b; + text-name: [title]; + text-size: 11; +} diff --git a/test/rendering/issue_333.result b/test/rendering/issue_333.result new file mode 100644 index 0000000..5893fb5 --- /dev/null +++ b/test/rendering/issue_333.result @@ -0,0 +1,18 @@ + + + + + + + + + + + world + + + diff --git a/test/rendering/issue_338.mml b/test/rendering/issue_338.mml new file mode 100644 index 0000000..2a83ec0 --- /dev/null +++ b/test/rendering/issue_338.mml @@ -0,0 +1,10 @@ +{ + "Stylesheet": [ + "issue_338.mss" + ], + "Layer": [ + { + "id": "world" + } + ] +} diff --git a/test/rendering/issue_338.mss b/test/rendering/issue_338.mss new file mode 100644 index 0000000..6852ac5 --- /dev/null +++ b/test/rendering/issue_338.mss @@ -0,0 +1,7 @@ +@var: 'foo'; +@var: 'oof'; + +#world { + text-face-name: 'Arial'; + text-name: @var + 'bar'; +} diff --git a/test/rendering/issue_338.result b/test/rendering/issue_338.result new file mode 100644 index 0000000..d8b7d91 --- /dev/null +++ b/test/rendering/issue_338.result @@ -0,0 +1,13 @@ + + + + + + world + + + diff --git a/test/rendering/issue_348.mml b/test/rendering/issue_348.mml new file mode 100644 index 0000000..2d18db2 --- /dev/null +++ b/test/rendering/issue_348.mml @@ -0,0 +1,9 @@ +{ + "name": "", + "test": null, + "scale": 1, + "Stylesheet": [ + ], + "Layer": [ + ] +} diff --git a/test/rendering/issue_348.result b/test/rendering/issue_348.result new file mode 100644 index 0000000..3ac2f48 --- /dev/null +++ b/test/rendering/issue_348.result @@ -0,0 +1,7 @@ + + + + + 1 + + diff --git a/test/rendering/issue_394.mss b/test/rendering/issue_394.mss new file mode 100644 index 0000000..e1f1a55 --- /dev/null +++ b/test/rendering/issue_394.mss @@ -0,0 +1,4 @@ +#world { + line-width: 2; + line-color: #024; +} diff --git a/test/rendering/issue_394_api2.3.0.mml b/test/rendering/issue_394_api2.3.0.mml new file mode 100644 index 0000000..cbd6316 --- /dev/null +++ b/test/rendering/issue_394_api2.3.0.mml @@ -0,0 +1,18 @@ +{ + "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", + "Stylesheet": [ + "issue_394.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + }, + "properties": { + "minzoom": 7, + "maxzoom": 9 + } + }] +} diff --git a/test/rendering/issue_394_api2.3.0.result b/test/rendering/issue_394_api2.3.0.result new file mode 100644 index 0000000..cc6aaea --- /dev/null +++ b/test/rendering/issue_394_api2.3.0.result @@ -0,0 +1,22 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/issue_394_api3.0.0.mml b/test/rendering/issue_394_api3.0.0.mml new file mode 100644 index 0000000..cbd6316 --- /dev/null +++ b/test/rendering/issue_394_api3.0.0.mml @@ -0,0 +1,18 @@ +{ + "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", + "Stylesheet": [ + "issue_394.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + }, + "properties": { + "minzoom": 7, + "maxzoom": 9 + } + }] +} diff --git a/test/rendering/issue_394_api3.0.0.result b/test/rendering/issue_394_api3.0.0.result new file mode 100644 index 0000000..1e89b00 --- /dev/null +++ b/test/rendering/issue_394_api3.0.0.result @@ -0,0 +1,22 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/issue_411.mml b/test/rendering/issue_411.mml new file mode 100644 index 0000000..af1be17 --- /dev/null +++ b/test/rendering/issue_411.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "issue_411.mss" + ], + "Layer": [{ + "id": "test", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/issue_411.mss b/test/rendering/issue_411.mss new file mode 100644 index 0000000..5e35c4e --- /dev/null +++ b/test/rendering/issue_411.mss @@ -0,0 +1,17 @@ +#test { + [zoom >= 3][way_pixels > 0.00000010000][way_pixels < 0.00003600000] { + text-name: "[name]"; + text-size: 10; + [zoom >= 4] { + text-size: 11; + } + text-fill: #ff0000; + text-face-name: 'Arial'; + } + [zoom >= 3][render = '1_outline'] { + text-name: "[name]"; + text-size: 12; + text-fill: #ff0000; + text-face-name: 'Arial'; + } +} diff --git a/test/rendering/issue_411.result b/test/rendering/issue_411.result new file mode 100644 index 0000000..1ff9afb --- /dev/null +++ b/test/rendering/issue_411.result @@ -0,0 +1,34 @@ + + + + + + + + test + + + + + + + diff --git a/test/rendering/issue_450.mml b/test/rendering/issue_450.mml new file mode 100644 index 0000000..30b11f2 --- /dev/null +++ b/test/rendering/issue_450.mml @@ -0,0 +1,67 @@ +{ + "_properties": { + "global-properties": { + "group-by": "layer" + }, + "override-properties": { + "group-by": "layer" + } + }, + "bounds": [ + -180, + -85.05112877980659, + 180, + 85.05112877980659 + ], + "center": [ + 0, + 0, + 2 + ], + "format": "png", + "interactivity": false, + "minzoom": 0, + "maxzoom": 22, + "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", + "Stylesheet": [ + ], + "Layer": [ + { + "id": "properties", + "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", + "geometry": "polygon", + "Datasource": { + "file": "http://mapbox-geodata.s3.amazonaws.com/natural-earth-1.4.0/cultural/10m-admin-0-countries.zip", + "type": "shape" + }, + "properties": { + "group-by": "layer" + } + }, + { + "id": "global-properties", + "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", + "geometry": "polygon", + "Datasource": { + "file": "http://mapbox-geodata.s3.amazonaws.com/natural-earth-1.4.0/cultural/10m-admin-0-countries.zip", + "type": "shape" + } + }, + { + "id": "override-properties", + "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", + "geometry": "polygon", + "Datasource": { + "file": "http://mapbox-geodata.s3.amazonaws.com/natural-earth-1.4.0/cultural/10m-admin-0-countries.zip", + "type": "shape" + }, + "properties": { + "group-by": "override" + } + } + ], + "scale": 1, + "metatile": 2, + "name": "", + "description": "" +} diff --git a/test/rendering/issue_450.result b/test/rendering/issue_450.result new file mode 100644 index 0000000..8529d75 --- /dev/null +++ b/test/rendering/issue_450.result @@ -0,0 +1,41 @@ + + + + + + -180,-85.05112877980659,180,85.05112877980659 + 0,0,2 + png + 0 + 22 + 1 + 2 + + + + + + [absolute path] + + + + + + [absolute path] + + + + + + [absolute path] + + + + + diff --git a/test/rendering/issue_469.mml b/test/rendering/issue_469.mml new file mode 100644 index 0000000..c94e8e5 --- /dev/null +++ b/test/rendering/issue_469.mml @@ -0,0 +1,15 @@ +{ + "Stylesheet": [ + "issue_469.mss" + ], + "Layer": [ + { + "properties": { + "minzoom": 4, + "maxzoom": 8 + }, + "id": "place", + "class": "place" + } + ] +} diff --git a/test/rendering/issue_469.mss b/test/rendering/issue_469.mss new file mode 100644 index 0000000..33f8d5f --- /dev/null +++ b/test/rendering/issue_469.mss @@ -0,0 +1,20 @@ +.place { + [type="continent"][zoom <= 2] { + text-name: "[name]"; + text-face-name: "Arial"; + text-size: 12; + } + [type="country"][zoom <= 3] { + text-name: "[name]"; + text-face-name: "Arial"; + text-size: 10; + } + [type="city"][zoom <= 14] { + [zoom >= 4] { + text-name: "[name]"; + text-face-name: "Arial"; + text-size: 10; + } + [zoom >= 9] { text-size: 12; } + } +} diff --git a/test/rendering/issue_469.result b/test/rendering/issue_469.result new file mode 100644 index 0000000..a85d4c8 --- /dev/null +++ b/test/rendering/issue_469.result @@ -0,0 +1,18 @@ + + + + + + place + + + diff --git a/test/rendering/layer_nodatasource.mml b/test/rendering/layer_nodatasource.mml new file mode 100644 index 0000000..fbdbaef --- /dev/null +++ b/test/rendering/layer_nodatasource.mml @@ -0,0 +1,10 @@ +{ + "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", + "Stylesheet": [ + "layer_nodatasource.mss" + ], + "Layer": [{ + "id": "world", + "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" + }] +} diff --git a/test/rendering/layer_nodatasource.mss b/test/rendering/layer_nodatasource.mss new file mode 100644 index 0000000..249df79 --- /dev/null +++ b/test/rendering/layer_nodatasource.mss @@ -0,0 +1,4 @@ +#world { + polygon-fill: green; + line-color: hsl(30, 40%, 90%); +} diff --git a/test/rendering/layer_nodatasource.result b/test/rendering/layer_nodatasource.result new file mode 100644 index 0000000..2126449 --- /dev/null +++ b/test/rendering/layer_nodatasource.result @@ -0,0 +1,17 @@ + + + + + + + + world + + + diff --git a/test/rendering/layer_properties.mml b/test/rendering/layer_properties.mml new file mode 100644 index 0000000..c7460c1 --- /dev/null +++ b/test/rendering/layer_properties.mml @@ -0,0 +1,17 @@ +{ + "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", + "Stylesheet": [ + "layer_properties.mss" + ], + "Layer": [{ + "id": "world", + "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", + "properties": { + "cache-features": "true" + }, + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/layer_properties.mss b/test/rendering/layer_properties.mss new file mode 100644 index 0000000..249df79 --- /dev/null +++ b/test/rendering/layer_properties.mss @@ -0,0 +1,4 @@ +#world { + polygon-fill: green; + line-color: hsl(30, 40%, 90%); +} diff --git a/test/rendering/layer_properties.result b/test/rendering/layer_properties.result new file mode 100644 index 0000000..b318e55 --- /dev/null +++ b/test/rendering/layer_properties.result @@ -0,0 +1,22 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/mapnik_keyword.mml b/test/rendering/mapnik_keyword.mml new file mode 100644 index 0000000..ec9e1fe --- /dev/null +++ b/test/rendering/mapnik_keyword.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "mapnik_keyword.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/mapnik_keyword.mss b/test/rendering/mapnik_keyword.mss new file mode 100644 index 0000000..7866d7e --- /dev/null +++ b/test/rendering/mapnik_keyword.mss @@ -0,0 +1,3 @@ +#world[[FOO]=null] { + line-width:2; +} diff --git a/test/rendering/mapnik_keyword.result b/test/rendering/mapnik_keyword.result new file mode 100644 index 0000000..8ca39b9 --- /dev/null +++ b/test/rendering/mapnik_keyword.result @@ -0,0 +1,21 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/modulus.mml b/test/rendering/modulus.mml new file mode 100644 index 0000000..2ea26d2 --- /dev/null +++ b/test/rendering/modulus.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "modulus.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/modulus.mss b/test/rendering/modulus.mss new file mode 100644 index 0000000..e9d797d --- /dev/null +++ b/test/rendering/modulus.mss @@ -0,0 +1,6 @@ +#world { + text-name: "hello "; + text-size: 11 % 2; + text-face-name: "Georgia Regular", "Arial Italic"; +} + diff --git a/test/rendering/modulus.result b/test/rendering/modulus.result new file mode 100644 index 0000000..0576929 --- /dev/null +++ b/test/rendering/modulus.result @@ -0,0 +1,23 @@ + + + + + + + + + + + world + + + + + + + diff --git a/test/rendering/multiple_symbolizers.mml b/test/rendering/multiple_symbolizers.mml new file mode 100644 index 0000000..18e0819 --- /dev/null +++ b/test/rendering/multiple_symbolizers.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "multiple_symbolizers.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/multiple_symbolizers.mss b/test/rendering/multiple_symbolizers.mss new file mode 100644 index 0000000..ecec8a0 --- /dev/null +++ b/test/rendering/multiple_symbolizers.mss @@ -0,0 +1,5 @@ +#world { + polygon-fill: #fff; + line-width: 2; + alternate/line-color: #f00; + } diff --git a/test/rendering/multiple_symbolizers.result b/test/rendering/multiple_symbolizers.result new file mode 100644 index 0000000..9839c97 --- /dev/null +++ b/test/rendering/multiple_symbolizers.result @@ -0,0 +1,23 @@ + + + + + + + + world + + [absolute path] + shape + + + + diff --git a/test/rendering/nesting_class.mml b/test/rendering/nesting_class.mml new file mode 100644 index 0000000..d4839af --- /dev/null +++ b/test/rendering/nesting_class.mml @@ -0,0 +1,26 @@ +{ + "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", + "Stylesheet": [ + "nesting_class.mss" + ], + "Layer": [ + { + "id": "foo", + "class": "land", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }, + { + "id": "lakes", + "class": "land", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + } + ] +} diff --git a/test/rendering/nesting_class.mss b/test/rendering/nesting_class.mss new file mode 100644 index 0000000..7f7e3e4 --- /dev/null +++ b/test/rendering/nesting_class.mss @@ -0,0 +1,10 @@ +/* Applies to all layers with .land class */ +.land { + line-color: #ccc; + line-width: 0.5; + polygon-fill: #eee; + /* Applies to #lakes.land */ + #lakes { + polygon-fill: #000; + } +} diff --git a/test/rendering/nesting_class.result b/test/rendering/nesting_class.result new file mode 100644 index 0000000..4a39e9b --- /dev/null +++ b/test/rendering/nesting_class.result @@ -0,0 +1,36 @@ + + + + + + + + foo + + + + + + + + + lakes + + + + + + + diff --git a/test/rendering/nominzoom.mml b/test/rendering/nominzoom.mml new file mode 100644 index 0000000..73c8bac --- /dev/null +++ b/test/rendering/nominzoom.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "nominzoom.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/nominzoom.mss b/test/rendering/nominzoom.mss new file mode 100644 index 0000000..af9c4b4 --- /dev/null +++ b/test/rendering/nominzoom.mss @@ -0,0 +1,3 @@ +#world[zoom < 5] { + polygon-fill: #000; +} diff --git a/test/rendering/nominzoom.result b/test/rendering/nominzoom.result new file mode 100644 index 0000000..50bb7c9 --- /dev/null +++ b/test/rendering/nominzoom.result @@ -0,0 +1,21 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/noquote_font.mml b/test/rendering/noquote_font.mml new file mode 100644 index 0000000..88182eb --- /dev/null +++ b/test/rendering/noquote_font.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "noquote_font.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/noquote_font.mss b/test/rendering/noquote_font.mss new file mode 100644 index 0000000..fda7d8d --- /dev/null +++ b/test/rendering/noquote_font.mss @@ -0,0 +1,4 @@ +#world { + text-name: 'foo'; + text-face-name: Helvetica; +} diff --git a/test/rendering/noquote_font.result b/test/rendering/noquote_font.result new file mode 100644 index 0000000..3535aa0 --- /dev/null +++ b/test/rendering/noquote_font.result @@ -0,0 +1,20 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/parameters.mml b/test/rendering/parameters.mml new file mode 100644 index 0000000..bb96020 --- /dev/null +++ b/test/rendering/parameters.mml @@ -0,0 +1,24 @@ +{ + "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", + "bounds": [-180,-85,180,85], + "center": [-78,40,8], + "name": "Parameters", + "description": "Mapnik parameter test.", + "legend": "

This is HTML.

", + "attribution": "OpenStreetMap", + "template": "{{NAME}}", + "minzoom": 0, + "maxzoom": 12, + "version": "1.0.0", + "format": "png", + "interactivity": { + "layer": "world", + "fields": ["NAME"] + }, + "customString": "Hello world", + "customNumber": 5, + "customBoolean": true, + "customOmitted": { "foo": "bar" }, + "Stylesheet": [], + "Layer": [] +} diff --git a/test/rendering/parameters.result b/test/rendering/parameters.result new file mode 100644 index 0000000..e6476a5 --- /dev/null +++ b/test/rendering/parameters.result @@ -0,0 +1,23 @@ + + + + + -180,-85,180,85 + -78,40,8 + + + This is HTML.

]]>
+ OpenStreetMap]]> + {{NAME}}]]> + 0 + 12 + 1.0.0 + png + world + NAME + + 5 + true +
+
+ diff --git a/test/rendering/partial_overrides.mml b/test/rendering/partial_overrides.mml new file mode 100644 index 0000000..531f18c --- /dev/null +++ b/test/rendering/partial_overrides.mml @@ -0,0 +1,15 @@ +{ + "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", + "Stylesheet": [ + "partial_overrides.mss" + ], + "Layer": [{ + "id": "world", + "class": "m_0 m_1 m_2 m_3 m_4 m_5 m_6 m_7 m_8 m_9", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/partial_overrides.mss b/test/rendering/partial_overrides.mss new file mode 100644 index 0000000..7ae9847 --- /dev/null +++ b/test/rendering/partial_overrides.mss @@ -0,0 +1,35 @@ +#world.m_0 { + line-width: 3; +} + +#world.m_1[zoom > 2] { + line-opacity: .2; +} + +#world.m_2[zoom > 8] { + line-opacity: .4; +} + +#world.m_3[NAME!="Canada"] { + line-width: 5; +} + +#world.m_4[NAME="United States"] { + line-color: #f00; +} + +#world.m_6[NAME!="Canada"][zoom > 5] { + line-opacity: .7; +} + +#world.m_7[NAME!="Canada"][POP > 100000000] { + line-width:20; +} + +#world.m_8[NAME="United States"][zoom > 8] { + line-opacity: .5; +} + +#world.m_9[NAME="United States"][zoom > 8][zoom < 4] { + line-opacity: .5; +} diff --git a/test/rendering/partial_overrides.result b/test/rendering/partial_overrides.result new file mode 100644 index 0000000..fc70ea6 --- /dev/null +++ b/test/rendering/partial_overrides.result @@ -0,0 +1,106 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/raster-mesh-size.mml b/test/rendering/raster-mesh-size.mml new file mode 100644 index 0000000..0a23c06 --- /dev/null +++ b/test/rendering/raster-mesh-size.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "raster-mesh-size.mss" + ], + "Layer": [{ + "id": "data", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/nasa_raster/lasvegas_tm5_12jan09_crop_geo_merc.tif", + "type": "gdal" + } + }] +} diff --git a/test/rendering/raster-mesh-size.mss b/test/rendering/raster-mesh-size.mss new file mode 100644 index 0000000..1d9e60b --- /dev/null +++ b/test/rendering/raster-mesh-size.mss @@ -0,0 +1,4 @@ +#data { + raster-opacity: 1; + raster-mesh-size: 1; +} diff --git a/test/rendering/raster-mesh-size.result b/test/rendering/raster-mesh-size.result new file mode 100644 index 0000000..a66c4be --- /dev/null +++ b/test/rendering/raster-mesh-size.result @@ -0,0 +1,21 @@ + + + + + + + + data + + [absolute path] + gdal + + + + diff --git a/test/rendering/raster.mml b/test/rendering/raster.mml new file mode 100644 index 0000000..909ec32 --- /dev/null +++ b/test/rendering/raster.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "raster.mss" + ], + "Layer": [{ + "id": "data", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/nasa_raster/lasvegas_tm5_12jan09_crop_geo_merc.tif", + "type": "gdal" + } + }] +} diff --git a/test/rendering/raster.mss b/test/rendering/raster.mss new file mode 100644 index 0000000..f8f3c8d --- /dev/null +++ b/test/rendering/raster.mss @@ -0,0 +1,4 @@ +#data { + raster-opacity: 1; + raster-comp-op: hard-light; +} diff --git a/test/rendering/raster.result b/test/rendering/raster.result new file mode 100644 index 0000000..76114ec --- /dev/null +++ b/test/rendering/raster.result @@ -0,0 +1,21 @@ + + + + + + + + data + + [absolute path] + gdal + + + + diff --git a/test/rendering/raster_colorizer.mml b/test/rendering/raster_colorizer.mml new file mode 100644 index 0000000..e430368 --- /dev/null +++ b/test/rendering/raster_colorizer.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "raster_colorizer.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/raster_colorizer.mss b/test/rendering/raster_colorizer.mss new file mode 100644 index 0000000..d27aa97 --- /dev/null +++ b/test/rendering/raster_colorizer.mss @@ -0,0 +1,12 @@ +#world { + raster-opacity:1; + raster-scaling:bilinear; + raster-colorizer-default-mode: linear; + raster-colorizer-default-color: transparent; + raster-colorizer-stops: + stop(0,#000) + stop(1000, #00f) + stop(2000, #0ff) + stop(3000, #ff0) + stop(4000, #f00); +} diff --git a/test/rendering/raster_colorizer.result b/test/rendering/raster_colorizer.result new file mode 100644 index 0000000..6d57641 --- /dev/null +++ b/test/rendering/raster_colorizer.result @@ -0,0 +1,25 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/raster_colorizer_comma.mml b/test/rendering/raster_colorizer_comma.mml new file mode 100644 index 0000000..d2c1d2a --- /dev/null +++ b/test/rendering/raster_colorizer_comma.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "raster_colorizer_comma.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/raster_colorizer_comma.mss b/test/rendering/raster_colorizer_comma.mss new file mode 100644 index 0000000..7d43c6b --- /dev/null +++ b/test/rendering/raster_colorizer_comma.mss @@ -0,0 +1,8 @@ +#world { + raster-colorizer-stops: + stop(0,#000) + stop(1000, #00f) + stop(2000, #0ff) + stop(3000, #ff0) + stop(4000, #f00); +} diff --git a/test/rendering/raster_colorizer_comma.result b/test/rendering/raster_colorizer_comma.result new file mode 100644 index 0000000..0b5625d --- /dev/null +++ b/test/rendering/raster_colorizer_comma.result @@ -0,0 +1,25 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/raster_colorizer_onestop.mml b/test/rendering/raster_colorizer_onestop.mml new file mode 100644 index 0000000..81c7c2e --- /dev/null +++ b/test/rendering/raster_colorizer_onestop.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "raster_colorizer_onestop.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/raster_colorizer_onestop.mss b/test/rendering/raster_colorizer_onestop.mss new file mode 100644 index 0000000..e8156ad --- /dev/null +++ b/test/rendering/raster_colorizer_onestop.mss @@ -0,0 +1,7 @@ +#world { + raster-opacity:1; + raster-scaling:bilinear; + raster-colorizer-default-mode: linear; + raster-colorizer-default-color: transparent; + raster-colorizer-stops: stop(0,#000); +} diff --git a/test/rendering/raster_colorizer_onestop.result b/test/rendering/raster_colorizer_onestop.result new file mode 100644 index 0000000..0a67a25 --- /dev/null +++ b/test/rendering/raster_colorizer_onestop.result @@ -0,0 +1,21 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/rastercolorizer.mml b/test/rendering/rastercolorizer.mml new file mode 100644 index 0000000..9840858 --- /dev/null +++ b/test/rendering/rastercolorizer.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "rastercolorizer.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/rastercolorizer.mss b/test/rendering/rastercolorizer.mss new file mode 100644 index 0000000..c13c940 --- /dev/null +++ b/test/rendering/rastercolorizer.mss @@ -0,0 +1,10 @@ +#world { + raster-opacity:0; + raster-colorizer-default-mode:discrete; + raster-colorizer-default-color:#f00; + raster-colorizer-epsilon:0.05; + raster-colorizer-stops: + stop(5, #f00) + stop(10, #f40, linear) + stop(10, #f80); +} \ No newline at end of file diff --git a/test/rendering/rastercolorizer.result b/test/rendering/rastercolorizer.result new file mode 100644 index 0000000..dfe6679 --- /dev/null +++ b/test/rendering/rastercolorizer.result @@ -0,0 +1,23 @@ + + + + + + + + world + + [absolute path] + + + + + diff --git a/test/rendering/regex.mml b/test/rendering/regex.mml new file mode 100644 index 0000000..9ca9803 --- /dev/null +++ b/test/rendering/regex.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "regex.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/regex.mss b/test/rendering/regex.mss new file mode 100644 index 0000000..0ebdb96 --- /dev/null +++ b/test/rendering/regex.mss @@ -0,0 +1,5 @@ +#world[ISO =~ "U*"] { + polygon-fill: #FFF; + line-color:#F00; + line-width: 0.5; +} diff --git a/test/rendering/regex.result b/test/rendering/regex.result new file mode 100644 index 0000000..ee90da3 --- /dev/null +++ b/test/rendering/regex.result @@ -0,0 +1,22 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/regex_nest.mml b/test/rendering/regex_nest.mml new file mode 100644 index 0000000..222ee42 --- /dev/null +++ b/test/rendering/regex_nest.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "regex_nest.mss" + ], + "Layer": [{ + "id": "railway", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/regex_nest.mss b/test/rendering/regex_nest.mss new file mode 100644 index 0000000..21844ba --- /dev/null +++ b/test/rendering/regex_nest.mss @@ -0,0 +1,6 @@ +#railway[foo='bar'] { + [name =~ "East.*"] { + line-color: green; + line-width: 4; + } +} diff --git a/test/rendering/regex_nest.result b/test/rendering/regex_nest.result new file mode 100644 index 0000000..fdcb7bb --- /dev/null +++ b/test/rendering/regex_nest.result @@ -0,0 +1,21 @@ + + + + + + + + railway + + + + + + + diff --git a/test/rendering/selector_comment.mml b/test/rendering/selector_comment.mml new file mode 100644 index 0000000..0ea15f5 --- /dev/null +++ b/test/rendering/selector_comment.mml @@ -0,0 +1,21 @@ +{ + "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", + "Stylesheet": [ + "selector_comment.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }, { + "id": "countries", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/selector_comment.mss b/test/rendering/selector_comment.mss new file mode 100644 index 0000000..c89c59b --- /dev/null +++ b/test/rendering/selector_comment.mss @@ -0,0 +1,6 @@ +#world, +// bar +// blah +#countries { + marker-width:4; + } diff --git a/test/rendering/selector_comment.result b/test/rendering/selector_comment.result new file mode 100644 index 0000000..fd025c5 --- /dev/null +++ b/test/rendering/selector_comment.result @@ -0,0 +1,34 @@ + + + + + + + + world + + + + + + + + + countries + + + + + + + diff --git a/test/rendering/sharedclass.mml b/test/rendering/sharedclass.mml new file mode 100644 index 0000000..c01ebb6 --- /dev/null +++ b/test/rendering/sharedclass.mml @@ -0,0 +1,28 @@ +{ + "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", + "Stylesheet": [ + "sharedclass.mss" + ], + "Layer": [ + { + "id": "ab", + "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", + "geometry": "polygon", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/world_borders_merc.zip", + "type": "shape" + }, + "class": "a b" + }, + { + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/world_borders_merc.zip", + "type": "shape" + }, + "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", + "id": "bc", + "class": "b c", + "geometry": "polygon" + } + ] +} diff --git a/test/rendering/sharedclass.mss b/test/rendering/sharedclass.mss new file mode 100644 index 0000000..a3c3486 --- /dev/null +++ b/test/rendering/sharedclass.mss @@ -0,0 +1,11 @@ +.a { + polygon-fill: #f00; +} + +.b { + line-color: #0f0; +} + +.c { + marker-fill: #00f; +} diff --git a/test/rendering/sharedclass.result b/test/rendering/sharedclass.result new file mode 100644 index 0000000..8bfb123 --- /dev/null +++ b/test/rendering/sharedclass.result @@ -0,0 +1,36 @@ + + + + + + + + ab + + + + + + + + + bc + + + + + + + diff --git a/test/rendering/simplefontset.mml b/test/rendering/simplefontset.mml new file mode 100644 index 0000000..fa5f051 --- /dev/null +++ b/test/rendering/simplefontset.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "simplefontset.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/simplefontset.mss b/test/rendering/simplefontset.mss new file mode 100644 index 0000000..d682c08 --- /dev/null +++ b/test/rendering/simplefontset.mss @@ -0,0 +1,5 @@ +#world { + text-name: "[NAME]"; + text-size: 11; + text-face-name: "Georgia Regular", "Arial Italic"; +} diff --git a/test/rendering/simplefontset.result b/test/rendering/simplefontset.result new file mode 100644 index 0000000..8efc9af --- /dev/null +++ b/test/rendering/simplefontset.result @@ -0,0 +1,25 @@ + + + + + + + + + + + world + + [absolute path] + shape + + + + + diff --git a/test/rendering/simplevariabletest.mml b/test/rendering/simplevariabletest.mml new file mode 100644 index 0000000..fc76e1b --- /dev/null +++ b/test/rendering/simplevariabletest.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "simplevariabletest.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/simplevariabletest.mss b/test/rendering/simplevariabletest.mss new file mode 100644 index 0000000..f8fc243 --- /dev/null +++ b/test/rendering/simplevariabletest.mss @@ -0,0 +1,5 @@ +@worldbackground: #fff; + +#world { + polygon-fill: @worldbackground; +} diff --git a/test/rendering/simplevariabletest.result b/test/rendering/simplevariabletest.result new file mode 100644 index 0000000..3b14226 --- /dev/null +++ b/test/rendering/simplevariabletest.result @@ -0,0 +1,21 @@ + + + + + + + + world + + [absolute path] + shape + + + + diff --git a/test/rendering/style_fold.mml b/test/rendering/style_fold.mml new file mode 100644 index 0000000..15d08c3 --- /dev/null +++ b/test/rendering/style_fold.mml @@ -0,0 +1,10 @@ +{ + "Layer": [ + { + "id": "a" + } + ], + "Stylesheet": [ + "style_fold.mss" + ] +} diff --git a/test/rendering/style_fold.mss b/test/rendering/style_fold.mss new file mode 100644 index 0000000..513e0ad --- /dev/null +++ b/test/rendering/style_fold.mss @@ -0,0 +1,14 @@ +Map { } +#a { + [x = 'X'] { + #a { + line-cap: round; + } + } + [y = 'Y'] { + line-width: 2; + #a { + line-cap: round; + } + } +} diff --git a/test/rendering/style_fold.result b/test/rendering/style_fold.result new file mode 100644 index 0000000..eb5b15e --- /dev/null +++ b/test/rendering/style_fold.result @@ -0,0 +1,20 @@ + + + + + + + + a + + diff --git a/test/rendering/style_level_opacity.mml b/test/rendering/style_level_opacity.mml new file mode 100644 index 0000000..d5b7546 --- /dev/null +++ b/test/rendering/style_level_opacity.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "style_level_opacity.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/style_level_opacity.mss b/test/rendering/style_level_opacity.mss new file mode 100644 index 0000000..ea06e8f --- /dev/null +++ b/test/rendering/style_level_opacity.mss @@ -0,0 +1,6 @@ +#world { + opacity:0.2; + text-name: "[NAME]"; + text-size: 11; + text-face-name: "Georgia Regular", "Arial Italic"; +} diff --git a/test/rendering/style_level_opacity.result b/test/rendering/style_level_opacity.result new file mode 100644 index 0000000..fcd03c4 --- /dev/null +++ b/test/rendering/style_level_opacity.result @@ -0,0 +1,23 @@ + + + + + + + + + + + world + + + + + + + diff --git a/test/rendering/support4504.mml b/test/rendering/support4504.mml new file mode 100644 index 0000000..2ee6d0a --- /dev/null +++ b/test/rendering/support4504.mml @@ -0,0 +1,15 @@ +{ + "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", + "Stylesheet": [ + "support4504.mss" + ], + "Layer": [{ + "class": "new", + "id": "countries", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/support4504.mss b/test/rendering/support4504.mss new file mode 100644 index 0000000..ef0f507 --- /dev/null +++ b/test/rendering/support4504.mss @@ -0,0 +1,7 @@ +@z13: 19; +@num_pixels: 50; +@z13area: @z13 * @z13 * @num_pixels; + +#countries[way_area > @z13area] { + polygon-opacity:0.2; +} diff --git a/test/rendering/support4504.result b/test/rendering/support4504.result new file mode 100644 index 0000000..36ebe26 --- /dev/null +++ b/test/rendering/support4504.result @@ -0,0 +1,21 @@ + + + + + + + + countries + + + + + + + diff --git a/test/rendering/symbolizer_order.mml b/test/rendering/symbolizer_order.mml new file mode 100644 index 0000000..95d733c --- /dev/null +++ b/test/rendering/symbolizer_order.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "symbolizer_order.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/symbolizer_order.mss b/test/rendering/symbolizer_order.mss new file mode 100644 index 0000000..747a7d7 --- /dev/null +++ b/test/rendering/symbolizer_order.mss @@ -0,0 +1,4 @@ +#world { + polygon-fill: #fff; + line-width: 2; + } diff --git a/test/rendering/symbolizer_order.result b/test/rendering/symbolizer_order.result new file mode 100644 index 0000000..8932a1e --- /dev/null +++ b/test/rendering/symbolizer_order.result @@ -0,0 +1,22 @@ + + + + + + + + world + + [absolute path] + shape + + + + diff --git a/test/rendering/text_property_overrides.mml b/test/rendering/text_property_overrides.mml new file mode 100644 index 0000000..41e6eb4 --- /dev/null +++ b/test/rendering/text_property_overrides.mml @@ -0,0 +1,15 @@ +{ + "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", + "Stylesheet": [ + "text_property_overrides.mss" + ], + "Layer": [{ + "id": "world", + "class": "m_0 m_1 m_2 m_3 m_4 m_5 m_6 m_7 m_8 m_9", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/text_property_overrides.mss b/test/rendering/text_property_overrides.mss new file mode 100644 index 0000000..1fe7184 --- /dev/null +++ b/test/rendering/text_property_overrides.mss @@ -0,0 +1,9 @@ +#world[zoom>3] { + text-name:"[COUNTRY]"; + text-face-name:"DejaVu Sans Book"; + text-fill:#000; + text-size:9; +} +#world[zoom=5] { text-size:10; } +#world[zoom=6] { text-size:11; } +#world[zoom=7] { text-size:12; } diff --git a/test/rendering/text_property_overrides.result b/test/rendering/text_property_overrides.result new file mode 100644 index 0000000..2ea8bc6 --- /dev/null +++ b/test/rendering/text_property_overrides.result @@ -0,0 +1,40 @@ + + + + + + + + world + + [absolute path] + shape + + + + diff --git a/test/rendering/transforms.mml b/test/rendering/transforms.mml new file mode 100644 index 0000000..923ffd3 --- /dev/null +++ b/test/rendering/transforms.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "transforms.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/transforms.mss b/test/rendering/transforms.mss new file mode 100644 index 0000000..ffa19d1 --- /dev/null +++ b/test/rendering/transforms.mss @@ -0,0 +1,7 @@ +@trans: 2; +#world { + point-file: url(foo.png); + point-transform: translate( @trans * 2, @trans); + marker-width: 2; + marker-transform: scale(2); +} diff --git a/test/rendering/transforms.result b/test/rendering/transforms.result new file mode 100644 index 0000000..4dca4d1 --- /dev/null +++ b/test/rendering/transforms.result @@ -0,0 +1,21 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/transforms_backwards.mml b/test/rendering/transforms_backwards.mml new file mode 100644 index 0000000..4ecf2db --- /dev/null +++ b/test/rendering/transforms_backwards.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "transforms_backwards.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/transforms_backwards.mss b/test/rendering/transforms_backwards.mss new file mode 100644 index 0000000..23049ee --- /dev/null +++ b/test/rendering/transforms_backwards.mss @@ -0,0 +1,4 @@ +#world { + point-file: url(foo.png); + point-transform: "translate(2, 2), scale(2, 2)"; +} diff --git a/test/rendering/transforms_backwards.result b/test/rendering/transforms_backwards.result new file mode 100644 index 0000000..434cdd5 --- /dev/null +++ b/test/rendering/transforms_backwards.result @@ -0,0 +1,20 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/transforms_field.mml b/test/rendering/transforms_field.mml new file mode 100644 index 0000000..24e3e37 --- /dev/null +++ b/test/rendering/transforms_field.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "transforms_field.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/transforms_field.mss b/test/rendering/transforms_field.mss new file mode 100644 index 0000000..06f9bbc --- /dev/null +++ b/test/rendering/transforms_field.mss @@ -0,0 +1,4 @@ +#world { + point-file:url(foo.png); + point-transform: scale(2 * 5 * [POP2005], [POP2005]), rotate(10,1,-1); +} diff --git a/test/rendering/transforms_field.result b/test/rendering/transforms_field.result new file mode 100644 index 0000000..53529b2 --- /dev/null +++ b/test/rendering/transforms_field.result @@ -0,0 +1,20 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/transforms_single.mml b/test/rendering/transforms_single.mml new file mode 100644 index 0000000..bed15d1 --- /dev/null +++ b/test/rendering/transforms_single.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "transforms_single.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/transforms_single.mss b/test/rendering/transforms_single.mss new file mode 100644 index 0000000..6b4d81f --- /dev/null +++ b/test/rendering/transforms_single.mss @@ -0,0 +1,3 @@ +#world { + point-transform: scale(2, 2); +} diff --git a/test/rendering/transforms_single.result b/test/rendering/transforms_single.result new file mode 100644 index 0000000..b53c5ce --- /dev/null +++ b/test/rendering/transforms_single.result @@ -0,0 +1,20 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/units.mml b/test/rendering/units.mml new file mode 100644 index 0000000..c39521d --- /dev/null +++ b/test/rendering/units.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "units.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/units.mss b/test/rendering/units.mss new file mode 100644 index 0000000..326b959 --- /dev/null +++ b/test/rendering/units.mss @@ -0,0 +1,6 @@ +#world { + line-width: 2mm; + marker-width: 2pc; + marker-height: 5pt; + building-height: 10cm; +} diff --git a/test/rendering/units.result b/test/rendering/units.result new file mode 100644 index 0000000..3dc1711 --- /dev/null +++ b/test/rendering/units.result @@ -0,0 +1,22 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/unsigned.mml b/test/rendering/unsigned.mml new file mode 100644 index 0000000..bdf9111 --- /dev/null +++ b/test/rendering/unsigned.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "unsigned.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/unsigned.mss b/test/rendering/unsigned.mss new file mode 100644 index 0000000..374cb02 --- /dev/null +++ b/test/rendering/unsigned.mss @@ -0,0 +1,8 @@ +#world { + text-size:10.5; + text-ratio:2.1; + text-wrap-width:5; + text-spacing:12.1; + text-name:[FOO]; + text-face-name:'Foo'; +} diff --git a/test/rendering/unsigned.result b/test/rendering/unsigned.result new file mode 100644 index 0000000..4a2819b --- /dev/null +++ b/test/rendering/unsigned.result @@ -0,0 +1,20 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/var_concat.mml b/test/rendering/var_concat.mml new file mode 100644 index 0000000..b62061e --- /dev/null +++ b/test/rendering/var_concat.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "var_concat.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/var_concat.mss b/test/rendering/var_concat.mss new file mode 100644 index 0000000..9045706 --- /dev/null +++ b/test/rendering/var_concat.mss @@ -0,0 +1,6 @@ +@var: 'foo'; + +#world { + text-face-name: 'Helvetica'; + text-name: @var + ' bar'; +} diff --git a/test/rendering/var_concat.result b/test/rendering/var_concat.result new file mode 100644 index 0000000..c6ed1f3 --- /dev/null +++ b/test/rendering/var_concat.result @@ -0,0 +1,20 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/weird_comments.mml b/test/rendering/weird_comments.mml new file mode 100644 index 0000000..f5c15c5 --- /dev/null +++ b/test/rendering/weird_comments.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "weird_comments.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/weird_comments.mss b/test/rendering/weird_comments.mss new file mode 100644 index 0000000..569f285 --- /dev/null +++ b/test/rendering/weird_comments.mss @@ -0,0 +1,12 @@ +#world { polygon-fill: #A22; } +/* comment */ +/* +#world { line-opacity:0.5; } +#world { line-width:10; } +#world { line-color:#0ff; } +*/ + +/* *//* { *//* *//* *//* */#world { polygon-fill:#A33; }/* } */ + + +/* { *//* [ ] *//* *//* { } *//* #world { polygon-fill:#a00; } */ \ No newline at end of file diff --git a/test/rendering/weird_comments.result b/test/rendering/weird_comments.result new file mode 100644 index 0000000..92b834d --- /dev/null +++ b/test/rendering/weird_comments.result @@ -0,0 +1,19 @@ + + + + + + + world + + [absolute path] + shape + + + diff --git a/test/rendering/weird_comments_2.mml b/test/rendering/weird_comments_2.mml new file mode 100644 index 0000000..18b3cbf --- /dev/null +++ b/test/rendering/weird_comments_2.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "weird_comments_2.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/weird_comments_2.mss b/test/rendering/weird_comments_2.mss new file mode 100644 index 0000000..0be9deb --- /dev/null +++ b/test/rendering/weird_comments_2.mss @@ -0,0 +1,7 @@ +#world { + [ne_10m_adm = 'GBR'], /* United Kingdom */ + [ne_10m_adm = 'FRA'] /* France */ + { + polygon-fill: #fff; + } +} diff --git a/test/rendering/weird_comments_2.result b/test/rendering/weird_comments_2.result new file mode 100644 index 0000000..8e73299 --- /dev/null +++ b/test/rendering/weird_comments_2.result @@ -0,0 +1,25 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/weird_simple_comments.mml b/test/rendering/weird_simple_comments.mml new file mode 100644 index 0000000..9d109f8 --- /dev/null +++ b/test/rendering/weird_simple_comments.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "weird_simple_comments.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/weird_simple_comments.mss b/test/rendering/weird_simple_comments.mss new file mode 100644 index 0000000..c28c8ea --- /dev/null +++ b/test/rendering/weird_simple_comments.mss @@ -0,0 +1 @@ +#world { one/marker-file: url(http://upload.wikimedia.org/wikipedia/commons/7/72/Cup_of_coffee.svg); two/marker-file: url('http://upload.wikimedia.org/wikipedia/commons/7/72/Cup_of_coffee.svg'); three/marker-file: url(http://upload.wikimedia.org/wikipedia/en/c/ce/SVG-logo.svg); four/marker-file: url("http://a.tiles.mapbox.com/v3/marker/pin-m-fast-food+AA0000.png"); } diff --git a/test/rendering/weird_simple_comments.result b/test/rendering/weird_simple_comments.result new file mode 100644 index 0000000..51b20a9 --- /dev/null +++ b/test/rendering/weird_simple_comments.result @@ -0,0 +1,23 @@ + + + + + + + + world + + + + + + + diff --git a/test/rendering/zoomlevels.mml b/test/rendering/zoomlevels.mml new file mode 100644 index 0000000..30c3867 --- /dev/null +++ b/test/rendering/zoomlevels.mml @@ -0,0 +1,22 @@ +{ + "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", + "Stylesheet": [ + "zoomlevels.mss" + ], + "Layer": [{ + "id": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }, + { + "id": "countries", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/zoomlevels.mss b/test/rendering/zoomlevels.mss new file mode 100644 index 0000000..3725b0e --- /dev/null +++ b/test/rendering/zoomlevels.mss @@ -0,0 +1,30 @@ +#world[zoom=9] { + polygon-fill: #000; + + [zoom > 9] { + polygon-fill: #FFF; + } +} + +#world[zoom<4] { + polygon-fill: #FF0; +} + +#world[zoom > 9][zoom <= 11] { + polygon-fill: #DDD; +} + +#countries { + [zoom=1] { line-width:2; } + [zoom=2] { line-width:1.5; } + [zoom=3], [zoom=4] { line-width:1.25; } + [zoom=5] { line-width:1; } + [zoom=6] { line-width:0.9; } + [zoom=7] { line-width:0.8; } + [zoom=8] { line-width:0.7; } + [zoom=9] { line-width:.6; } + [zoom=10] { line-width:.5; } + [zoom=11] { line-width:.4; } + [zoom=12] { line-width:.3; } + [zoom>12] { line-width:.25; } +} diff --git a/test/rendering/zoomlevels.result b/test/rendering/zoomlevels.result new file mode 100644 index 0000000..3aa1e24 --- /dev/null +++ b/test/rendering/zoomlevels.result @@ -0,0 +1,108 @@ + + + + + + + + world + + + + + + + + + countries + + + + + + + diff --git a/test/rendering/zoomselector.mml b/test/rendering/zoomselector.mml new file mode 100644 index 0000000..2386fe4 --- /dev/null +++ b/test/rendering/zoomselector.mml @@ -0,0 +1,15 @@ +{ + "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", + "Stylesheet": [ + "zoomselector.mss" + ], + "Layer": [{ + "id": "world", + "class": "", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/rendering/zoomselector.mss b/test/rendering/zoomselector.mss new file mode 100644 index 0000000..cedaebd --- /dev/null +++ b/test/rendering/zoomselector.mss @@ -0,0 +1,6 @@ +#world { + [zoom=9] { marker-height: 4; } + [zoom>6][zoom<10] { marker-height: 3; } + [zoom>3][zoom<7] { marker-height: 2; } + [zoom<4] { marker-height: 1; } +} diff --git a/test/rendering/zoomselector.result b/test/rendering/zoomselector.result new file mode 100644 index 0000000..279493a --- /dev/null +++ b/test/rendering/zoomselector.result @@ -0,0 +1,32 @@ + + + + + + + + world + + + + + + + diff --git a/test/specificity.test.js b/test/specificity.test.js new file mode 100644 index 0000000..18c7fff --- /dev/null +++ b/test/specificity.test.js @@ -0,0 +1,60 @@ +var path = require('path'), + assert = require('assert'), + fs = require('fs'); + +var carto = require('../lib/carto'); +var tree = require('../lib/carto').tree; +var helper = require('./support/helper'); + +function cleanupItem(key, value) { + if (key === 'rules') return; + else if (key === 'ruleIndex') return; + else if (key === 'elements') return value.map(function(item) { return item.value; }); + else if (key === 'filters') { + var arr = []; + for (var id in value.filters) arr.push(id + value.filters[id].val); + if (arr.length) return arr; + } + else if (key === 'attachment' && value === '__default__') return; + else if (key === 'zoom') { + if (value != tree.Zoom.all) return (new tree.Zoom()).setZoom(value).toString(); + } + else return value; +} + +describe('Specificity', function() { +helper.files('specificity', 'mss', function(file) { + it('should handle spec correctly in ' + file, function(done) { + helper.file(file, function(content) { + var ref = new carto.tree.Reference(); + ref.setVersion(ref.getLatest()); + var tree = (new carto.Parser({ + paths: [ path.dirname(file) ], + filename: file, + ref: ref + })).parse(content); + + var mss = tree.toList({}); + mss = helper.makePlain(mss, cleanupItem); + var json = JSON.parse(fs.readFileSync(helper.resultFile(file))); + var actual = file.replace(path.extname(file),'') + '-actual.json'; + var expected = file.replace(path.extname(file),'') + '-expected.json'; + try { + assert.deepEqual(mss, json); + // cleanup any actual renders that no longer fail + try { + fs.unlinkSync(actual); + fs.unlinkSync(expected); + } catch (err) { + // do nothing + } + } catch (err) { + fs.writeFileSync(actual,JSON.stringify(mss,null,4)); + fs.writeFileSync(expected,JSON.stringify(json,null,4)); + throw new Error('failed: ' + actual + ' not equal to expected: ' + expected); + } + done(); + }); + }); +}); +}); diff --git a/test/specificity/classes.mss b/test/specificity/classes.mss new file mode 100644 index 0000000..8033f2d --- /dev/null +++ b/test/specificity/classes.mss @@ -0,0 +1,7 @@ +.baz .bar {} +.foo {} +.bar {} +.foo .bar .baz {} +.baz {} +.baz .foo {} +.foo .baz {} diff --git a/test/specificity/classes.result b/test/specificity/classes.result new file mode 100644 index 0000000..0e41a46 --- /dev/null +++ b/test/specificity/classes.result @@ -0,0 +1,9 @@ +[ + {"elements":[".foo",".bar",".baz"],"specificity":[0,3,0,29],"matchCount": 0}, + {"elements":[".foo",".baz"],"specificity":[0,2,0,68],"matchCount": 0}, + {"elements":[".baz",".foo"],"specificity":[0,2,0,55],"matchCount": 0}, + {"elements":[".baz",".bar"],"specificity":[0,2,0,0],"matchCount": 0}, + {"elements":[".baz"],"specificity":[0,1,0,47],"matchCount": 0}, + {"elements":[".bar"],"specificity":[0,1,0,21],"matchCount": 0}, + {"elements":[".foo"],"specificity":[0,1,0,13],"matchCount": 0} +] diff --git a/test/specificity/demo.mss b/test/specificity/demo.mss new file mode 100644 index 0000000..6594d05 --- /dev/null +++ b/test/specificity/demo.mss @@ -0,0 +1,24 @@ +#world { + polygon-fill:#CCC; +} + +#world[NAME='United States'] { + polygon-fill:#F00; + + [BLUE='red'] { + + } + +} + +#countries .countries .two { + polygon-fill:#0FF; +} + +#countries, #world { + polygon-fill:#F0F; + polygon-opacity: 0.5; +} + + +#countries, #countries.foo.bar.baz {} diff --git a/test/specificity/demo.result b/test/specificity/demo.result new file mode 100644 index 0000000..a36e3ed --- /dev/null +++ b/test/specificity/demo.result @@ -0,0 +1,10 @@ +[ + {"elements":["#countries",".foo",".bar",".baz"],"specificity":[1,3,0,241],"matchCount": 0}, + {"elements":["#countries",".countries",".two"],"specificity":[1,2,0,149],"matchCount": 0}, + {"elements":["#world"],"filters":["[NAME]=United States","[BLUE]=red"],"specificity":[1,0,2,90],"matchCount": 0}, + {"elements":["#world"],"filters":["[NAME]=United States"],"specificity":[1,0,1,66],"matchCount": 0}, + {"elements":["#countries"],"specificity":[1,0,0,241],"matchCount": 0}, + {"elements":["#countries"],"specificity":[1,0,0,194],"matchCount": 0}, + {"elements":["#world"],"specificity":[1,0,0,194],"matchCount": 0}, + {"elements":["#world"],"specificity":[1,0,0,11],"matchCount": 0} +] diff --git a/test/specificity/filters_and_ids.mss b/test/specificity/filters_and_ids.mss new file mode 100644 index 0000000..e9b271b --- /dev/null +++ b/test/specificity/filters_and_ids.mss @@ -0,0 +1,7 @@ +#world [NAME='Canada'] {} +#world [NAME='United States'] { + [zoom > 5] {} +} +#world #countries [NAME='United States'] {} +[NAME='United States'] {} +[zoom > 5] {} \ No newline at end of file diff --git a/test/specificity/filters_and_ids.result b/test/specificity/filters_and_ids.result new file mode 100644 index 0000000..abe3dce --- /dev/null +++ b/test/specificity/filters_and_ids.result @@ -0,0 +1,8 @@ +[ + {"elements":["#world","#countries"],"filters":["[NAME]=United States"],"specificity":[2,0,1,94],"matchCount": 0}, + {"elements":["#world"],"filters":["[NAME]=United States"],"zoom":"......XXXXXXXXXXXXXXXXXXXX","specificity":[1,0,2,60],"matchCount": 0}, + {"elements":["#world"],"filters":["[NAME]=United States"],"specificity":[1,0,1,33],"matchCount": 0}, + {"elements":["#world"],"filters":["[NAME]=Canada"],"specificity":[1,0,1,7],"matchCount": 0}, + {"elements":[],"zoom":"......XXXXXXXXXXXXXXXXXXXX","specificity":[0,0,1,146],"matchCount": 0}, + {"elements":[],"filters":["[NAME]=United States"],"specificity":[0,0,1,120],"matchCount": 0} +] diff --git a/test/specificity/issue60.mml b/test/specificity/issue60.mml new file mode 100644 index 0000000..faf9a71 --- /dev/null +++ b/test/specificity/issue60.mml @@ -0,0 +1,14 @@ +{ + "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", + "Stylesheet": [ + "issue60.mss" + ], + "Layer": [{ + "name": "world", + "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", + "Datasource": { + "file": "http://tilemill-data.s3.amazonaws.com/test_data/shape_demo.zip", + "type": "shape" + } + }] +} diff --git a/test/specificity/issue60.mss b/test/specificity/issue60.mss new file mode 100644 index 0000000..baf44fa --- /dev/null +++ b/test/specificity/issue60.mss @@ -0,0 +1,6 @@ +#world { + [NET_INFLOW > -30000] { polygon-fill: #f00; } + [NET_INFLOW > -10000] { polygon-fill: #0f0; } +} + +#world [OBJECTID=12] { polygon-pattern-file:url(../resources/textures/stripe.png); } diff --git a/test/specificity/issue60.result b/test/specificity/issue60.result new file mode 100644 index 0000000..f24f92a --- /dev/null +++ b/test/specificity/issue60.result @@ -0,0 +1,6 @@ +[ + {"elements":["#world"],"filters":["[OBJECTID]=12"],"specificity":[1,0,1,131],"matchCount": 0}, + {"elements":["#world"],"filters":["[NET_INFLOW]>-10000"],"specificity":[1,0,1,83],"matchCount": 0}, + {"elements":["#world"],"filters":["[NET_INFLOW]>-30000"],"specificity":[1,0,1,35],"matchCount": 0}, + {"elements":["#world"],"specificity":[1,0,0,0],"matchCount": 0} +] diff --git a/test/support/.eslintrc.yml b/test/support/.eslintrc.yml new file mode 100644 index 0000000..3f3f80c --- /dev/null +++ b/test/support/.eslintrc.yml @@ -0,0 +1,2 @@ +rules: + no-control-regex: 0 diff --git a/test/support/diff.js b/test/support/diff.js new file mode 100644 index 0000000..463fd8c --- /dev/null +++ b/test/support/diff.js @@ -0,0 +1,189 @@ +/** + * Fragment used to represent a string fragment in the diff. + */ +var Fragment = function Fragment(string) { + this.content = string; + this.equiv = false; +}; + +/** + * Wrap in given tag or return the clean value. + */ +Fragment.prototype.toString = function (tag) { + if (this.equiv || !tag) { + return this.content; + } + else { + return '<' + tag + '>' + this.content + ''; + } +}; + +var moveToEnd = function (a, i, k) { + if (!a.equiv && (!k[i-1] || k[i-1].equiv)) { + // Find next item equiv item. + for (var j = i+1; k[j] && !k[j].equiv; j++); + if (k[j] && k[j].content === a.content) { + k[i] = k[j]; + k[j] = a; + } + } +}; + +var aggregate = function (a, i, k) { + if (!a.equiv && k[i+1] && !k[i+1].equiv) { + k[i+1].content = a.content + k[i+1].content; + delete k[i]; + } +}; + +var join = function (what, t) { + return what.map(function (a) { + if (a) { + return a.toString(t); + } + return null; + }).join(''); +}; + +var clone = function(source) { + if (typeof source === 'object' && source !== null) { + var target = Array.isArray(source) ? [] : {}; + for (var key in source) target[key] = clone(source[key]); + return target; + } + return source; +}; + +var WordDiff = { + nonWord: /(&.+?;|[\u0000-\u0040\u005B-\u0060\u007B-\u00A9\u00AB-\u00B4\u00B6-\u00B9\u00BB-\u00BF\u00D7\u00F7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u036F\u0375\u037E\u0384\u0385\u0387\u03F6\u0482-\u0489\u055A-\u055F\u0589\u058A\u0591-\u05C7\u05F3\u05F4\u0600-\u0603\u0606-\u061B\u061E\u061F\u064B-\u065E\u0660-\u066D\u0670\u06D4\u06D6-\u06E4\u06EA-\u06ED\u06F0-\u06F9\u06FD\u06FE\u0700-\u070D\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07F6-\u07F9\u0901-\u0903\u093C\u093E-\u094D\u0951-\u0954\u09E2\u0962-\u0970\u06E7-\u06E9\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E3\u09E6-\u09EF\u09F2-\u09FA\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AF1\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B66-\u0B70\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BFA\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C78-\u0C7F\u0C82\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D02\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D75\u0D79\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2-\u0DF4\u0E31\u0E34-\u0E3A\u0E3F\u0E47-\u0E5B\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0ED0-\u0ED9\u0F01-\u0F3F\u0F71-\u0F87\u0F90-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FD4\u102B-\u103E\u1040-\u104F\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u1099\u109E\u109F\u10FB\u135F-\u137C\u1390-\u1399\u166D\u166E\u1680\u169B\u169C\u16EB-\u16F0\u1712-\u1714\u1732-\u1736\u1752\u1753\u1772\u1773\u17B4-\u17D6\u17D8-\u17DB\u17DD\u17E0-\u17E9\u17F0-\u17F9\u1800-\u180E\u1810-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1940\u1944-\u194F\u19B0-\u19C0\u19C8\u19C9\u19D0-\u19D9\u19DE-\u19FF\u1A17-\u1A1B\u1A1E\u1A1F\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B7C\u1B80-\u1B82\u1BA1-\u1BAA\u1BB0-\u1BB9\u1C24-\u1C37\u1C3B-\u1C49\u1C50-\u1C59\u1C7E\u1C7F\u1DC0-\u1DE6\u1DFE\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2000-\u2064\u206A-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20B5\u20D0-\u20F0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u2153-\u2182\u2185-\u2188\u2190-\u23E7\u2400-\u2426\u2440-\u244A\u2460-\u269D\u26A0-\u26BC\u26C0-\u26C3\u2701-\u2704\u2706-\u2709\u270C-\u2727\u2729-\u274B\u274D\u274F-\u2752\u2756\u2758-\u275E\u2761-\u2794\u2798-\u27AF\u27B1-\u27BE\u27C0-\u27CA\u27CC\u27D0-\u2B4C\u2B50-\u2B54\u2CE5-\u2CEA\u2CF9-\u2CFF\u2DE0-\u2E2E\u2E30\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3000-\u3004\u3007-\u3030\u3036-\u303A\u303D-\u303F\u3099-\u309C\u30A0\u30FB\u3190-\u319F\u31C0-\u31E3\u3200-\u321E\u3220-\u3243\u3250-\u32FE\u3300-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA60D-\uA60F\uA620-\uA629\uA66F-\uA673\uA67C-\uA67E\uA700-\uA716\uA720\uA721\uA789\uA78A\uA802\uA806\uA80B\uA823-\uA82B\uA874-\uA877\uA880\uA881\uA8B4-\uA8C4\uA8CE-\uA8D9\uA900-\uA909\uA926-\uA92F\uA947-\uA953\uA95F\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA5C-\uAA5F\uD800\uDB7F\uDB80\uDBFF\uDC00\uDFFF\uE000\uF8FF\uFB1E\uFB29\uFD3E\uFD3F\uFDFC\uFDFD\uFE00-\uFE19\uFE20-\uFE26\uFE30-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD])/, + + tokenize: function (args) { + // Split on non-word characters. + for (var type in args) { + args[type] = args[type].split(WordDiff.nonWord).filter(function (s) { + return s.length; + }); + } + + // Calculate the indexes and offsets for common suffixes and prefixes. + var i = -1, j = args.del.length, k = args.ins.length; + while (args.del[++i] === args.ins[i] && i <= j); + while (j >= i && k >= i && args.del[--j] === args.ins[--k]); + + args.prefix = args.del.slice(0, i).join(''); + args.suffix = args.del.slice(j + 1).join(''); + args.del = args.del.slice(i, ++j); + args.ins = args.ins.slice(i, ++k); + }, + + lcs: function (args) { + var matrix = []; + + for (var i = 0; i < args.del.length; i++) { + matrix[i] = []; + for (var j = 0; j < args.ins.length; j++) { + if (args.del[i] === args.ins[j]) { + matrix[i][j] = (matrix[i - 1] && matrix[i - 1][j - 1] || 0) + args.del[i].length; + } + else { + matrix[i][j] = Math.max(matrix[i][j - 1] || 0, matrix[i - 1] && matrix[i - 1][j] || 0); + } + } + } + + return matrix; + }, + + changeset: function (args, matrix) { + var result = {}; + + ['del', 'ins'].forEach(function (type) { + result[type] = args[type].map(function (a) { return new Fragment(a); }); + }); + + // Backtrack through the matrix. + for (var i = result.del.length - 1, j = result.ins.length - 1; i >= 0; i--, j--) { + if (j < 0 || result.del[i].content !== result.ins[j].content) { + if (j < 0 || (j > 0 && matrix[i - 1] && (matrix[i][j - 1] < matrix[i - 1][j]))) { + j++; + } + else { + i++; + } + } + else { + result.del[i] = result.ins[j]; + result.del[i].equiv = true; + } + } + + // Fill up gaps. + for (var i2 = 0; i2 < result.del.length; i2++) { + if (result.del[i2].equiv && result.del[i2].content.length < 3) { + var j2 = result.ins.indexOf(result.del[i2]); + if (result.del[i2-1] && result.del[i2+1] && result.ins[j2-1] && result.ins[j2+1] && !result.del[i2-1].equiv && !result.del[i2+1].equiv && !result.ins[j2-1].equiv && !result.ins[j2+1].equiv){ + result.del[i2].equiv = false; + result.ins[j2] = clone(result.del[i2]); + } + } + } + + ['del', 'ins'].forEach(function (type) { + // Try to move changes to the end. + for (var i = 0; i < result[type].length; i++) + moveToEnd(result[type][i], i, result[type]); + + // Aggregate subsequent changes to minimize ins/del tags. + for (var i2 = 0; i2 < result[type].length; i2++) + aggregate(result[type][i2], i2, result[type]); + }); + + return result; + }, + + htmlRender: function (args, result) { + var diff = { + del: args.prefix + join(result.del, 'del') + args.suffix, + ins: args.prefix + join(result.ins, 'ins') + args.suffix + }; + + return diff; + }, + + htmlDiff: function (del, ins) { + var args = { 'del': del, 'ins': ins }; + + WordDiff.tokenize(args); + var matrix = WordDiff.lcs(args); + var result = WordDiff.changeset(args, matrix); + return WordDiff.htmlRender(args, result); + }, + + render: function (args, result) { + var join = function (what, type) { + return what.map(function (a) { + if (!a) return null; + if (a.equiv) return a.content; + if (type == 'del') return '\x1B[31;4m' + a.content + '\x1B[0m'; + if (type == 'ins') return '\x1B[32;4m' + a.content + '\x1B[0m'; + return null; + }).join(''); + }; + + return { + del: args.prefix + join(result.del, 'del') + args.suffix, + ins: args.prefix + join(result.ins, 'ins') + args.suffix + }; + }, + + diff: function(del, ins) { + var args = { 'del': del, 'ins': ins }; + + WordDiff.tokenize(args); + var matrix = WordDiff.lcs(args); + var result = WordDiff.changeset(args, matrix); + return WordDiff.render(args, result); + } +}; + +module.exports = WordDiff; diff --git a/test/support/helper.js b/test/support/helper.js new file mode 100644 index 0000000..3cc0fe1 --- /dev/null +++ b/test/support/helper.js @@ -0,0 +1,211 @@ +var path = require('path'), + carto = require('../../lib/carto'), + fs = require('fs'), + assert = require('assert'), + crypto = require('crypto'), + sax = require('sax'), + diff = require('./diff').diff, + constants = ((!process.ENOENT) >= 1) ? + require('constants') : + { ENOENT: process.ENOENT }; + +var helper = exports; + +exports.files = function(dir, extension, callback) { + dir = path.join(__dirname, '..', dir); + extension = new RegExp('\\.' + extension + '$'); + fs.readdirSync(dir).forEach(function(filename) { + if (extension.test(filename)) { + return callback(path.join(dir, filename)); + } + }); +}; + +exports.file = function(file, callback) { + fs.readFile(file, 'utf-8', function(err, content) { + if (err) throw err; + return callback(content); + }); +}; + +exports.json = function(file, callback) { + fs.readFile(file, 'utf-8', function(err, content) { + if (err) throw err; + return callback(JSON.parse(content)); + }); +}; + +exports.mml = function(file, callback) { + var data = fs.readFileSync(file, 'utf-8'); + var mml = new carto.MML(); + mml.load(path.dirname(file), data, callback); +}; + +exports.mss = function(file) { + return fs.readFileSync(file, 'utf-8'); +}; + +exports.showDifferences = function(e, format) { + var changes = diff( + (format || JSON.stringify)(e.actual), + (format || JSON.stringify)(e.expected) + ); + + console.warn(helper.stylize('actual:', 'bold') + '\n' + changes.del); + console.warn(helper.stylize('expected:', 'bold') + '\n' + changes.ins); +}; + +exports.formatJSON = function(arr) { + return '[\n ' + arr.map(function(t) { + return JSON.stringify(t); + }).join(',\n ') + '\n]'; +}; + +exports.makePlain = function(obj, fn) { + return JSON.parse(JSON.stringify(obj, fn)); +}; + +exports.parseXML = function(xml, callback) { + var parser = sax.parser(true); + var i = 0; + var tree = [ {} ]; + + parser.onopentag = function(node) { + if (!(node.name in tree[0])) tree[0][node.name] = []; + node.attributes.__order__ = i++; + tree[0][node.name].push(node.attributes); + tree.unshift(node.attributes); + }; + + parser.onclosetag = function() { + tree.shift(); + if (tree.length === 1) return callback(tree[0]); + }; + + parser.ontext = parser.oncdata = function(text) { + if (text.trim()) tree[0].text = (tree[0].text || '') + text; + }; + + parser.write(xml.toString()); +}; + +exports.compareToXMLFile = function(filename, second, callback, processors) { + helper.file(filename, function(first) { + helper.parseXML(first, function(firstXML) { + helper.parseXML(second, function(secondXML) { + processors.forEach(function(processor) { + processor(secondXML); + }); + + try { + assert.deepEqual(firstXML, secondXML); + return callback(null); + } catch (err) { + return callback(err, firstXML, secondXML); + } + }); + }); + }); +}; + +exports.resultFile = function(file) { + if (process.platform && process.platform === 'win32') { + var fileWin = path.join(path.dirname(file), path.basename(file).replace(/\.\w+$/, '_syswin.result')); + if (fs.existsSync(fileWin)) { + return fileWin; + } + } + return path.join(path.dirname(file), path.basename(file).replace(/\.\w+$/, '.result')); +}; + + +// Stylize a string +exports.stylize = function(str, style) { + var styles = { + 'bold' : [1, 22], + 'inverse' : [7, 27], + 'underline' : [4, 24], + 'yellow' : [33, 39], + 'green' : [32, 39], + 'red' : [31, 39] + }; + return '\x1B[' + styles[style][0] + 'm' + str + + '\x1B[' + styles[style][1] + 'm'; +}; + + +exports.isDirectory = function(dir, context) { + fs.stat(dir, function(err, stats) { + if (err) throw err; + assert.ok(stats.isDirectory()); + context.tests++; + }); +}; + +exports.isFile = function(file, context) { + fs.stat(file, function(err, stats) { + if (err) throw err; + assert.ok(stats.isFile()); + context.tests++; + }); +}; + +exports.rmrf = function rmrf(p) { + try { + if (fs.statSync(p).isDirectory()) { + fs.readdirSync(p).forEach(function(file) { rmrf(path.join(p, file)); }); + fs.rmdirSync(p); + } + else fs.unlinkSync(p); + } catch (err) { + if (err.errno !== constants.ENOENT) throw err; + } +}; + +exports.md5File = function(file, md5, context) { + fs.readFile(file, 'binary', function(err, data) { + if (!err) { + var hash = crypto.createHash('md5').update(data).digest('hex'); + assert.equal(hash, md5); + context.tests++; + } + }); +}; + +helper.removeErrorFilename = function(error) { + error.forEach(function(e) { + e.filename = '[absolute path]'; + }); + return error; +}; + +helper.removeAbsoluteImages = function(xml) { + xml.Map.forEach(function(map) { + if (map.Style) map.Style.forEach(function(style) { + style.Rule.forEach(function(rule) { + for (var symbolizer in rule) { + for (var i = 0; i < rule[symbolizer].length; i++) { + if (rule[symbolizer][i].file) { + rule[symbolizer][i].file = '[absolute path]'; + } + } + } + }); + }); + }); +}; + +helper.removeAbsoluteDatasources = function(xml) { + xml.Map.forEach(function(map) { + if (map.Layer) map.Layer.forEach(function(layer) { + if (!layer.Datasource) return; + layer.Datasource.forEach(function(datasource) { + datasource.Parameter.forEach(function(param) { + if (param.name === 'file') { + param.text = '[absolute path]'; + } + }); + }); + }); + }); +}; diff --git a/test/version.test.js b/test/version.test.js new file mode 100644 index 0000000..3195d48 --- /dev/null +++ b/test/version.test.js @@ -0,0 +1,17 @@ +var carto = require('../lib/carto'); +var path = require('path'); +var assert = require('assert'); + + +describe('Version check', function() { + it('test version matches package.json version and changelog', function() { + var info; + if (parseInt(process.version.split('.')[1], 10) > 4) { + info = require('../package.json'); + assert.deepEqual(info.version.split('.'), carto.version); + } else { + info = JSON.parse(require('fs').readFileSync(path.join(__dirname,'../package.json'))); + assert.deepEqual(info.version.split('.'), carto.version); + } + }); +}); -- cgit v1.2.3 From 70cf17e9f6e4189a78befc0a60e55e5f383b4e11 Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Thu, 18 Nov 2021 00:01:55 +0100 Subject: disable test because mocha-eslint is not packaged Forwarded: not-needed Gbp-Pq: Name disable-eslint.patch --- test/eclint.test.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/eclint.test.js b/test/eclint.test.js index cbce110..9392129 100644 --- a/test/eclint.test.js +++ b/test/eclint.test.js @@ -1,3 +1,4 @@ +/* var lint = require('mocha-eslint'); describe('jslint', function() { @@ -11,3 +12,4 @@ describe('jslint', function() { options.formatter = 'compact'; lint(paths, options); }); +*/ -- cgit v1.2.3 From 70543a32b7c7cfc128fffe4484cb287e3e2d6773 Mon Sep 17 00:00:00 2001 From: Debian Javascript Maintainers Date: Thu, 18 Nov 2021 00:01:55 +0100 Subject: fix-tests Gbp-Pq: Name fix-tests.patch --- test/rendering/zoomlevels.result | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/rendering/zoomlevels.result b/test/rendering/zoomlevels.result index 3aa1e24..5c7acd5 100644 --- a/test/rendering/zoomlevels.result +++ b/test/rendering/zoomlevels.result @@ -75,13 +75,13 @@ - 50000000 - 25000000 + 100000000 + 50000000 - 100000000 - 50000000 + 50000000 + 25000000 -- cgit v1.2.3