[Git][debian-gis-team/mapnik][master] 6 commits: New upstream version 3.0.23+ds
Bas Couwenberg
gitlab at salsa.debian.org
Tue Feb 18 15:32:39 GMT 2020
Bas Couwenberg pushed to branch master at Debian GIS Project / mapnik
Commits:
e6e4dbb7 by Bas Couwenberg at 2020-02-18T14:45:41+01:00
New upstream version 3.0.23+ds
- - - - -
8c297596 by Bas Couwenberg at 2020-02-18T14:45:54+01:00
Update upstream source from tag 'upstream/3.0.23+ds'
Update to upstream version '3.0.23+ds'
with Debian dir e8b3ee48eff26a1d8986d9a3783da140294d9d17
- - - - -
449c2b46 by Bas Couwenberg at 2020-02-18T14:46:09+01:00
New upstream release.
- - - - -
77deb46b by Bas Couwenberg at 2020-02-18T14:49:40+01:00
Refresh patches.
- - - - -
fa8fb11f by Bas Couwenberg at 2020-02-18T16:08:47+01:00
Add lintian override for file-references-package-build-path.
- - - - -
ae99fe07 by Bas Couwenberg at 2020-02-18T16:08:47+01:00
Set distribution to experimental.
- - - - -
29 changed files:
- .travis.yml
- CHANGELOG.md
- README.md
- SConstruct
- benchmark/utils/random_image.py
- debian/changelog
- + debian/libmapnik-dev.lintian-overrides
- debian/patches/0001-Use-pkg-config-to-find-FreeType2-if-available.patch
- debian/patches/libxml2.patch
- deps/agg/src/agg_pixfmt_rgba.cpp
- include/mapnik/feature.hpp
- + include/mapnik/geometry/boost_spirit_karma_adapter.hpp
- include/mapnik/json/feature_generator_grammar.hpp
- include/mapnik/json/feature_generator_grammar_impl.hpp
- include/mapnik/json/geometry_generator_grammar.hpp
- include/mapnik/json/geometry_generator_grammar_impl.hpp
- include/mapnik/json/properties_generator_grammar_impl.hpp
- include/mapnik/svg/geometry_svg_generator.hpp
- include/mapnik/version.hpp
- include/mapnik/wkt/wkt_generator_grammar.hpp
- include/mapnik/wkt/wkt_generator_grammar_impl.hpp
- plugins/input/gdal/gdal_featureset.cpp
- scripts/travis-command-wrapper.py
- scripts/travis-common.sh
- src/json/mapnik_json_generator_grammar.cpp
- src/wkt/mapnik_wkt_generator_grammar.cpp
- test/unit/core/expressions_test.cpp
- utils/pgsql2sqlite/build.py
- utils/shapefile/shapefile_reader.py
Changes:
=====================================
.travis.yml
=====================================
@@ -8,7 +8,6 @@ env:
global:
- CCACHE_TEMPDIR=/tmp/.ccache-temp
- CCACHE_COMPRESS=1
- - HEAVY_JOBS="2"
- PREFIX=/tmp/mapnik
- secure: "F6ivqDNMBQQnrDGA9+7IX+GDswuIqQQd7YPJdQqa2Ked9jddAQDeJClb05ig3JlwfOlYLGZOd43ZX0pKuMtI2Gbkwz211agGP9S3YunwlRg8iWtJlO5kYFUdKCmJNhjg4icfkGELCgwXn+zuEWFSLpkPcjqAFKFlQrIJeAJJgKM="
@@ -23,7 +22,9 @@ matrix:
include:
- os: linux
name: Linux gcc-6
- env: JOBS=4 CXX="ccache g++-6" CC="gcc-6"
+ env: >-
+ CXX="ccache g++-6"
+ CC="gcc-6"
addons:
postgresql: "9.4"
apt:
@@ -31,40 +32,46 @@ matrix:
packages: [ 'libstdc++-6-dev', 'g++-6', 'xutils-dev', 'postgresql-9.4-postgis-2.3' ]
- os: linux
name: Linux clang-3.9
- env: JOBS=8 CXX="ccache clang++-3.9 -Qunused-arguments" CC="clang-3.9" ENABLE_GLIBC_WORKAROUND=true TRIGGER=true
+ env: >-
+ CXX="ccache clang++-3.9 -Qunused-arguments"
+ CC="clang-3.9"
+ ENABLE_GLIBC_WORKAROUND=true
+ before_install:
+ - export LINKFLAGS="-fuse-ld=gold-2.26"
addons:
postgresql: "9.4"
apt:
sources: [ 'ubuntu-toolchain-r-test' ]
- packages: [ 'libstdc++-4.9-dev', 'xutils-dev', 'postgresql-9.4-postgis-2.3' ]
+ packages: [ 'clang-3.9', 'libstdc++-4.9-dev', 'xutils-dev', 'postgresql-9.4-postgis-2.3' ]
- os: linux
name: Linux clang-3.9 + coverage
- env: JOBS=8 COVERAGE=true CXX="ccache clang++-3.9 -Qunused-arguments" CC="clang-3.9"
+ env: >-
+ CXX="ccache clang++-3.9 -Qunused-arguments"
+ CC="clang-3.9"
+ COVERAGE=true
+ before_install:
+ - export LINKFLAGS="-fuse-ld=gold-2.26"
+ - export LLVM_COV="llvm-cov-3.9"
addons:
postgresql: "9.4"
apt:
sources: [ 'ubuntu-toolchain-r-test' ]
- packages: ['libstdc++-4.9-dev', 'xutils-dev', 'postgresql-9.4-postgis-2.3' ]
+ packages: [ 'clang-3.9', 'llvm-3.9', 'libstdc++-4.9-dev', 'xutils-dev', 'postgresql-9.4-postgis-2.3' ]
- os: osx
name: OSX clang
# https://docs.travis-ci.com/user/languages/objective-c/#Supported-OS-X-iOS-SDK-versions
osx_image: xcode7.3 # upgrades clang from 6 -> 7
- env: JOBS=4 CXX="ccache clang++ -Qunused-arguments"
+ env: >-
+ CXX="ccache clang++ -Qunused-arguments"
-before_install:
+install:
+ - source scripts/travis-common.sh
# workaround travis rvm bug
# http://superuser.com/questions/1044130/why-am-i-having-how-can-i-fix-this-error-shell-session-update-command-not-f
- - |
- if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
- rvm get head || true
- fi
- - source scripts/travis-common.sh
+ - on 'osx' rvm get head || true
- export PATH=${PREFIX}/bin:$(pwd)/mason_packages/.link/bin:${PATH}
- export COVERAGE=${COVERAGE:-false}
- export BENCH=${BENCH:-false}
- - git_submodule_update --init deps/
-
-install:
- on 'osx' export DATA_PATH=$(brew --prefix)/var/postgres
- on 'osx' rm -rf ${DATA_PATH}
- on 'osx' initdb ${DATA_PATH} -E utf8
@@ -77,23 +84,17 @@ install:
- enabled ${COVERAGE} chmod +x codecov
before_script:
+ - export JOBS=${JOBS:-4}
+ - export HEAVY_JOBS=${HEAVY_JOBS:-2}
+ - export SCONSFLAGS='--debug=time'
- source bootstrap.sh
- - |
- if [[ $(uname -s) == 'Linux' ]]; then
- mason install clang++ 3.9.1
- export PATH=$(mason prefix clang++ 3.9.1)/bin:${PATH}
- mason install llvm-cov 3.9.1
- export PATH=$(mason prefix llvm-cov 3.9.1)/bin:${PATH}
- which llvm-cov
- export LLVM_COV="$(mason prefix llvm-cov 3.9.1)/bin/llvm-cov"
- fi
- ccache --version
- ccache -p || true
- ccache --show-stats || true
- commit_message_parse
script:
- - export SCONSFLAGS='--debug=time'
+ - git_submodule_update --init deps/
- configure BENCHMARK=${BENCH} ENABLE_GLIBC_WORKAROUND=${ENABLE_GLIBC_WORKAROUND:-false}
- cat config.log
# we limit the `make` to 40 min
@@ -107,6 +108,3 @@ script:
- test_ok && enabled ${COVERAGE} coverage
- test_ok && enabled ${BENCH} make bench
- ./scripts/check_glibcxx.sh
-
-after_success:
- - enabled ${TRIGGER} trigger_downstream
=====================================
CHANGELOG.md
=====================================
@@ -6,6 +6,17 @@ Developers: Please commit along with changes.
For a complete change history, see the git log.
+## 3.0.23
+
+Released: February 18, 2020
+
+(Packaged from bdb30f47a)
+
+- Complete build system migration to Py3 syntax (4b0bdd8630f6999e5db346fd767a06b8ceba8fb9)
+- Add support for `BOOST_VERSION >= 1_72`
+- gdal.input - add support for int32 pixel types (efc65126db5d51977d6374f9b983fc441f334eb6)
+
+
## 3.0.22
Released: January 22, 2019
=====================================
README.md
=====================================
@@ -9,7 +9,6 @@ _/ _/ _/_/_/ _/_/_/ _/ _/ _/ _/ _/
```
[![Build Status Linux](https://api.travis-ci.org/mapnik/mapnik.svg?branch=master)](http://travis-ci.org/mapnik/mapnik)
-[![Build Status Windows](https://ci.appveyor.com/api/projects/status/hc9l7okdjtucfqqn?branch=master&svg=true)](https://ci.appveyor.com/project/Mapbox/mapnik)
[![Coverage Status](https://coveralls.io/repos/mapnik/mapnik/badge.svg?branch=master&service=github)](https://coveralls.io/github/mapnik/mapnik?branch=master)
Mapnik is an open source toolkit for developing mapping applications. At the core is a C++ shared library providing algorithms and patterns for spatial data access and visualization.
=====================================
SConstruct
=====================================
@@ -274,6 +274,9 @@ def pretty_dep(dep):
return '%s (%s)' % (dep,'more info see: https://github.com/mapnik/mapnik/wiki/Mapnik-Installation & http://www.boost.org')
return dep
+def pretty_deps(indent, deps):
+ return indent + indent.join(pretty_dep(dep) for dep in deps)
+
DEFAULT_PLUGINS = []
for k,v in PLUGINS.items():
@@ -1084,6 +1087,7 @@ int main()
return False
def boost_regex_has_icu(context):
+ context.env.Append(LIBS='icui18n')
if env['RUNTIME_LINK'] == 'static':
# re-order icu libs to ensure linux linker is happy
for lib_name in ['icui18n',env['ICU_LIB_NAME'],'icudata']:
@@ -1392,6 +1396,7 @@ if not preconfigured:
[env['ICU_LIB_NAME'],'unicode/unistr.h',True,'C++'],
['harfbuzz', 'harfbuzz/hb.h',True,'C++']
]
+ OPTIONAL_LIBSHEADERS = []
if env.get('FREETYPE_LIBS') or env.get('FREETYPE_INCLUDES'):
REQUIRED_LIBSHEADERS.insert(0,['freetype','ft2build.h',True,'C'])
@@ -1414,9 +1419,7 @@ if not preconfigured:
except OSError as e:
pass
- # libxml2 should be optional but is currently not
- # https://github.com/mapnik/mapnik/issues/913
- if env.get('XMLPARSER') and env['XMLPARSER'] == 'libxml2':
+ if env['XMLPARSER'] == 'libxml2':
if env.get('XML2_LIBS') or env.get('XML2_INCLUDES'):
OPTIONAL_LIBSHEADERS.insert(0,['libxml2','libxml/parser.h',True,'C'])
if env.get('XML2_INCLUDES'):
@@ -1434,9 +1437,7 @@ if not preconfigured:
if conf.CheckHasDlfcn():
env.Append(CPPDEFINES = '-DMAPNIK_HAS_DLCFN')
else:
- env['SKIPPED_DEPS'].extend(['dlfcn'])
-
- OPTIONAL_LIBSHEADERS = []
+ env['SKIPPED_DEPS'].append('dlfcn')
if env['JPEG']:
OPTIONAL_LIBSHEADERS.append(['jpeg', ['stdio.h', 'jpeglib.h'], False,'C','-DHAVE_JPEG'])
@@ -1445,7 +1446,7 @@ if not preconfigured:
env.AppendUnique(CPPPATH = fix_path(inc_path))
env.AppendUnique(LIBPATH = fix_path(lib_path))
else:
- env['SKIPPED_DEPS'].extend(['jpeg'])
+ env['SKIPPED_DEPS'].append('jpeg')
if env['PROJ']:
OPTIONAL_LIBSHEADERS.append(['proj', 'proj_api.h', False,'C','-DMAPNIK_USE_PROJ4'])
@@ -1454,7 +1455,7 @@ if not preconfigured:
env.AppendUnique(CPPPATH = fix_path(inc_path))
env.AppendUnique(LIBPATH = fix_path(lib_path))
else:
- env['SKIPPED_DEPS'].extend(['proj'])
+ env['SKIPPED_DEPS'].append('proj')
if env['PNG']:
OPTIONAL_LIBSHEADERS.append(['png', 'png.h', False,'C','-DHAVE_PNG'])
@@ -1463,7 +1464,7 @@ if not preconfigured:
env.AppendUnique(CPPPATH = fix_path(inc_path))
env.AppendUnique(LIBPATH = fix_path(lib_path))
else:
- env['SKIPPED_DEPS'].extend(['png'])
+ env['SKIPPED_DEPS'].append('png')
if env['WEBP']:
OPTIONAL_LIBSHEADERS.append(['webp', 'webp/decode.h', False,'C','-DHAVE_WEBP'])
@@ -1472,7 +1473,7 @@ if not preconfigured:
env.AppendUnique(CPPPATH = fix_path(inc_path))
env.AppendUnique(LIBPATH = fix_path(lib_path))
else:
- env['SKIPPED_DEPS'].extend(['webp'])
+ env['SKIPPED_DEPS'].append('webp')
if env['TIFF']:
OPTIONAL_LIBSHEADERS.append(['tiff', 'tiff.h', False,'C','-DHAVE_TIFF'])
@@ -1481,7 +1482,7 @@ if not preconfigured:
env.AppendUnique(CPPPATH = fix_path(inc_path))
env.AppendUnique(LIBPATH = fix_path(lib_path))
else:
- env['SKIPPED_DEPS'].extend(['tiff'])
+ env['SKIPPED_DEPS'].append('tiff')
# if requested, sort LIBPATH and CPPPATH before running CheckLibWithHeader tests
if env['PRIORITIZE_LINKING']:
@@ -1781,9 +1782,7 @@ if not preconfigured:
)
env["CAIRO_ALL_LIBS"] = ['cairo']
if env['RUNTIME_LINK'] == 'static':
- env["CAIRO_ALL_LIBS"].extend(
- ['pixman-1']
- )
+ env["CAIRO_ALL_LIBS"].append('pixman-1')
# todo - run actual checkLib?
env['HAS_CAIRO'] = True
else:
@@ -1830,10 +1829,10 @@ if not preconfigured:
if env['MISSING_DEPS']:
# if required dependencies are missing, print warnings and then let SCons finish without building or saving local config
- color_print(1,'\nExiting... the following required dependencies were not found:\n - %s' % '\n - '.join([pretty_dep(dep) for dep in env['MISSING_DEPS']]))
+ color_print(1,'\nExiting... the following required dependencies were not found:' + pretty_deps('\n - ', env['MISSING_DEPS']))
color_print(1,"\nSee '%s' for details on possible problems." % (fix_path(SCONS_LOCAL_LOG)))
if env['SKIPPED_DEPS']:
- color_print(4,'\nAlso, these OPTIONAL dependencies were not found:\n - %s' % '\n - '.join([pretty_dep(dep) for dep in env['SKIPPED_DEPS']]))
+ color_print(4,'\nAlso, these OPTIONAL dependencies were not found:' + pretty_deps('\n - ', env['SKIPPED_DEPS']))
color_print(4,"\nSet custom paths to these libraries and header files on the command-line or in a file called '%s'" % SCONS_LOCAL_CONFIG)
color_print(4," ie. $ python scons/scons.py BOOST_INCLUDES=/usr/local/include BOOST_LIBS=/usr/local/lib")
color_print(4, "\nOnce all required dependencies are found a local '%s' will be saved and then install:" % SCONS_LOCAL_CONFIG)
@@ -1860,7 +1859,7 @@ if not preconfigured:
color_print(4,"Did not use user config file, no custom path variables will be saved...")
if env['SKIPPED_DEPS']:
- color_print(4,'\nNote: will build without these OPTIONAL dependencies:\n - %s' % '\n - '.join([pretty_dep(dep) for dep in env['SKIPPED_DEPS']]))
+ color_print(4,'\nNote: will build without these OPTIONAL dependencies:' + pretty_deps('\n - ', env['SKIPPED_DEPS']))
print
# fetch the mapnik version header in order to set the
@@ -1908,13 +1907,13 @@ if not preconfigured:
# Enable logging in debug mode (always) and release mode (when specified)
if env['DEFAULT_LOG_SEVERITY']:
if env['DEFAULT_LOG_SEVERITY'] not in severities:
- severities_list = ', '.join(["'%s'" % s for s in severities])
+ severities_list = ', '.join("'%s'" % s for s in severities)
color_print(1,"Cannot set default logger severity to '%s', available options are %s." % (env['DEFAULT_LOG_SEVERITY'], severities_list))
Exit(1)
else:
log_severity = severities.index(env['DEFAULT_LOG_SEVERITY'])
else:
- severities_list = ', '.join(["'%s'" % s for s in severities])
+ severities_list = ', '.join("'%s'" % s for s in severities)
color_print(1,"No logger severity specified, available options are %s." % severities_list)
Exit(1)
=====================================
benchmark/utils/random_image.py
=====================================
@@ -3,8 +3,8 @@ import random
im = mapnik.Image(256,256)
-for x in xrange(0,im.width()):
- for y in xrange(0,im.height()):
+for x in range(im.width()):
+ for y in range(im.height()):
r = int(random.random() * 255)
g = random.random() * 255
b = random.random() * 255
=====================================
debian/changelog
=====================================
@@ -1,11 +1,14 @@
-mapnik (3.0.22+ds1-2) UNRELEASED; urgency=medium
+mapnik (3.0.23+ds-1~exp1) experimental; urgency=medium
+ * New upstream release.
* Bump Standards-Version to 4.5.0, no changes.
* Drop Name field from upstream metadata.
* Add patch to use pkg-config for libxml2.
(closes: #949412)
+ * Refresh patches.
+ * Add lintian override for file-references-package-build-path.
- -- Bas Couwenberg <sebastic at debian.org> Mon, 30 Sep 2019 19:24:02 +0200
+ -- Bas Couwenberg <sebastic at debian.org> Tue, 18 Feb 2020 14:50:36 +0100
mapnik (3.0.22+ds1-1) unstable; urgency=medium
=====================================
debian/libmapnik-dev.lintian-overrides
=====================================
@@ -0,0 +1,3 @@
+# Cannot easily be fixed
+file-references-package-build-path usr/bin/mapnik-config
+
=====================================
debian/patches/0001-Use-pkg-config-to-find-FreeType2-if-available.patch
=====================================
@@ -6,15 +6,15 @@ Bug-Debian: https://bugs.debian.org/892451
--- a/SConstruct
+++ b/SConstruct
-@@ -1393,6 +1393,7 @@ if not preconfigured:
- ['harfbuzz', 'harfbuzz/hb.h',True,'C++']
+@@ -1398,6 +1398,7 @@ if not preconfigured:
]
+ OPTIONAL_LIBSHEADERS = []
+ CHECK_PKG_CONFIG = conf.CheckPKGConfig('0.15.0')
if env.get('FREETYPE_LIBS') or env.get('FREETYPE_INCLUDES'):
REQUIRED_LIBSHEADERS.insert(0,['freetype','ft2build.h',True,'C'])
if env.get('FREETYPE_INCLUDES'):
-@@ -1401,6 +1402,21 @@ if not preconfigured:
+@@ -1406,6 +1407,21 @@ if not preconfigured:
if env.get('FREETYPE_LIBS'):
lib_path = env['FREETYPE_LIBS']
env.AppendUnique(LIBPATH = fix_path(lib_path))
@@ -36,7 +36,7 @@ Bug-Debian: https://bugs.debian.org/892451
elif conf.parse_config('FREETYPE_CONFIG'):
# check if freetype links to bz2
if env['RUNTIME_LINK'] == 'static':
-@@ -1634,9 +1650,6 @@ if not preconfigured:
+@@ -1635,9 +1651,6 @@ if not preconfigured:
color_print(1,'%s not detected on your system' % env['QUERIED_ICU_DATA'] )
env['MISSING_DEPS'].append('ICU_DATA')
=====================================
debian/patches/libxml2.patch
=====================================
@@ -7,7 +7,7 @@ Applied-Upstream: https://github.com/mapnik/mapnik/commit/fe893134a5dc3ea5433601
--- a/SConstruct
+++ b/SConstruct
-@@ -1441,6 +1441,21 @@ if not preconfigured:
+@@ -1444,6 +1444,21 @@ if not preconfigured:
if env.get('XML2_LIBS'):
lib_path = env['XML2_LIBS']
env.AppendUnique(LIBPATH = fix_path(lib_path))
=====================================
deps/agg/src/agg_pixfmt_rgba.cpp
=====================================
@@ -5,11 +5,13 @@
#include <boost/version.hpp>
#if BOOST_VERSION >= 106900
#include <boost/gil.hpp>
+#include <boost/gil/extension/toolbox/color_spaces/hsv.hpp>
+#include <boost/gil/extension/toolbox/color_spaces/hsl.hpp>
#else
#include <boost/gil/gil_all.hpp>
-#endif
#include <boost/gil/extension/toolbox/hsv.hpp>
#include <boost/gil/extension/toolbox/hsl.hpp>
+#endif
#pragma GCC diagnostic pop
namespace agg
=====================================
include/mapnik/feature.hpp
=====================================
@@ -208,6 +208,11 @@ public:
return geom_;
}
+ inline geometry::geometry<double> & get_geometry()
+ {
+ return geom_;
+ }
+
inline box2d<double> envelope() const
{
return mapnik::geometry::envelope(geom_);
=====================================
include/mapnik/geometry/boost_spirit_karma_adapter.hpp
=====================================
@@ -0,0 +1,121 @@
+/*****************************************************************************
+ *
+ * This file is part of Mapnik (c++ mapping toolkit)
+ *
+ * Copyright (C) 2017 Artem Pavlenko
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ *****************************************************************************/
+
+
+#ifndef MAPNIK_BOOST_SPIRIT_KARMA_ADAPTER_HPP
+#define MAPNIK_BOOST_SPIRIT_KARMA_ADAPTER_HPP
+
+#include <mapnik/geometry.hpp>
+
+namespace boost { using mapbox::util::get; }
+
+#include <boost/spirit/home/karma/domain.hpp>
+#include <boost/spirit/home/support/attributes.hpp>
+
+namespace boost { namespace spirit { namespace traits
+{
+template <>
+struct not_is_variant<mapnik::geometry::geometry<double>, karma::domain>
+ : mpl::false_
+{};
+
+template <>
+struct not_is_variant<mapnik::geometry::geometry<std::int64_t>, karma::domain>
+ : mpl::false_
+{};
+
+template <>
+struct variant_which< mapnik::geometry::geometry<double> >
+{
+ static int call(mapnik::geometry::geometry<double> const& v)
+ {
+ return v.which();
+ }
+};
+
+template <>
+struct variant_which< mapnik::geometry::geometry<std::int64_t> >
+{
+ static int call(mapnik::geometry::geometry<std::int64_t> const& v)
+ {
+ return v.which();
+ }
+};
+
+namespace detail {
+
+template <typename T, typename Tuple>
+struct has_type;
+
+template <typename T>
+struct has_type<T, std::tuple<>> : std::false_type {};
+
+template <typename T, typename U, typename... Types>
+struct has_type<T, std::tuple<U, Types...>> : has_type<T, std::tuple<Types...>> {};
+
+template <typename T, typename... Types>
+struct has_type<T, std::tuple<T, Types...>> : std::true_type {};
+
+template <typename T, typename Tuple>
+struct index;
+
+template <typename T, typename... Types>
+struct index<T, std::tuple<T, Types...>>
+{
+ static const std::size_t value = 0;
+};
+
+template <typename T, typename U, typename... Types>
+struct index<T, std::tuple<U, Types...>>
+{
+ static const std::size_t value = 1 + index<T, std::tuple<Types...>>::value;
+};
+
+}
+
+template <typename Expected>
+struct compute_compatible_component_variant<mapnik::geometry::geometry<double>, Expected>
+ : detail::has_type<Expected, mapnik::geometry::geometry<double>::types>
+{
+ using compatible_type = Expected;
+ static bool is_compatible(int index)
+ {
+ return (index == detail::index<compatible_type, mapnik::geometry::geometry<double>::types>::value);
+ }
+};
+
+template <typename Expected>
+struct compute_compatible_component_variant<mapnik::geometry::geometry<std::int64_t>, Expected>
+ : detail::has_type<Expected, mapnik::geometry::geometry<std::int64_t>::types>
+{
+ using compatible_type = Expected;
+ static bool is_compatible(int index)
+ {
+ return (index == detail::index<compatible_type, mapnik::geometry::geometry<std::int64_t>::types>::value);
+ }
+};
+
+}}}
+
+
+
+#endif //MAPNIK_BOOST_SPIRIT_KARMA_ADAPTER_HPP
=====================================
include/mapnik/json/feature_generator_grammar.hpp
=====================================
@@ -2,7 +2,7 @@
*
* This file is part of Mapnik (c++ mapping toolkit)
*
- * Copyright (C) 2015 Artem Pavlenko
+ * Copyright (C) 2017 Artem Pavlenko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -63,17 +63,18 @@ struct end_container<mapnik::feature_impl const>
}
};
+#if BOOST_VERSION >= 106900
template <>
-struct transform_attribute<const boost::fusion::cons<mapnik::feature_impl const&, boost::fusion::nil>,
- mapnik::geometry::geometry<double> const& , karma::domain>
-{
- using type = mapnik::geometry::geometry<double> const&;
- static type pre(const boost::fusion::cons<mapnik::feature_impl const&, boost::fusion::nil>& f)
- {
- return boost::fusion::at<mpl::int_<0> >(f).get_geometry();
- }
-};
+struct transform_attribute<const mapnik::feature_impl, const mapnik::feature_impl &, boost::spirit::karma::domain, void>
+ : detail::transform_attribute_base<mapnik::feature_impl const, mapnik::feature_impl const&, boost::spirit::karma::domain>
+{};
+template <>
+struct transform_attribute<const boost::fusion::cons<const mapnik::feature_impl &, boost::fusion::nil_>, const mapnik::feature_impl &,
+ boost::spirit::karma::domain, void>
+ : detail::transform_attribute_base<const boost::fusion::cons<const mapnik::feature_impl &, boost::fusion::nil_>, mapnik::feature_impl const&, boost::spirit::karma::domain>
+{};
+#endif
}}}
namespace mapnik { namespace json {
@@ -91,6 +92,15 @@ struct get_id
}
};
+struct extract_geometry
+{
+ using result_type = mapnik::geometry::geometry<double> const&;
+ template <typename T>
+ result_type operator() (T const& f) const
+ {
+ return f.get_geometry();
+ }
+};
template <typename OutputIterator, typename FeatureType>
struct feature_generator_grammar :
@@ -101,6 +111,7 @@ struct feature_generator_grammar :
geometry_generator_grammar<OutputIterator, mapnik::geometry::geometry<double> > geometry;
properties_generator_grammar<OutputIterator, FeatureType> properties;
boost::phoenix::function<get_id<FeatureType> > id_;
+ boost::phoenix::function<extract_geometry> geom_;
};
}}
=====================================
include/mapnik/json/feature_generator_grammar_impl.hpp
=====================================
@@ -2,7 +2,7 @@
*
* This file is part of Mapnik (c++ mapping toolkit)
*
- * Copyright (C) 2015 Artem Pavlenko
+ * Copyright (C) 2017 Artem Pavlenko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -22,11 +22,6 @@
#include <mapnik/json/feature_generator_grammar.hpp>
-#include <boost/spirit/include/karma.hpp>
-#include <boost/spirit/include/phoenix.hpp>
-#include <boost/spirit/include/phoenix_core.hpp>
-#include <boost/fusion/include/at.hpp>
-
namespace mapnik { namespace json {
template <typename OutputIterator, typename FeatureType>
@@ -40,7 +35,7 @@ feature_generator_grammar<OutputIterator, FeatureType>::feature_generator_gramma
feature = lit("{\"type\":\"Feature\",\"id\":")
<< uint_[_1 = id_(_val)]
- << lit(",\"geometry\":") << geometry
+ << lit(",\"geometry\":") << geometry[_1 = geom_(_val)]
<< lit(",\"properties\":") << properties
<< lit('}')
;
=====================================
include/mapnik/json/geometry_generator_grammar.hpp
=====================================
@@ -2,7 +2,7 @@
*
* This file is part of Mapnik (c++ mapping toolkit)
*
- * Copyright (C) 2015 Artem Pavlenko
+ * Copyright (C) 2017 Artem Pavlenko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -26,13 +26,10 @@
// mapnik
#include <mapnik/global.hpp>
#include <mapnik/geometry.hpp>
-#include <mapnik/geometry_type.hpp>
// boost
#pragma GCC diagnostic push
#include <mapnik/warning_ignore.hpp>
#include <boost/spirit/include/karma.hpp>
-#include <boost/spirit/include/phoenix_function.hpp>
-#include <boost/fusion/adapted/std_tuple.hpp>
#include <boost/math/special_functions/trunc.hpp> // for vc++ and android whose c++11 libs lack std::trunc
#include <boost/spirit/home/karma/domain.hpp>
#pragma GCC diagnostic pop
@@ -43,18 +40,6 @@ namespace karma = boost::spirit::karma;
namespace detail {
-template <typename Geometry>
-struct get_type
-{
- using result_type = mapnik::geometry::geometry_types;
- template <typename T>
- result_type operator() (T const& geom) const
- {
- auto type = mapnik::geometry::geometry_type(geom);
- return type;
- }
-};
-
template <typename T>
struct json_coordinate_policy : karma::real_policies<T>
{
@@ -88,30 +73,28 @@ struct json_coordinate_policy : karma::real_policies<T>
template <typename OutputIterator, typename Geometry>
struct geometry_generator_grammar :
- karma::grammar<OutputIterator, Geometry const&()>
+ karma::grammar<OutputIterator, Geometry()>
{
+ using coord_type = typename Geometry::coord_type;
geometry_generator_grammar();
- karma::rule<OutputIterator, Geometry const&()> geometry;
- karma::rule<OutputIterator, karma::locals<mapnik::geometry::geometry_types>, Geometry const&() > geometry_dispatch;
- karma::rule<OutputIterator, geometry::geometry<double> const&()> point;
- karma::rule<OutputIterator, geometry::point<double> const&()> point_coord;
- karma::rule<OutputIterator, geometry::geometry<double> const&()> linestring;
- karma::rule<OutputIterator, geometry::line_string<double> const&()> linestring_coord;
- karma::rule<OutputIterator, geometry::geometry<double> const&()> polygon;
- karma::rule<OutputIterator, geometry::polygon<double> const&()> polygon_coord;
- karma::rule<OutputIterator, geometry::linear_ring<double> const&()> exterior_ring_coord;
- karma::rule<OutputIterator, geometry::polygon<double>::rings_container const&()> interior_ring_coord;
- karma::rule<OutputIterator, geometry::geometry<double> const& ()> multi_point;
- karma::rule<OutputIterator, geometry::multi_point<double> const& ()> multi_point_coord;
- karma::rule<OutputIterator, geometry::geometry<double> const& ()> multi_linestring;
- karma::rule<OutputIterator, geometry::multi_line_string<double> const& ()> multi_linestring_coord;
- karma::rule<OutputIterator, geometry::geometry<double> const& ()> multi_polygon;
- karma::rule<OutputIterator, geometry::multi_polygon<double> const& ()> multi_polygon_coord;
- karma::rule<OutputIterator, geometry::geometry<double> const& ()> geometry_collection;
- karma::rule<OutputIterator, geometry::geometry_collection<double> const& ()> geometries;
- boost::phoenix::function<detail::get_type<Geometry> > geometry_type;
- karma::real_generator<double, detail::json_coordinate_policy<double> > coordinate;
-
+ karma::rule<OutputIterator, Geometry()> geometry;
+ karma::rule<OutputIterator, geometry::point<coord_type>()> point;
+ karma::rule<OutputIterator, geometry::point<coord_type>()> point_coord;
+ karma::rule<OutputIterator, geometry::line_string<coord_type>()> linestring;
+ karma::rule<OutputIterator, geometry::line_string<coord_type>()> linestring_coord;
+ karma::rule<OutputIterator, geometry::polygon<coord_type>()> polygon;
+ karma::rule<OutputIterator, geometry::polygon<coord_type>()> polygon_coord;
+ karma::rule<OutputIterator, geometry::linear_ring<coord_type>()> linear_ring_coord;
+ karma::rule<OutputIterator, geometry::multi_point<coord_type>()> multi_point;
+ karma::rule<OutputIterator, geometry::multi_point<coord_type>()> multi_point_coord;
+ karma::rule<OutputIterator, geometry::multi_line_string<coord_type>()> multi_linestring;
+ karma::rule<OutputIterator, geometry::multi_line_string<coord_type> ()> multi_linestring_coord;
+ karma::rule<OutputIterator, geometry::multi_polygon<coord_type>()> multi_polygon;
+ karma::rule<OutputIterator, geometry::multi_polygon<coord_type>()> multi_polygon_coord;
+ karma::rule<OutputIterator, geometry::geometry_collection<coord_type>()> geometry_collection;
+ karma::rule<OutputIterator, geometry::geometry_collection<coord_type>()> geometries;
+ //
+ karma::real_generator<coord_type, detail::json_coordinate_policy<coord_type> > coordinate;
};
}}
=====================================
include/mapnik/json/geometry_generator_grammar_impl.hpp
=====================================
@@ -2,7 +2,7 @@
*
* This file is part of Mapnik (c++ mapping toolkit)
*
- * Copyright (C) 2015 Artem Pavlenko
+ * Copyright (C) 2017 Artem Pavlenko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -22,93 +22,79 @@
// mapnik
#include <mapnik/json/geometry_generator_grammar.hpp>
-#include <mapnik/util/spirit_transform_attribute.hpp>
-#include <mapnik/geometry_types.hpp>
#include <mapnik/geometry_fusion_adapted.hpp>
-// boost
-#pragma GCC diagnostic push
-#include <mapnik/warning_ignore.hpp>
-#include <boost/spirit/include/karma.hpp>
-#include <boost/spirit/include/phoenix.hpp>
-#include <boost/spirit/include/phoenix_core.hpp>
-#include <boost/spirit/include/phoenix_fusion.hpp>
-#include <boost/fusion/include/at.hpp>
-#pragma GCC diagnostic pop
-
namespace mapnik { namespace json {
namespace karma = boost::spirit::karma;
-namespace phoenix = boost::phoenix;
template <typename OutputIterator, typename Geometry>
geometry_generator_grammar<OutputIterator, Geometry>::geometry_generator_grammar()
: geometry_generator_grammar::base_type(geometry)
{
- boost::spirit::karma::_val_type _val;
- boost::spirit::karma::_1_type _1;
- boost::spirit::karma::_a_type _a;
boost::spirit::karma::lit_type lit;
- boost::spirit::karma::uint_type uint_;
- boost::spirit::karma::eps_type eps;
-
- geometry = geometry_dispatch.alias()
- ;
- geometry_dispatch = eps[_a = geometry_type(_val)] <<
- (&uint_(geometry::geometry_types::Point)[_1 = _a] << point)
+ geometry =
+ point
|
- (&uint_(geometry::geometry_types::LineString)[_1 = _a]
- << (linestring | "{\"type\":\"LineString\",\"coordinates\":[]}"))
+ linestring
|
- (&uint_(geometry::geometry_types::Polygon)[_1 = _a]
- << (polygon | "{\"type\":\"Polygon\",\"coordinates\":[[]]}"))
+ polygon
|
- (&uint_(geometry::geometry_types::MultiPoint)[_1 = _a]
- << (multi_point | "{\"type\":\"MultiPoint\",\"coordinates\":[]}"))
+ multi_point
|
- (&uint_(geometry::geometry_types::MultiLineString)[_1 = _a]
- << (multi_linestring | "{\"type\":\"MultiLineString\",\"coordinates\":[[]]}"))
+ multi_linestring
|
- (&uint_(geometry::geometry_types::MultiPolygon)[_1 = _a]
- << (multi_polygon | "{\"type\":\"MultiPolygon\",\"coordinates\":[[[]]]}"))
+ multi_polygon
|
- (&uint_(geometry::geometry_types::GeometryCollection)[_1 = _a] << geometry_collection)
+ geometry_collection
|
- lit("null")
+ lit("null") // geometry_empty
;
point = lit("{\"type\":\"Point\",\"coordinates\":") << point_coord << lit("}")
;
- linestring = lit("{\"type\":\"LineString\",\"coordinates\":[") << linestring_coord << lit("]}")
+
+ linestring = lit("{\"type\":\"LineString\",\"coordinates\":") << linestring_coord << lit("}")
;
- polygon = lit("{\"type\":\"Polygon\",\"coordinates\":[") << polygon_coord << lit("]}")
+
+ polygon = lit("{\"type\":\"Polygon\",\"coordinates\":") << polygon_coord << lit("}")
;
- multi_point = lit("{\"type\":\"MultiPoint\",\"coordinates\":[") << multi_point_coord << lit("]}")
+
+ multi_point = lit("{\"type\":\"MultiPoint\",\"coordinates\":") << multi_point_coord << lit("}")
;
- multi_linestring = lit("{\"type\":\"MultiLineString\",\"coordinates\":[") << multi_linestring_coord << lit("]}")
+
+ multi_linestring = lit("{\"type\":\"MultiLineString\",\"coordinates\":") << multi_linestring_coord << lit("}")
;
- multi_polygon = lit("{\"type\":\"MultiPolygon\",\"coordinates\":[") << multi_polygon_coord << lit("]}")
+
+ multi_polygon = lit("{\"type\":\"MultiPolygon\",\"coordinates\":") << multi_polygon_coord << lit("}")
;
+
geometry_collection = lit("{\"type\":\"GeometryCollection\",\"geometries\":[") << geometries << lit("]}")
;
+
point_coord = lit('[') << coordinate << lit(',') << coordinate << lit(']')
;
- linestring_coord = (point_coord % lit(','))
- ;
- polygon_coord = lit('[') << exterior_ring_coord << lit(']') << interior_ring_coord
+
+ linestring_coord = lit('[') << -(point_coord % lit(',')) << lit(']')
;
- exterior_ring_coord = linestring_coord.alias()
+
+ linear_ring_coord = lit('[') << -(point_coord % lit(',')) << lit(']')
;
- interior_ring_coord = *(lit(",[") << exterior_ring_coord << lit(']'))
+
+ polygon_coord = lit('[') << linear_ring_coord << *(lit(',') << linear_ring_coord)<< lit(']');
;
- multi_point_coord = linestring_coord.alias()
+
+ multi_point_coord = lit('[') << -(point_coord % lit(',')) << lit(']')
;
- multi_linestring_coord = (lit('[') << linestring_coord << lit(']')) % lit(',')
+
+ multi_linestring_coord = lit('[') << linestring_coord % lit(',') << lit(']')
;
- multi_polygon_coord = (lit('[') << polygon_coord << lit(']')) % lit(',')
+
+ multi_polygon_coord = lit('[') << polygon_coord % lit(',') << lit("]")
;
- geometries = geometry % lit(',')
+
+ geometries = geometry % lit(',')
;
}
=====================================
include/mapnik/json/properties_generator_grammar_impl.hpp
=====================================
@@ -23,6 +23,12 @@
#include <mapnik/json/properties_generator_grammar.hpp>
+#pragma GCC diagnostic push
+#include <mapnik/warning_ignore.hpp>
+#include <boost/spirit/include/phoenix.hpp>
+#include <boost/fusion/adapted/std_tuple.hpp>
+#pragma GCC diagnostic pop
+
namespace mapnik { namespace json {
namespace karma = boost::spirit::karma;
@@ -63,14 +69,13 @@ properties_generator_grammar<OutputIterator,KeyValueStore>::properties_generator
boost::spirit::karma::string_type kstring;
boost::spirit::karma::eps_type eps;
using boost::phoenix::at_c;
-
properties = lit('{')
<< -(pair % lit(','))
<< lit('}')
;
pair = lit('"')
- << kstring[_1 = boost::phoenix::at_c<0>(_val)] << lit('"')
+ << kstring[_1 = at_c<0>(_val)] << lit('"')
<< lit(':')
<< value[_1 = extract_string_(at_c<1>(_val))]
;
@@ -80,13 +85,6 @@ properties_generator_grammar<OutputIterator,KeyValueStore>::properties_generator
kstring[_1 = at_c<0>(_val)]
;
- // FIXME http://boost-spirit.com/home/articles/karma-examples/creating-your-own-generator-component-for-spirit-karma/
- //value = (value_null_| bool_ | int__ | double_ | ustring)//[_1 = value_base_(_r1)]
- // ;
- //value_null_ = kstring[_1 = "null"]
- // ;
- //ustring = escaped_string_(quote_.c_str())[_1 = utf8_(_val)]
- // ;
}
}}
=====================================
include/mapnik/svg/geometry_svg_generator.hpp
=====================================
@@ -141,7 +141,7 @@ struct coordinate_policy : karma::real_policies<T>
template <typename OutputIterator, typename Path>
struct svg_path_generator :
- karma::grammar<OutputIterator, Path const& ()>
+ karma::grammar<OutputIterator, Path()>
{
using path_type = Path;
@@ -149,12 +149,12 @@ struct svg_path_generator :
svg_path_generator();
// rules
- karma::rule<OutputIterator, path_type const& ()> svg;
- karma::rule<OutputIterator, path_type const& ()> point;
- karma::rule<OutputIterator, path_type const& ()> linestring;
- karma::rule<OutputIterator, path_type const& ()> polygon;
- karma::rule<OutputIterator, coord_type ()> svg_point;
- karma::rule<OutputIterator, path_type const& ()> svg_path;
+ karma::rule<OutputIterator, path_type()> svg;
+ karma::rule<OutputIterator, path_type()> point;
+ karma::rule<OutputIterator, path_type()> linestring;
+ karma::rule<OutputIterator, path_type()> polygon;
+ karma::rule<OutputIterator, coord_type()> svg_point;
+ karma::rule<OutputIterator, path_type()> svg_path;
// phoenix functions
phoenix::function<svg_detail::get_type<path_type> > _type;
=====================================
include/mapnik/version.hpp
=====================================
@@ -27,7 +27,7 @@
#define MAPNIK_MAJOR_VERSION 3
#define MAPNIK_MINOR_VERSION 0
-#define MAPNIK_PATCH_VERSION 22
+#define MAPNIK_PATCH_VERSION 23
#define MAPNIK_VERSION (MAPNIK_MAJOR_VERSION*100000) + (MAPNIK_MINOR_VERSION*100) + (MAPNIK_PATCH_VERSION)
=====================================
include/mapnik/wkt/wkt_generator_grammar.hpp
=====================================
@@ -2,7 +2,7 @@
*
* This file is part of Mapnik (c++ mapping toolkit)
*
- * Copyright (C) 2015 Artem Pavlenko
+ * Copyright (C) 2017 Artem Pavlenko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -26,12 +26,10 @@
// mapnik
#include <mapnik/global.hpp>
#include <mapnik/geometry.hpp>
-#include <mapnik/geometry_type.hpp>
#pragma GCC diagnostic push
#include <mapnik/warning_ignore.hpp>
#include <boost/spirit/include/karma.hpp>
-#include <boost/spirit/include/phoenix_function.hpp>
#include <boost/math/special_functions/trunc.hpp> // for vc++ and android whose c++11 libs lack std::trunc
#include <boost/spirit/home/karma/domain.hpp>
#pragma GCC diagnostic pop
@@ -39,22 +37,9 @@
namespace mapnik { namespace wkt {
namespace karma = boost::spirit::karma;
-namespace phoenix = boost::phoenix;
namespace detail {
-template <typename Geometry>
-struct get_type
-{
- using result_type = mapnik::geometry::geometry_types;
- template <typename T>
- result_type operator() (T const& geom) const
- {
- auto type = mapnik::geometry::geometry_type(geom);
- return type;
- }
-};
-
template <typename T>
struct wkt_coordinate_policy : karma::real_policies<T>
{
@@ -102,33 +87,29 @@ struct coordinate_generator<std::int64_t>
template <typename OutputIterator, typename Geometry>
struct wkt_generator_grammar :
- karma::grammar<OutputIterator, Geometry const& ()>
+ karma::grammar<OutputIterator, Geometry()>
{
- using coord_type = typename Geometry::coord_type;
+ using coordinate_type = typename Geometry::coord_type;
wkt_generator_grammar();
// rules
- karma::rule<OutputIterator, Geometry const&()> geometry;
- karma::rule<OutputIterator, karma::locals<mapnik::geometry::geometry_types>, Geometry const&() > geometry_dispatch;
- karma::rule<OutputIterator, geometry::geometry<coord_type> const&()> point;
- karma::rule<OutputIterator, geometry::point<coord_type> const&()> point_coord;
- karma::rule<OutputIterator, geometry::geometry<coord_type> const&()> linestring;
- karma::rule<OutputIterator, geometry::line_string<coord_type> const&()> linestring_coord;
- karma::rule<OutputIterator, geometry::geometry<coord_type> const&()> polygon;
- karma::rule<OutputIterator, geometry::polygon<coord_type> const&()> polygon_coord;
- karma::rule<OutputIterator, geometry::linear_ring<coord_type> const&()> exterior_ring_coord;
- karma::rule<OutputIterator, std::vector<geometry::linear_ring<coord_type> > const&()> interior_ring_coord;
- karma::rule<OutputIterator, geometry::geometry<coord_type> const& ()> multi_point;
- karma::rule<OutputIterator, geometry::multi_point<coord_type> const& ()> multi_point_coord;
- karma::rule<OutputIterator, geometry::geometry<coord_type> const& ()> multi_linestring;
- karma::rule<OutputIterator, geometry::multi_line_string<coord_type> const& ()> multi_linestring_coord;
- karma::rule<OutputIterator, geometry::geometry<coord_type> const& ()> multi_polygon;
- karma::rule<OutputIterator, geometry::multi_polygon<coord_type> const& ()> multi_polygon_coord;
- karma::rule<OutputIterator, geometry::geometry<coord_type> const& ()> geometry_collection;
- karma::rule<OutputIterator, geometry::geometry_collection<coord_type> const& ()> geometries;
- boost::phoenix::function<detail::get_type<Geometry> > geometry_type;
- karma::symbols<mapnik::geometry::geometry_types, char const*> empty;
+ karma::rule<OutputIterator, Geometry()> geometry;
+ karma::rule<OutputIterator, geometry::point<coordinate_type>()> point;
+ karma::rule<OutputIterator, geometry::point<coordinate_type>()> point_coord;
+ karma::rule<OutputIterator, geometry::line_string<coordinate_type>()> linestring;
+ karma::rule<OutputIterator, geometry::line_string<coordinate_type>()> linestring_coord;
+ karma::rule<OutputIterator, geometry::polygon<coordinate_type>()> polygon;
+ karma::rule<OutputIterator, geometry::polygon<coordinate_type>()> polygon_coord;
+ karma::rule<OutputIterator, geometry::linear_ring<coordinate_type>()> linear_ring_coord;
+ karma::rule<OutputIterator, geometry::multi_point<coordinate_type>()> multi_point;
+ karma::rule<OutputIterator, geometry::multi_point<coordinate_type>()> multi_point_coord;
+ karma::rule<OutputIterator, geometry::multi_line_string<coordinate_type>()> multi_linestring;
+ karma::rule<OutputIterator, geometry::multi_line_string<coordinate_type>()> multi_linestring_coord;
+ karma::rule<OutputIterator, geometry::multi_polygon<coordinate_type>()> multi_polygon;
+ karma::rule<OutputIterator, geometry::multi_polygon<coordinate_type>()> multi_polygon_coord;
+ karma::rule<OutputIterator, geometry::geometry_collection<coordinate_type>()> geometry_collection;
+ karma::rule<OutputIterator, geometry::geometry_collection<coordinate_type>()> geometries;
//
- typename detail::coordinate_generator<coord_type>::generator coordinate;
+ typename detail::coordinate_generator<coordinate_type>::generator coordinate;
};
}}
=====================================
include/mapnik/wkt/wkt_generator_grammar_impl.hpp
=====================================
@@ -2,7 +2,7 @@
*
* This file is part of Mapnik (c++ mapping toolkit)
*
- * Copyright (C) 2015 Artem Pavlenko
+ * Copyright (C) 2017 Artem Pavlenko
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -22,97 +22,76 @@
// mapnik
#include <mapnik/wkt/wkt_generator_grammar.hpp>
-#include <mapnik/util/spirit_transform_attribute.hpp>
#include <mapnik/geometry_fusion_adapted.hpp>
-#pragma GCC diagnostic push
-#include <mapnik/warning_ignore.hpp>
-#include <boost/spirit/include/phoenix.hpp>
-#pragma GCC diagnostic pop
-
namespace mapnik { namespace wkt {
template <typename OutputIterator, typename Geometry>
wkt_generator_grammar<OutputIterator, Geometry>::wkt_generator_grammar()
: wkt_generator_grammar::base_type(geometry)
{
- boost::spirit::karma::_val_type _val;
- boost::spirit::karma::_1_type _1;
- boost::spirit::karma::_a_type _a;
boost::spirit::karma::lit_type lit;
- boost::spirit::karma::uint_type uint_;
- boost::spirit::karma::eps_type eps;
-
- empty.add
- (geometry::geometry_types::Point, "POINT EMPTY")
- (geometry::geometry_types::LineString, "LINESTRING EMPTY")
- (geometry::geometry_types::Polygon, "POLYGON EMPTY")
- (geometry::geometry_types::MultiPoint, "MULTIPOINT EMPTY")
- (geometry::geometry_types::MultiLineString, "MULTILINESTRING EMPTY")
- (geometry::geometry_types::MultiPolygon, "MULTIPOLYGON EMPTY")
- (geometry::geometry_types::GeometryCollection, "GEOMETRYCOLLECTION EMPTY")
- ;
-
- geometry = geometry_dispatch.alias()
- ;
-
- geometry_dispatch = eps[_a = geometry_type(_val)] <<
- (&uint_(geometry::geometry_types::Point)[_1 = _a]
- << point)
+ geometry =
+ point
|
- (&uint_(geometry::geometry_types::LineString)[_1 = _a]
- << (linestring | empty[_1 = _a]))
+ linestring
|
- (&uint_(geometry::geometry_types::Polygon)[_1 = _a]
- << (polygon | empty[_1 = _a]))
+ polygon
|
- (&uint_(geometry::geometry_types::MultiPoint)[_1 = _a]
- << ( multi_point | empty[_1 = _a]))
+ multi_point
|
- (&uint_(geometry::geometry_types::MultiLineString)[_1 = _a]
- << (multi_linestring | empty[_1 = _a]))
+ multi_linestring
|
- (&uint_(geometry::geometry_types::MultiPolygon)[_1 = _a]
- << (multi_polygon | empty[_1 = _a]))
+ multi_polygon
|
- (&uint_(geometry::geometry_types::GeometryCollection)[_1 = _a]
- << (geometry_collection | empty[_1 = _a]))
+ geometry_collection
|
- (&uint_(geometry::geometry_types::Unknown)[_1 = _a]
- << lit("POINT EMPTY")) // special case for geometry_empty as mapnik::geometry::point<double> can't be empty
+ lit("POINT EMPTY FAIL") // special case for geometry_empty
;
point = lit("POINT(") << point_coord << lit(")")
;
- linestring = lit("LINESTRING(") << linestring_coord << lit(")")
+
+ linestring = lit("LINESTRING") << (linestring_coord | lit(" EMPTY"))
;
- polygon = lit("POLYGON(") << polygon_coord << lit(")")
+
+ polygon = lit("POLYGON") << (polygon_coord | lit(" EMPTY"))
;
- multi_point = lit("MULTIPOINT(") << multi_point_coord << lit(")")
+
+ multi_point = lit("MULTIPOINT") << (multi_point_coord | lit(" EMPTY"))
;
- multi_linestring = lit("MULTILINESTRING(") << multi_linestring_coord << lit(")")
+
+ multi_linestring = lit("MULTILINESTRING") << (multi_linestring_coord | lit(" EMPTY"))
;
- multi_polygon = lit("MULTIPOLYGON(") << multi_polygon_coord << lit(")")
+
+ multi_polygon = lit("MULTIPOLYGON") << (multi_polygon_coord | lit(" EMPTY"))
;
- geometry_collection = lit("GEOMETRYCOLLECTION(") << geometries << lit(")")
+
+ geometry_collection = lit("GEOMETRYCOLLECTION") << (lit("(") << geometries << lit(")") | lit(" EMPTY"))
;
+
point_coord = coordinate << lit(' ') << coordinate
;
- linestring_coord = point_coord % lit(',')
- ;
- polygon_coord = lit('(') << exterior_ring_coord << lit(')') << interior_ring_coord
+
+ linestring_coord = lit('(') << point_coord % lit(',') << lit(')')
;
- exterior_ring_coord = linestring_coord.alias()
+
+ linear_ring_coord = lit('(') << point_coord % lit(',') << lit(')')
;
- interior_ring_coord = *(lit(",(") << exterior_ring_coord << lit(')'))
+
+ polygon_coord = lit('(') << linear_ring_coord << *(lit(',') << linear_ring_coord)<< lit(')');
;
- multi_point_coord = linestring_coord.alias()
+
+ multi_point_coord = lit('(') << point_coord % lit(',') << lit(')')
;
- multi_linestring_coord = (lit('(') << linestring_coord << lit(')')) % lit(',')
+
+ multi_linestring_coord = lit("(") << linestring_coord % lit(',') << lit(")")
;
- multi_polygon_coord = (lit('(') << polygon_coord << lit(')')) % lit(',')
+
+ multi_polygon_coord = lit("(") << polygon_coord % lit(',') << lit(")")
;
- geometries = geometry % lit(',')
+
+ geometries = geometry % lit(',')
;
}
=====================================
plugins/input/gdal/gdal_featureset.cpp
=====================================
@@ -399,6 +399,25 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q)
feature->set_raster(raster);
break;
}
+ case GDT_Int32:
+ {
+ mapnik::image_gray32s image(im_width, im_height);
+ image.set(std::numeric_limits<std::int32_t>::max());
+ raster_nodata = band->GetNoDataValue(&raster_has_nodata);
+ raster_io_error = band->RasterIO(GF_Read, x_off, y_off, width, height,
+ image.data(), image.width(), image.height(),
+ GDT_Int32, 0, 0);
+ if (raster_io_error == CE_Failure)
+ {
+ throw datasource_exception(CPLGetLastErrorMsg());
+ }
+ mapnik::raster_ptr raster = std::make_shared<mapnik::raster>(feature_raster_extent, intersect, image, filter_factor);
+ // set nodata value to be used in raster colorizer
+ if (nodata_value_) raster->set_nodata(*nodata_value_);
+ else raster->set_nodata(raster_nodata);
+ feature->set_raster(raster);
+ break;
+ }
default:
case GDT_Int16:
{
=====================================
scripts/travis-command-wrapper.py
=====================================
@@ -50,10 +50,10 @@ parser.add_option("-d", "--deadline",
def check_deadline(now):
if options.deadline > 0 and options.deadline < now:
- print "\n\n*** travis-cmd-wrapper: deadline reached, shutting down ***\n\n"
+ print("\n\n*** travis-cmd-wrapper: deadline reached, shutting down ***\n\n")
sys.exit(1)
else:
- print "deadline not reached: %s > %s" % (options.deadline,now)
+ print("deadline not reached: %s > %s" % (options.deadline,now))
# Set up status alarm. When we have a deadline, we need to check more often
# and/or sooner. Sending a SIGALRM manually will also trigger a status report
@@ -95,7 +95,7 @@ try:
line = cmd.stdout.readline()
sys.stdout.write(line)
sys.stdout.flush()
- except IOError, ex:
+ except IOError as ex:
if ex.errno != errno.EINTR:
raise
finally:
=====================================
scripts/travis-common.sh
=====================================
@@ -77,33 +77,26 @@ config_override () {
configure () {
if enabled ${COVERAGE}; then
- ./configure "$@" PREFIX=${PREFIX} PGSQL2SQLITE=False SVG2PNG=False SVG_RENDERER=False \
- COVERAGE=True DEBUG=True
+ ./configure "PREFIX=$PREFIX" "CUSTOM_LDFLAGS=$LINKFLAGS" "$@" \
+ COVERAGE=True DEBUG=True \
+ PGSQL2SQLITE=False SVG2PNG=False SVG_RENDERER=False
else
- ./configure "$@" PREFIX=${PREFIX}
+ ./configure "PREFIX=$PREFIX" "CUSTOM_LDFLAGS=$LINKFLAGS" "$@"
fi
# print final config values, sorted and indented
sort -sk1,1 ./config.py | sed -e 's/^/ /'
}
coverage () {
- ./codecov -x "llvm-cov gcov" -Z
-}
-
-trigger_downstream() {
- body="{
- \"request\": {
- \"message\": \"Triggered build: Mapnik core commit ${TRAVIS_COMMIT}\",
- \"branch\":\"master\"
- }
- }
- "
-
- curl -s -X POST \
- -H "Content-Type: application/json" \
- -H "Accept: application/json" \
- -H "Travis-API-Version: 3" \
- -H "Authorization: token ${TRAVIS_TRIGGER_TOKEN}" \
- -d "$body" \
- https://api.travis-ci.org/repo/mapnik%2Fpython-mapnik/requests
+ ./codecov -Z \
+ -g "./benchmark/**" \
+ -g "./demo/**" \
+ -g "./deps/**" \
+ -g "./docs/**" \
+ -g "./fonts/**" \
+ -g "./mason_packages/**" \
+ -g "./.sconf_temp/**" \
+ -g "./scons/**" \
+ -g "./test/**" \
+ -x "${LLVM_COV:-llvm-cov} gcov >/dev/null 2>&1"
}
=====================================
src/json/mapnik_json_generator_grammar.cpp
=====================================
@@ -20,8 +20,7 @@
*
*****************************************************************************/
-#include <mapnik/geometry.hpp>
-
+#include <mapnik/geometry/boost_spirit_karma_adapter.hpp>
#include <mapnik/json/geometry_generator_grammar_impl.hpp>
#include <mapnik/json/properties_generator_grammar_impl.hpp>
#include <mapnik/json/feature_generator_grammar_impl.hpp>
=====================================
src/wkt/mapnik_wkt_generator_grammar.cpp
=====================================
@@ -20,7 +20,8 @@
*
*****************************************************************************/
-#include <mapnik/geometry.hpp>
+
+#include <mapnik/geometry/boost_spirit_karma_adapter.hpp>
#include <mapnik/wkt/wkt_generator_grammar_impl.hpp>
#include <string>
=====================================
test/unit/core/expressions_test.cpp
=====================================
@@ -143,10 +143,10 @@ TEST_CASE("expressions")
// logical
TRY_CHECK(eval(" [int] = 123 and [double] = 1.23456 && [bool] = true and [null] = null && [foo] = 'bar' ") == true);
TRY_CHECK(eval(" [int] = 456 or [foo].match('foo') || length([foo]) = 3 ") == true);
- TRY_CHECK(eval(" not true and not true ") == eval(" (not true ) and (not true ) "));
- TRY_CHECK(eval(" not true or not true ") == eval(" (not true ) or (not true ) "));
- TRY_CHECK(eval(" not false and not false ") == eval(" (not false) and (not false) "));
- TRY_CHECK(eval(" not false or not false ") == eval(" (not false) or (not false) "));
+ TRY_CHECK(eval(" not true and not true ") == false); // (not true) and (not true)
+ TRY_CHECK(eval(" not false and not true ") == false); // (not false) and (not true)
+ TRY_CHECK(eval(" not true or not false ") == true); // (not true) or (not false)
+ TRY_CHECK(eval(" not false or not false ") == true); // (not false) or (not false)
// test not/and/or precedence using combinations of "not EQ1 OP1 not EQ2 OP2 not EQ3"
TRY_CHECK(eval(" not [grass] = 'grow' and not [wind] = 'blow' and not [sky] = 'is blue' ") == false);
=====================================
utils/pgsql2sqlite/build.py
=====================================
@@ -46,7 +46,7 @@ if env['RUNTIME_LINK'] == 'static':
cmd = 'pkg-config libpq --libs --static'
try:
program_env.ParseConfig(cmd)
- except OSError, e:
+ except OSError as e:
program_env.Append(LIBS='pq')
else:
program_env.Append(LIBS='pq')
=====================================
utils/shapefile/shapefile_reader.py
=====================================
@@ -22,7 +22,7 @@ ShapeType = { 0 : "NullShape",
def test_record(_type, record) :
if _type == 0:
- print "NULL shape"
+ print("NULL shape")
elif _type == 11: #PointZ
test_pointz(record)
elif _type == 5:
@@ -31,35 +31,35 @@ def test_record(_type, record) :
def test_pointz(record):
_type, = struct.unpack("<i", record[0:4])
if _type == 0:
- print "NULL shape"
+ print("NULL shape")
return
if len(record) != 36 :
- print>>sys.stderr,"BAD SHAPE FILE: expected 36 bytes got",len(record)
+ print("BAD SHAPE FILE: expected 36 bytes got", len(record), file=sys.stderr)
sys.exit(1)
x,y,z,m = struct.unpack("<dddd",record[4:36])
if _type != 11:
- print>>sys.stderr,"BAD SHAPE FILE: expected PointZ or NullShape got",_type
+ print("BAD SHAPE FILE: expected PointZ or NullShape got", _type, file=sys.stderr)
sys.exit(1)
def test_polygon(record):
_type, = struct.unpack("<i", record[0:4])
if _type == 0:
- print "NULL shape"
+ print("NULL shape")
return
x0, y0, x1, y0, num_parts, num_points = struct.unpack("<ddddii", record[4:44])
if _type != 5:
- print>>sys.stderr, "BAD SHAPE FILE: expected Polygon or NullShape got", _type
+ print("BAD SHAPE FILE: expected Polygon or NullShape got", _type, file=sys.stderr)
sys.exit(1)
length = len(record)
rec_length = 44 + num_parts * 4 + num_points * 16
- if rec_length <> length:
- print>>sys.stderr, "BAD SHAPE FILE: expected", rec_length, "got", length
+ if rec_length != length:
+ print("BAD SHAPE FILE: expected", rec_length, "got", length, file=sys.stderr)
sys.exit(1)
if __name__ == "__main__" :
if len(sys.argv) !=2:
- print>>sys.stderr, "Usage:",sys.argv[0],"<shapefile>"
+ print("Usage:",sys.argv[0],"<shapefile>", file=sys.stderr)
sys.exit(1)
shx_filename = sys.argv[1][:-3]+"shx"
@@ -80,15 +80,15 @@ if __name__ == "__main__" :
version,_type,lox,loy,hix,hiy,_,_,_,_ = header[1].unpack_from(shp.read(72))
shp_bbox = [lox,loy,hix,hiy]
- if shx_bbox <> shp_bbox :
- print "BAD SHAPE FILE: bounding box mismatch in *.shp and *.shx", shp_bbox, shx_bbox
+ if shx_bbox != shp_bbox :
+ print("BAD SHAPE FILE: bounding box mismatch in *.shp and *.shx", shp_bbox, shx_bbox)
sys.exit(1)
- print "SHX FILE_LENGTH=",shx_file_length,"bytes"
- print "SHP FILE_LENGTH=",shp_file_length,"bytes"
+ print("SHX FILE_LENGTH=",shx_file_length,"bytes")
+ print("SHP FILE_LENGTH=",shp_file_length,"bytes")
- print "TYPE", ShapeType[_type]
- print "BBOX(",lox,loy,hix,hiy,")"
+ print("TYPE", ShapeType[_type])
+ print("BBOX(",lox,loy,hix,hiy,")")
record_header = struct.Struct(">II")
record = struct.Struct(">II")
calc_total_size = 50
@@ -97,19 +97,19 @@ if __name__ == "__main__" :
offset,shx_content_length = record.unpack_from(shx.read(8))
shp.seek(offset*2, os.SEEK_SET)
record_number,content_length = record_header.unpack_from(shp.read(8))
- if shx_content_length <> content_length:
- print "BAD SHAPE FILE: content_lenght mismatch in SHP and SHX",shx_content_length,content_length
+ if shx_content_length != content_length:
+ print("BAD SHAPE FILE: content_lenght mismatch in SHP and SHX",shx_content_length,content_length)
sys.exit(1)
##
test_record(_type, shp.read(2*content_length))
calc_total_size +=(4 + content_length)
count+=1
- print "SHAPES COUNT=",count
+ print("SHAPES COUNT=",count)
delta = shp_file_length-calc_total_size
if delta > 0 :
- print "BAD SHAPE FILE: extra ", 2*delta,"bytes"
+ print("BAD SHAPE FILE: extra ", 2*delta,"bytes")
elif delta < 0:
- print "BAD SHAPE FILE: missing ", 2*delta,"bytes"
+ print("BAD SHAPE FILE: missing ", 2*delta,"bytes")
else:
- print "SHAPE FILE LOOKS GOOD!"
+ print("SHAPE FILE LOOKS GOOD!")
View it on GitLab: https://salsa.debian.org/debian-gis-team/mapnik/compare/9da4feb68d836b9df4f95e71cf5469326fd91d7b...ae99fe079a4d2fec916d4405b639803adaade2ca
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/mapnik/compare/9da4feb68d836b9df4f95e71cf5469326fd91d7b...ae99fe079a4d2fec916d4405b639803adaade2ca
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20200218/e125e364/attachment-0001.html>
More information about the Pkg-grass-devel
mailing list