[mapnik] 01/05: Imported Upstream version 3.0.12~rc7+ds

Bas Couwenberg sebastic at debian.org
Tue Sep 6 09:54:43 UTC 2016


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository mapnik.

commit a414f194ea88b5e34394f720b4a45613214b58f7
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Tue Sep 6 11:09:01 2016 +0200

    Imported Upstream version 3.0.12~rc7+ds
---
 .travis.yml                                        |  21 ++--
 Makefile                                           |  26 ++---
 appveyor.yml                                       |   8 +-
 bootstrap.sh                                       |  35 +++----
 circle.yml                                         |   2 +-
 include/mapnik/image_view_any.hpp                  |   4 +-
 .../json/extract_bounding_box_grammar_impl.hpp     |  22 -----
 include/mapnik/json/feature_grammar_impl.hpp       |  25 -----
 include/mapnik/json/generic_json.hpp               |   5 +-
 include/mapnik/json/geometry_grammar_impl.hpp      |  25 -----
 include/mapnik/json/positions_grammar.hpp          |   3 +-
 include/mapnik/json/topojson_grammar_impl.hpp      |  24 -----
 include/mapnik/raster_colorizer.hpp                |   4 +-
 include/mapnik/value.hpp                           |   1 +
 include/mapnik/warning_ignore.hpp                  |   3 +-
 mason_latest.sh                                    |   4 +-
 plugins/input/geojson/geojson_datasource.cpp       |  31 ++----
 plugins/input/geojson/geojson_datasource.hpp       |   2 +-
 plugins/input/topojson/topojson_datasource.cpp     |  12 ++-
 scripts/ensure_test_data.sh                        |  19 ++++
 scripts/publish_release.sh                         |  35 +++++++
 scripts/travis-command-wrapper.py                  | 106 +++++++++++++++++++++
 .../json/generic_json.cpp                          |  59 +++++++-----
 src/json/mapnik_topojson_grammar.cpp               |   2 +-
 src/memory_datasource.cpp                          |   8 ++
 .../unit/datasource/memory.cpp                     |  28 +++++-
 test/unit/datasource/topojson.cpp                  |   6 +-
 utils/mapnik-config/build.py                       |  10 +-
 28 files changed, 311 insertions(+), 219 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index c16bfa3..2e54ffb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,4 @@
-language: cpp
+language: generic
 
 git:
   depth: 10
@@ -25,24 +25,24 @@ matrix:
     - os: linux
       sudo: false
       compiler: ": clang"
-      env: JOBS=8 MASON_PUBLISH=true _CXX="ccache clang++-3.8 -Qunused-arguments" _CC="clang-3.8" TRIGGER=true
+      env: JOBS=8 MASON_PUBLISH=true CXX="ccache clang++-3.8 -Qunused-arguments" CC="clang-3.8" TRIGGER=true
       addons:
         apt:
           sources: [ 'ubuntu-toolchain-r-test']
-          packages: [ 'libstdc++-5-dev', 'xutils']
+          packages: [ 'libstdc++-5-dev', 'xutils-dev']
     - os: linux
       sudo: false
       compiler: ": clang-coverage"
-      env: JOBS=8 COVERAGE=true _CXX="ccache clang++-3.8 -Qunused-arguments" _CC="clang-3.8"
+      env: JOBS=8 COVERAGE=true CXX="ccache clang++-3.8 -Qunused-arguments" CC="clang-3.8"
       addons:
         apt:
           sources: [ 'ubuntu-toolchain-r-test']
-          packages: ['libstdc++-5-dev', 'xutils' ]
+          packages: ['libstdc++-5-dev', 'xutils-dev' ]
     - os: osx
       compiler: ": clang-osx"
       # 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 MASON_PUBLISH=true _CXX="ccache clang++ -Qunused-arguments"
+      env: JOBS=4 MASON_PUBLISH=true CXX="ccache clang++ -Qunused-arguments"
 
 before_install:
  # workaround travis rvm bug
@@ -51,8 +51,6 @@ before_install:
    if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
      rvm get head || true
    fi
- - if [[ ${_CXX:-false} != false ]]; then export CXX=${_CXX}; fi
- - if [[ ${_CC:-false} != false ]]; then export CC=${_CC}; fi
  - source scripts/travis-common.sh
  - export PYTHONUSERBASE=$(pwd)/mason_packages/.link
  - export PATH=${PREFIX}/bin:$(pwd)/mason_packages/.link/bin:${PYTHONUSERBASE}/bin:${PATH}
@@ -94,7 +92,12 @@ script:
  - export SCONSFLAGS='--debug=time'
  - configure BENCHMARK=${BENCH}
  - cat config.log
- - make
+ # we limit the `make` to 35 min
+ # to ensure that slow builds still upload their
+ # ccache results and therefore should be faster
+ # (and might work) for the next build
+ - DURATION=2100
+ - scripts/travis-command-wrapper.py -s "date" -i 120 --deadline=$(( $(date +%s) + ${DURATION} )) make
  - make test
  - enabled ${COVERAGE} coverage
  - enabled ${BENCH} make bench
diff --git a/Makefile b/Makefile
index fd3a2ad..910951d 100755
--- a/Makefile
+++ b/Makefile
@@ -17,24 +17,7 @@ install:
 	$(PYTHON) scons/scons.py -j$(JOBS) --config=cache --implicit-cache --max-drift=1 install
 
 release:
-	export MAPNIK_VERSION=$(shell ./utils/mapnik-config/mapnik-config --version) && \
-	export TARBALL_NAME="mapnik-v$${MAPNIK_VERSION}" && \
-	cd /tmp/ && \
-	rm -rf $${TARBALL_NAME} && \
-	git clone --depth 1 --branch v$${MAPNIK_VERSION} git at github.com:mapnik/mapnik.git $${TARBALL_NAME} && \
-	cd $${TARBALL_NAME} && \
-	git checkout "tags/v$${MAPNIK_VERSION}" && \
-	git submodule update --depth 100 --init && \
-	rm -rf deps/mapbox/variant/.git && \
-	rm -rf test/data/.git && \
-	rm -rf test/data/.gitignore && \
-	rm -rf test/data-visual/.git && \
-	rm -rf test/data-visual/.gitignore && \
-	rm -rf .git && \
-	rm -rf .gitignore && \
-	cd ../ && \
-	tar cjf $${TARBALL_NAME}.tar.bz2 $${TARBALL_NAME}/ && \
-	aws s3 cp --acl public-read $${TARBALL_NAME}.tar.bz2 s3://mapnik/dist/v$${MAPNIK_VERSION}/
+	./scripts/publish_release.sh
 
 python:
 	if [ ! -d ./bindings/python ]; then git clone git at github.com:mapnik/python-mapnik.git --recursive ./bindings/python; else (cd bindings/python && git pull && git submodule update --init); fi;
@@ -95,10 +78,13 @@ rebuild:
 uninstall:
 	@$(PYTHON) scons/scons.py -j$(JOBS) --config=cache --implicit-cache --max-drift=1 uninstall
 
+test/data-visual:
+	./scripts/ensure_test_data.sh
+
 test/data:
-	git submodule update --init
+	./scripts/ensure_test_data.sh
 
-test: ./test/data
+test: ./test/data test/data-visual
 	@./test/run
 
 check: test
diff --git a/appveyor.yml b/appveyor.yml
index 34ddc3b..d4450d7 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,6 +1,6 @@
 environment:
   msvs_toolset: 14
-  BOOST_VERSION: 60
+  BOOST_VERSION: 61
   FASTBUILD: 1
   matrix:
     - platform: x64
@@ -24,7 +24,7 @@ build_script:
   - scripts\build-appveyor.bat
 
 after_build:
-  - 7z a mapnik-visual-images.zip C:\tmp\mapnik-visual-images
+  - 7z a visual-test-results.zip C:\tmp\mapnik-visual-images\visual-test-results
 
 artifacts:
   - path: mapnik-gyp\msbuild-summary.txt
@@ -33,8 +33,8 @@ artifacts:
     name: msbuild-errors.txt
   - path: mapnik-gyp\msbuild-warnings.txt
     name: msbuild-warnings.txt
-  - path: mapnik-visual-images.zip
-    name: mapnik-visual-images.zip
+  - path: visual-test-results.zip
+    name: visual-test-results.zip
 
 test: off
 deploy: off
diff --git a/bootstrap.sh b/bootstrap.sh
index 113d60f..e926c26 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -11,7 +11,7 @@ todo
 - shrink icu data
 '
 
-MASON_VERSION="7ed8931"
+MASON_VERSION="new-pkgs"
 
 function setup_mason() {
     if [[ ! -d ./.mason ]]; then
@@ -19,7 +19,7 @@ function setup_mason() {
         (cd ./.mason && git checkout ${MASON_VERSION})
     else
         echo "Updating to latest mason"
-        (cd ./.mason && git fetch && git checkout ${MASON_VERSION})
+        (cd ./.mason && git fetch && git checkout ${MASON_VERSION} && git pull)
     fi
     export PATH=$(pwd)/.mason:$PATH
     export CXX=${CXX:-clang++}
@@ -39,6 +39,8 @@ function install() {
             fi
         fi
     fi
+    # the rm here is to workaround https://github.com/mapbox/mason/issues/230
+    rm -f ./mason_packages/.link/mason.ini
     mason link $1 $2
 }
 
@@ -46,22 +48,23 @@ ICU_VERSION="55.1"
 
 function install_mason_deps() {
     FAIL=0
-    install ccache 3.2.4 &
-    install jpeg_turbo 1.4.0 libjpeg &
-    install libpng 1.6.20 libpng &
-    install libtiff 4.0.4beta libtiff &
-    install libpq 9.4.1 &
-    install sqlite 3.8.8.3 libsqlite3 &
-    install expat 2.1.0 libexpat &
+    install ccache 3.3.0 &
+    install zlib system &
+    install jpeg_turbo 1.5.0 libjpeg &
+    install libpng 1.6.24 libpng &
+    install libtiff 4.0.6 libtiff &
+    install libpq 9.5.2 &
+    install sqlite 3.14.1 libsqlite3 &
+    install expat 2.2.0 libexpat &
     install icu ${ICU_VERSION} &
-    install proj 4.8.0 libproj &
-    install pixman 0.32.6 libpixman-1 &
-    install cairo 1.14.2 libcairo &
+    install proj 4.9.2 libproj &
+    install pixman 0.34.0 libpixman-1 &
+    install cairo 1.14.6 libcairo &
     install protobuf 2.6.1 &
     # technically protobuf is not a mapnik core dep, but installing
     # here by default helps make mapnik-vector-tile builds easier
-    install webp 0.5.0 libwebp &
-    install gdal 1.11.2 libgdal &
+    install webp 0.5.1 libwebp &
+    install gdal 2.1.1 libgdal &
     install boost 1.61.0 &
     install boost_libsystem 1.61.0 &
     install boost_libfilesystem 1.61.0 &
@@ -71,8 +74,8 @@ function install_mason_deps() {
     # here by default helps make python-mapnik builds easier
     install boost_libthread 1.61.0 &
     install boost_libpython 1.61.0 &
-    install freetype 2.6 libfreetype &
-    install harfbuzz 0.9.41 libharfbuzz &
+    install freetype 2.6.5 libfreetype &
+    install harfbuzz 1.3.0 libharfbuzz &
     for job in $(jobs -p)
     do
         wait $job || let "FAIL+=1"
diff --git a/circle.yml b/circle.yml
index 435cd07..d9d4bad 100644
--- a/circle.yml
+++ b/circle.yml
@@ -27,7 +27,7 @@ dependencies:
     - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
   override:
     - sudo apt-get update -y
-    - sudo apt-get install -y libstdc++-5-dev xutils
+    - sudo apt-get install -y libstdc++-5-dev xutils-dev
 
 database:
   pre:
diff --git a/include/mapnik/image_view_any.hpp b/include/mapnik/image_view_any.hpp
index 23c9779..a5452df 100644
--- a/include/mapnik/image_view_any.hpp
+++ b/include/mapnik/image_view_any.hpp
@@ -47,9 +47,9 @@ struct MAPNIK_DECL image_view_any : image_view_base
     image_view_any() = default;
 
     template <typename T>
-    image_view_any(T && data)
+    image_view_any(T && _data)
         noexcept(std::is_nothrow_constructible<image_view_base, T && >::value)
-        : image_view_base(std::forward<T>(data)) {}
+        : image_view_base(std::forward<T>(_data)) {}
 
     std::size_t width() const;
     std::size_t height() const;
diff --git a/include/mapnik/json/extract_bounding_box_grammar_impl.hpp b/include/mapnik/json/extract_bounding_box_grammar_impl.hpp
index 25ddbcd..bdc1b98 100644
--- a/include/mapnik/json/extract_bounding_box_grammar_impl.hpp
+++ b/include/mapnik/json/extract_bounding_box_grammar_impl.hpp
@@ -144,28 +144,6 @@ extract_bounding_box_grammar<Iterator, Boxes, ErrorHandler>::extract_bounding_bo
     rings_array = lit('[') >> rings(_r1) % lit(',') > lit(']')
         ;
 
-    // generic json types
-    json.value = json.object | json.array | json.string_ | json.number
-        ;
-
-    json.key_value = json.string_ >> lit(':') >> json.value
-        ;
-
-    json.object = lit('{') >>  json.key_value % lit(',') >> lit('}')
-        ;
-
-    json.array = lit('[')
-        >> json.value >> *(lit(',') >> json.value)
-        >> lit(']')
-        ;
-
-    json.number = json.strict_double
-        | json.int__
-        | lit("true")
-        | lit("false")
-        | lit("null")
-        ;
-
     coords.name("Coordinates");
     pos.name("Position");
     ring.name("Ring");
diff --git a/include/mapnik/json/feature_grammar_impl.hpp b/include/mapnik/json/feature_grammar_impl.hpp
index 0fc4205..88f72ff 100644
--- a/include/mapnik/json/feature_grammar_impl.hpp
+++ b/include/mapnik/json/feature_grammar_impl.hpp
@@ -35,7 +35,6 @@ feature_grammar<Iterator,FeatureType,ErrorHandler>::feature_grammar(mapnik::tran
     qi::lit_type lit;
     qi::long_long_type long_long;
     qi::double_type double_;
-    qi::_val_type _val;
     qi::_1_type _1;
     qi::_2_type _2;
     qi::_3_type _3;
@@ -49,30 +48,6 @@ feature_grammar<Iterator,FeatureType,ErrorHandler>::feature_grammar(mapnik::tran
     using phoenix::new_;
     using phoenix::construct;
 
-    // generic json types
-    json_.value = json_.object | json_.array | json_.string_ | json_.number
-        ;
-
-    json_.key_value = json_.string_ > lit(':') > json_.value
-        ;
-
-    json_.object = lit('{')
-        > -(json_.key_value % lit(','))
-        > lit('}')
-        ;
-
-    json_.array = lit('[')
-        > -(json_.value % lit(','))
-        > lit(']')
-        ;
-
-    json_.number = json_.strict_double[_val = json_.double_converter(_1)]
-        | json_.int__[_val = json_.integer_converter(_1)]
-        | lit("true") [_val = true]
-        | lit ("false") [_val = false]
-        | lit("null")[_val = construct<value_null>()]
-        ;
-
     // geojson types
     feature_type = lit("\"type\"") > lit(':') > lit("\"Feature\"")
         ;
diff --git a/include/mapnik/json/generic_json.hpp b/include/mapnik/json/generic_json.hpp
index 7ea1bc0..65c04c4 100644
--- a/include/mapnik/json/generic_json.hpp
+++ b/include/mapnik/json/generic_json.hpp
@@ -129,7 +129,7 @@ struct push_esc
     }
 };
 
-template< typename Iterator >
+template< typename Iterator>
 unicode_string<Iterator>::unicode_string()
     : unicode_string::base_type(double_quoted)
 {
@@ -175,8 +175,9 @@ unicode_string<Iterator>::unicode_string()
 }
 
 template <typename Iterator>
-struct generic_json
+struct generic_json : qi::grammar<Iterator, json_value(), space_type>
 {
+    generic_json();
     qi::rule<Iterator, json_value(), space_type> value;
     qi::int_parser<mapnik::value_integer, 10, 1, -1> int__;
     unicode_string<Iterator> string_;
diff --git a/include/mapnik/json/geometry_grammar_impl.hpp b/include/mapnik/json/geometry_grammar_impl.hpp
index 285be27..29ea846 100644
--- a/include/mapnik/json/geometry_grammar_impl.hpp
+++ b/include/mapnik/json/geometry_grammar_impl.hpp
@@ -52,31 +52,6 @@ geometry_grammar<Iterator, ErrorHandler>::geometry_grammar()
     using phoenix::push_back;
 
     start = geometry.alias() | lit("null");
-
-    // generic json types
-    json_.value =  json_.object | json_.array | json_.string_ | json_.number
-        ;
-
-    json_.key_value = json_.string_ > lit(':') > json_.value
-        ;
-
-    json_.object = lit('{')
-        > -(json_.key_value % lit(','))
-        > lit('}')
-        ;
-
-    json_.array = lit('[')
-        > -(json_.value % lit(','))
-        > lit(']')
-        ;
-
-    json_.number = json_.strict_double
-        | json_.int__
-        | lit("true")
-        | lit ("false")
-        | lit("null")
-        ;
-
     geometry = lit('{')[_a = 0]
         > (((lit("\"type\"") > lit(':') > geometry_type_dispatch[_a = _1])
             |
diff --git a/include/mapnik/json/positions_grammar.hpp b/include/mapnik/json/positions_grammar.hpp
index 75a6b21..016ecb2 100644
--- a/include/mapnik/json/positions_grammar.hpp
+++ b/include/mapnik/json/positions_grammar.hpp
@@ -26,7 +26,6 @@
 // mapnik
 #include <mapnik/util/variant.hpp>
 #include <mapnik/json/positions.hpp>
-#include <mapnik/json/generic_json.hpp>
 #include <mapnik/json/error_handler.hpp>
 #include <mapnik/geometry.hpp>
 #pragma GCC diagnostic push
@@ -38,6 +37,8 @@
 namespace mapnik { namespace json {
 
 namespace qi = boost::spirit::qi;
+namespace standard = boost::spirit::standard;
+using space_type = standard::space_type;
 
 template <typename Iterator, typename ErrorHandler = error_handler<Iterator> >
 struct positions_grammar :
diff --git a/include/mapnik/json/topojson_grammar_impl.hpp b/include/mapnik/json/topojson_grammar_impl.hpp
index f868cef..07b3a97 100644
--- a/include/mapnik/json/topojson_grammar_impl.hpp
+++ b/include/mapnik/json/topojson_grammar_impl.hpp
@@ -94,7 +94,6 @@ topojson_grammar<Iterator, ErrorHandler>::topojson_grammar()
     using qi::fail;
     using qi::on_error;
     using phoenix::push_back;
-    using phoenix::construct;
 
     geometry_type_dispatch.add
         ("\"Point\"",1)
@@ -109,29 +108,6 @@ topojson_grammar<Iterator, ErrorHandler>::topojson_grammar()
     // error handler
     boost::phoenix::function<ErrorHandler> const error_handler;
     boost::phoenix::function<create_geometry_impl> const create_geometry;
-    // generic JSON types
-    json.value = json.object | json.array | json.string_ | json.number
-        ;
-
-    json.key_value = json.string_ > lit(':') > json.value
-        ;
-
-    json.object = lit('{')
-        > -(json.key_value % lit(','))
-        > lit('}')
-        ;
-
-    json.array = lit('[')
-        > -(json.value % lit(','))
-        > lit(']')
-        ;
-
-    json.number = json.strict_double[_val = json.double_converter(_1)]
-        | json.int__[_val = json.integer_converter(_1)]
-        | lit("true")[_val = true]
-        | lit("false")[_val = false]
-        | lit("null")[_val = construct<value_null>()]
-        ;
 
     // topo json
     topology = lit('{') >> lit("\"type\"") >> lit(':') >> lit("\"Topology\"")
diff --git a/include/mapnik/raster_colorizer.hpp b/include/mapnik/raster_colorizer.hpp
index 86a85de..6905497 100644
--- a/include/mapnik/raster_colorizer.hpp
+++ b/include/mapnik/raster_colorizer.hpp
@@ -93,7 +93,7 @@ public:
 
     //! \brief Set the stop value
     //! \param[in] value The stop value
-    inline void set_value(float value) { value_ = value; }
+    inline void set_value(float v) { value_ = v; }
 
     //! \brief Get the stop value
     //! \return The stop value
@@ -205,7 +205,7 @@ public:
     //!
     //! \param[in] value Input value
     //! \return color associated with the value
-    unsigned get_color(float value) const;
+    unsigned get_color(float v) const;
 
 
     //! \brief Set the epsilon value for exact mode
diff --git a/include/mapnik/value.hpp b/include/mapnik/value.hpp
index 3bd59b4..9ee7323 100644
--- a/include/mapnik/value.hpp
+++ b/include/mapnik/value.hpp
@@ -149,6 +149,7 @@ namespace std
 {
 
 #pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpragmas"
 #pragma GCC diagnostic ignored "-Wmismatched-tags"
 
 template <>
diff --git a/include/mapnik/warning_ignore.hpp b/include/mapnik/warning_ignore.hpp
index 95249b8..6be432f 100644
--- a/include/mapnik/warning_ignore.hpp
+++ b/include/mapnik/warning_ignore.hpp
@@ -28,7 +28,8 @@
 #pragma GCC diagnostic ignored "-Wunused-function"
 #pragma GCC diagnostic ignored "-Wunused-parameter"
 #pragma GCC diagnostic ignored "-Wredeclared-class-member"
-#pragma GCC diagnostic ignored "-Wunused-local-typedef" 
+#pragma GCC diagnostic ignored "-Wunused-local-typedef"
+#pragma GCC diagnostic ignored "-Wunused-local-typedefs" // gcc5
 #pragma GCC diagnostic ignored "-Wshadow"
 #pragma GCC diagnostic ignored "-Wc++11-narrowing"
 #pragma GCC diagnostic ignored "-Wsign-conversion"
diff --git a/mason_latest.sh b/mason_latest.sh
index d5db696..cf06495 100755
--- a/mason_latest.sh
+++ b/mason_latest.sh
@@ -53,11 +53,11 @@ function mason_compile {
 }
 
 function mason_cflags {
-    ""
+    :
 }
 
 function mason_ldflags {
-    ""
+    :
 }
 
 function mason_clean {
diff --git a/plugins/input/geojson/geojson_datasource.cpp b/plugins/input/geojson/geojson_datasource.cpp
index 9027087..2709c53 100644
--- a/plugins/input/geojson/geojson_datasource.cpp
+++ b/plugins/input/geojson/geojson_datasource.cpp
@@ -113,18 +113,14 @@ geojson_datasource::geojson_datasource(parameters const& params)
     desc_(geojson_datasource::name(),
           *params.get<std::string>("encoding","utf-8")),
     filename_(),
-    inline_string_(),
+    from_inline_string_(false),
     extent_(),
     features_(),
     tree_(nullptr),
     num_features_to_query_(*params.get<mapnik::value_integer>("num_features_to_query",5))
 {
     boost::optional<std::string> inline_string = params.get<std::string>("inline");
-    if (inline_string)
-    {
-        inline_string_ = *inline_string;
-    }
-    else
+    if (!inline_string)
     {
         boost::optional<std::string> file = params.get<std::string>("file");
         if (!file) throw mapnik::datasource_exception("GeoJSON Plugin: missing <file> parameter");
@@ -137,10 +133,11 @@ geojson_datasource::geojson_datasource(parameters const& params)
         has_disk_index_ = mapnik::util::exists(filename_ + ".index");
     }
 
-    if (!inline_string_.empty())
+    if (inline_string)
     {
-        char const* start = inline_string_.c_str();
-        char const* end = start + inline_string_.size();
+        from_inline_string_ = true;
+        char const* start = inline_string->c_str();
+        char const* end = start + inline_string->size();
         parse_geojson(start, end);
     }
     else if (has_disk_index_)
@@ -162,14 +159,6 @@ geojson_datasource::geojson_datasource(parameters const& params)
         std::fread(&file_buffer[0], file.size(), 1, file.get());
         char const* start = file_buffer.c_str();
         char const* end = start + file_buffer.length();
-        if (cache_features_)
-        {
-            parse_geojson(start, end);
-        }
-        else
-        {
-            initialise_index(start, end);
-        }
 #else
         boost::optional<mapnik::mapped_region_ptr> mapped_region =
             mapnik::mapped_memory_cache::instance().find(filename_, false);
@@ -180,6 +169,7 @@ geojson_datasource::geojson_datasource(parameters const& params)
 
         char const* start = reinterpret_cast<char const*>((*mapped_region)->get_address());
         char const* end = start + (*mapped_region)->get_size();
+#endif
         if (cache_features_)
         {
             parse_geojson(start, end);
@@ -188,7 +178,6 @@ geojson_datasource::geojson_datasource(parameters const& params)
         {
             initialise_index(start, end);
         }
-#endif
     }
 }
 
@@ -276,7 +265,7 @@ void geojson_datasource::initialise_index(Iterator start, Iterator end)
                                                  space);
         if (!result || itr != end)
         {
-            if (!inline_string_.empty()) throw mapnik::datasource_exception("geojson_datasource: Failed to parse GeoJSON file from in-memory string");
+            if (from_inline_string_) throw mapnik::datasource_exception("geojson_datasource: Failed to parse GeoJSON file from in-memory string");
             else throw mapnik::datasource_exception("geojson_datasource: Failed to parse GeoJSON file '" + filename_ + "'");
         }
 
@@ -368,7 +357,7 @@ void geojson_datasource::parse_geojson(Iterator start, Iterator end)
                                                      space);
             if (!result || itr != end)
             {
-                if (!inline_string_.empty()) throw mapnik::datasource_exception("geojson_datasource: Failed parse GeoJSON file from in-memory string");
+                if (from_inline_string_) throw mapnik::datasource_exception("geojson_datasource: Failed parse GeoJSON file from in-memory string");
                 else throw mapnik::datasource_exception("geojson_datasource: Failed parse GeoJSON file '" + filename_ + "'");
             }
         }
@@ -382,7 +371,7 @@ void geojson_datasource::parse_geojson(Iterator start, Iterator end)
                                                       space);
         if (!result || itr != end)
         {
-            if (!inline_string_.empty()) throw mapnik::datasource_exception("geojson_datasource: Failed parse GeoJSON file from in-memory string");
+            if (from_inline_string_) throw mapnik::datasource_exception("geojson_datasource: Failed parse GeoJSON file from in-memory string");
             else throw mapnik::datasource_exception("geojson_datasource: Failed parse GeoJSON file '" + filename_ + "'");
         }
     }
diff --git a/plugins/input/geojson/geojson_datasource.hpp b/plugins/input/geojson/geojson_datasource.hpp
index 5ba36a6..e295cb1 100644
--- a/plugins/input/geojson/geojson_datasource.hpp
+++ b/plugins/input/geojson/geojson_datasource.hpp
@@ -98,7 +98,7 @@ private:
     mapnik::datasource::datasource_t type_;
     mapnik::layer_descriptor desc_;
     std::string filename_;
-    std::string inline_string_;
+    bool from_inline_string_;
     mapnik::box2d<double> extent_;
     std::vector<mapnik::feature_ptr> features_;
     std::unique_ptr<spatial_index_type> tree_;
diff --git a/plugins/input/topojson/topojson_datasource.cpp b/plugins/input/topojson/topojson_datasource.cpp
index 2cfad1f..67bae44 100644
--- a/plugins/input/topojson/topojson_datasource.cpp
+++ b/plugins/input/topojson/topojson_datasource.cpp
@@ -160,7 +160,7 @@ topojson_datasource::topojson_datasource(parameters const& params)
     }
     if (!inline_string_.empty())
     {
-        parse_topojson(inline_string_);
+        parse_topojson(inline_string_.c_str());
     }
     else
     {
@@ -172,20 +172,22 @@ topojson_datasource::topojson_datasource(parameters const& params)
         std::string file_buffer;
         file_buffer.resize(file.size());
         std::fread(&file_buffer[0], file.size(), 1, file.get());
-        parse_topojson(file_buffer);
+        parse_topojson(file_buffer.c_str());
     }
 }
 
 namespace {
-using base_iterator_type = std::string::const_iterator;
-const mapnik::topojson::topojson_grammar<base_iterator_type> g;
+using iterator_type = const char*;
+const mapnik::topojson::topojson_grammar<iterator_type> g;
 }
 
 template <typename T>
 void topojson_datasource::parse_topojson(T const& buffer)
 {
     boost::spirit::standard::space_type space;
-    bool result = boost::spirit::qi::phrase_parse(buffer.begin(), buffer.end(), g, space, topo_);
+    auto itr = buffer;
+    auto end = buffer + std::strlen(buffer);
+    bool result = boost::spirit::qi::phrase_parse(itr, end, g, space, topo_);
     if (!result)
     {
         throw mapnik::datasource_exception("topojson_datasource: Failed parse TopoJSON file '" + filename_ + "'");
diff --git a/scripts/ensure_test_data.sh b/scripts/ensure_test_data.sh
new file mode 100755
index 0000000..288dcd8
--- /dev/null
+++ b/scripts/ensure_test_data.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+
+set -eu
+set -o pipefail
+
+VERSION=$(git describe)
+
+if [[ -d .git ]]; then
+    git submodule update --init
+else
+    if [[ ! -d ./test/data-visual ]]; then
+        echo "Downloading visual test data from https://github.com/mapnik/test-data-visual/archive/${VERSION}.tar.gz"
+        curl -L -s https://github.com/mapnik/test-data-visual/archive/${VERSION}.tar.gz | tar zxf - --strip-components=1 -C test/data-visual/
+    fi
+    if [[ ! -d ./test/data ]]; then
+        echo "Downloading unit test data from https://github.com/mapnik/test-data/archive/${VERSION}.tar.gz"
+        curl -L -s https://github.com/mapnik/test-data/archive/${VERSION}.tar.gz | tar zxf - --strip-components=1 -C test/data/
+    fi
+fi
\ No newline at end of file
diff --git a/scripts/publish_release.sh b/scripts/publish_release.sh
new file mode 100755
index 0000000..b881c2a
--- /dev/null
+++ b/scripts/publish_release.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+
+set -eu
+set -o pipefail
+
+# for normal release leave empty
+# for release candidate, add "-rcN"
+export MAPNIK_VERSION=$(git describe)
+export TARBALL_NAME="mapnik-v${MAPNIK_VERSION}"
+cd /tmp/
+rm -rf ${TARBALL_NAME}
+echo "Cloning v${MAPNIK_VERSION}"
+git clone --depth 1 --branch v${MAPNIK_VERSION} git at github.com:mapnik/mapnik.git ${TARBALL_NAME}
+cd ${TARBALL_NAME}
+git checkout "tags/v${MAPNIK_VERSION}"
+echo "updating submodules"
+git submodule update --depth 100 --init
+rm -rf deps/mapbox/variant/.git
+cd test/data/
+git remote set-url origin git at github.com:mapnik/test-data
+git tag v${MAPNIK_VERSION} -a -m "tagging for v${MAPNIK_VERSION}"
+git push --tags
+cd ../../
+rm -rf test/data/
+cd test/data-visual/
+git remote set-url origin git at github.com:mapnik/test-data-visual
+git tag v${MAPNIK_VERSION} -a -m "tagging for v${MAPNIK_VERSION}"
+git push --tags
+cd ../../
+rm -rf test/data-visual/
+rm -rf .git
+rm -rf .gitignore
+cd ../
+tar cjf ${TARBALL_NAME}.tar.bz2 ${TARBALL_NAME}/
+#aws s3 cp --acl public-read ${TARBALL_NAME}.tar.bz2 s3://mapnik/dist/v${MAPNIK_VERSION}/
diff --git a/scripts/travis-command-wrapper.py b/scripts/travis-command-wrapper.py
new file mode 100755
index 0000000..2fdf8dc
--- /dev/null
+++ b/scripts/travis-command-wrapper.py
@@ -0,0 +1,106 @@
+#!/usr/bin/python
+#
+# Author:       Patrick Ohly <patrick.ohly at intel.com>
+# Copyright:    Copyright (C) 2015 Intel Corporation
+#
+# This file is licensed under the MIT license, see COPYING.MIT in
+# this source distribution for the terms.
+
+# Runs a command, pipes its output to stdout, and injects status
+# reports at regular time interval.
+#
+# This ensures that TravisCI does not abort the command just because
+# it is silent for more than 10 minutes, as it can happen with bitbake
+# when working on a single complex task, like "bitbake linux-yocto".
+#
+# Piping bitbake stdout has the advantage that bitbake enters
+# non-interactive output mode, which it would do when run by TravisCI
+# directly.
+#
+# Finally, the default status messages give some sense of memory
+# and disk usage, which is critical in the rather constrained
+# TravisCI environments.
+
+import errno
+import optparse
+import signal
+import subprocess
+import sys
+import time
+
+parser = optparse.OptionParser()
+parser.add_option("-s", "--status",
+                  help="invoked in a shell when it is time for a status report",
+                  # 200 columns is readable in the TravisCI Web UI without wrapping.
+                  # Depends of course on screen and font size. Resizing top output
+                  # only works (and is needed) on the more recent Trusty TravisCI
+                  # environment.
+                  default="date; free; df -h .; COLUMNS=200 LINES=30 top -w -b -n 1 2>/dev/null || top -n 1; ps x --cols 200 --forest",
+                  metavar="SHELL-CMD")
+parser.add_option("-i", "--interval",
+                  help="repeat status at intervals of this amount of seconds, 0 to disable",
+                  default=300,
+                  metavar="SECONDS", type="int")
+parser.add_option("-d", "--deadline",
+                  help="stop execution when reaching the given time",
+                  default=time.time,
+                  metavar="SECONDS-SINCE-EPOCH", type="int")
+
+(options, args) = parser.parse_args()
+
+def check_deadline(now):
+    if options.deadline > 0 and options.deadline < now:
+        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)
+
+# 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
+# (not really possible in TravisCI, but may be useful elsewhere).
+now = time.time()
+next_status = now + options.interval
+alarm_interval = max(options.interval, 0)
+if options.deadline:
+    check_deadline(now)
+    if options.deadline < now + 60:
+        # Wake up a little too late, to be sure that we trigger the if check.
+        deadline_alarm_interval = max(int(options.deadline + 2 - now), 1)
+    elif next_status > 60:
+        deadline_alarm_interval = 60
+    if deadline_alarm_interval < alarm_interval:
+        alarm_interval = deadline_alarm_interval
+
+def status(signum, frame):
+    global next_status
+    now = time.time()
+    if options.interval < 0 or now >= next_status:
+        subprocess.call(options.status, shell=True)
+        next_status = now + options.interval
+    check_deadline(now)
+    if alarm_interval > 0:
+        signal.alarm(alarm_interval)
+
+# Run command.
+try:
+    cmd = subprocess.Popen(args, stdout=subprocess.PIPE)
+
+    # Arm timer and handler.
+    signal.signal(signal.SIGALRM, status)
+    if alarm_interval > 0:
+        signal.alarm(alarm_interval)
+
+    while cmd.poll() is None:
+        try:
+            line = cmd.stdout.readline()
+            sys.stdout.write(line)
+            sys.stdout.flush()
+        except IOError, ex:
+            if ex.errno != errno.EINTR:
+                raise
+finally:
+    # If we go down, so must our child...
+    if cmd.poll() is None:
+        cmd.kill()
+
+exit(1 if cmd.returncode else 0)
\ No newline at end of file
diff --git a/include/mapnik/json/positions_grammar.hpp b/src/json/generic_json.cpp
similarity index 52%
copy from include/mapnik/json/positions_grammar.hpp
copy to src/json/generic_json.cpp
index 75a6b21..7fb2e9f 100644
--- a/include/mapnik/json/positions_grammar.hpp
+++ b/src/json/generic_json.cpp
@@ -20,37 +20,44 @@
  *
  *****************************************************************************/
 
-#ifndef MAPNIK_JSON_POSITIONS_GRAMMAR_HPP
-#define MAPNIK_JSON_POSITIONS_GRAMMAR_HPP
-
-// mapnik
-#include <mapnik/util/variant.hpp>
-#include <mapnik/json/positions.hpp>
 #include <mapnik/json/generic_json.hpp>
-#include <mapnik/json/error_handler.hpp>
-#include <mapnik/geometry.hpp>
-#pragma GCC diagnostic push
-#include <mapnik/warning_ignore.hpp>
-#include <boost/spirit/include/qi.hpp>
-#pragma GCC diagnostic pop
-
 
 namespace mapnik { namespace json {
 
-namespace qi = boost::spirit::qi;
-
-template <typename Iterator, typename ErrorHandler = error_handler<Iterator> >
-struct positions_grammar :
-        qi::grammar<Iterator,coordinates(),space_type>
+template <typename Iterator>
+generic_json<Iterator>::generic_json()
+    : generic_json::base_type(value)
 {
-    positions_grammar(ErrorHandler & error_handler);
-    qi::rule<Iterator, coordinates(),space_type> coords;
-    qi::rule<Iterator, boost::optional<position>(), space_type> pos;
-    qi::rule<Iterator, positions(), space_type> ring;
-    qi::rule<Iterator, std::vector<positions>(), space_type> rings;
-    qi::rule<Iterator, std::vector<std::vector<positions> >(), space_type> rings_array;
-};
+    qi::lit_type lit;
+    qi::_val_type _val;
+    qi::_1_type _1;
+    using phoenix::construct;
+    // generic json types
+    value = object | array | string_ | number
+        ;
+
+    key_value = string_ > lit(':') > value
+        ;
+
+    object = lit('{')
+        > -(key_value % lit(','))
+        > lit('}')
+        ;
+
+    array = lit('[')
+        > -(value % lit(','))
+        > lit(']')
+        ;
+
+    number = strict_double[_val = double_converter(_1)]
+        | int__[_val = integer_converter(_1)]
+        | lit("true") [_val = true]
+        | lit ("false") [_val = false]
+        | lit("null")[_val = construct<value_null>()]
+        ;
+}
 
 }}
 
-#endif // MAPNIK_JSON_POSITIONS_GRAMMAR_HPP
+using iterator_type = char const*;
+template struct mapnik::json::generic_json<iterator_type>;
diff --git a/src/json/mapnik_topojson_grammar.cpp b/src/json/mapnik_topojson_grammar.cpp
index e70f7c5..e4b9dca 100644
--- a/src/json/mapnik_topojson_grammar.cpp
+++ b/src/json/mapnik_topojson_grammar.cpp
@@ -24,5 +24,5 @@
 #include <mapnik/json/topojson_grammar_impl.hpp>
 #include <string>
 
-using iterator_type = std::string::const_iterator;
+using iterator_type = char const*;
 template struct mapnik::topojson::topojson_grammar<iterator_type> ;
diff --git a/src/memory_datasource.cpp b/src/memory_datasource.cpp
index 3c18220..1127f4b 100644
--- a/src/memory_datasource.cpp
+++ b/src/memory_datasource.cpp
@@ -117,12 +117,20 @@ datasource::datasource_t memory_datasource::type() const
 
 featureset_ptr memory_datasource::features(const query& q) const
 {
+    if (features_.empty())
+    {
+        return mapnik::make_invalid_featureset();
+    }
     return std::make_shared<memory_featureset>(q.get_bbox(),*this,bbox_check_);
 }
 
 
 featureset_ptr memory_datasource::features_at_point(coord2d const& pt, double tol) const
 {
+    if (features_.empty())
+    {
+        return mapnik::make_invalid_featureset();
+    }
     box2d<double> box = box2d<double>(pt.x, pt.y, pt.x, pt.y);
     box.pad(tol);
     MAPNIK_LOG_DEBUG(memory_datasource) << "memory_datasource: Box=" << box << ", Point x=" << pt.x << ",y=" << pt.y;
diff --git a/src/json/mapnik_topojson_grammar.cpp b/test/unit/datasource/memory.cpp
similarity index 62%
copy from src/json/mapnik_topojson_grammar.cpp
copy to test/unit/datasource/memory.cpp
index e70f7c5..514e645 100644
--- a/src/json/mapnik_topojson_grammar.cpp
+++ b/test/unit/datasource/memory.cpp
@@ -20,9 +20,27 @@
  *
  *****************************************************************************/
 
-#include <mapnik/feature.hpp>
-#include <mapnik/json/topojson_grammar_impl.hpp>
-#include <string>
+#include "catch.hpp"
+#include "ds_test_util.hpp"
 
-using iterator_type = std::string::const_iterator;
-template struct mapnik::topojson::topojson_grammar<iterator_type> ;
+#include <mapnik/unicode.hpp>
+#include <mapnik/datasource.hpp>
+#include <mapnik/memory_datasource.hpp>
+#include <mapnik/datasource_cache.hpp>
+
+
+TEST_CASE("memory datasource") {
+
+    SECTION("empty featureset")
+    {
+        mapnik::parameters params;
+        mapnik::datasource_ptr ds = std::make_shared<mapnik::memory_datasource>(params);
+        CHECK(ds != nullptr);
+        auto fs = all_features(ds);
+        REQUIRE(!mapnik::is_valid(fs));
+        while (auto f = fs->next())
+        {
+            CHECK(false); // shouldn't get here
+        }
+    }
+}
diff --git a/test/unit/datasource/topojson.cpp b/test/unit/datasource/topojson.cpp
index 41d9b19..7bf155e 100644
--- a/test/unit/datasource/topojson.cpp
+++ b/test/unit/datasource/topojson.cpp
@@ -31,7 +31,7 @@
 
 namespace {
 
-using iterator_type = std::string::const_iterator;
+using iterator_type = char const*;
 const mapnik::topojson::topojson_grammar<iterator_type> grammar;
 
 bool parse_topology(std::string const& filename, mapnik::topojson::topology & topo)
@@ -42,8 +42,8 @@ bool parse_topology(std::string const& filename, mapnik::topojson::topology & to
     std::fread(&buffer[0], buffer.size(), 1, file.get());
     if (!file) return false;
     boost::spirit::standard::space_type space;
-    iterator_type itr = buffer.begin();
-    iterator_type end = buffer.end();
+    iterator_type itr = buffer.c_str();
+    iterator_type end = itr + buffer.length();
     bool result = boost::spirit::qi::phrase_parse(itr, end, grammar, space, topo);
     return (result && (itr == end));
 }
diff --git a/utils/mapnik-config/build.py b/utils/mapnik-config/build.py
index e4178ba..35a730b 100644
--- a/utils/mapnik-config/build.py
+++ b/utils/mapnik-config/build.py
@@ -80,7 +80,15 @@ def write_config(configuration,template,config_file):
         os.chmod(config_file,0755)
     except: pass
 
-cxxflags = ' '.join(config_env['LIBMAPNIK_CXXFLAGS'])
+
+cxxflags_raw = config_env['LIBMAPNIK_CXXFLAGS'];
+# strip clang specific flags to avoid breaking gcc
+# while it is not recommended to mix compilers, this nevertheless
+# makes it easier to compile apps with gcc and mapnik-config against mapnik built with clang
+to_remove = ['-Wno-unsequenced','-Wno-unknown-warning-option','-Wtautological-compare','-Wheader-hygiene']
+cxxflags_cleaned = [item for item in config_env['LIBMAPNIK_CXXFLAGS'] if item not in to_remove];
+
+cxxflags = ' '.join(cxxflags_cleaned)
 
 defines = ' '.join(config_env['LIBMAPNIK_DEFINES'])
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/mapnik.git



More information about the Pkg-grass-devel mailing list