[mapnik-vector-tile] 06/15: Imported Upstream version 0.9.0+dfsg

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Sat Sep 12 11:06:51 UTC 2015


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

sebastic pushed a commit to branch master
in repository mapnik-vector-tile.

commit ae7ec37b708c67bc57061794c79f1a0ddfb1fc37
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Fri Sep 11 22:55:25 2015 +0200

    Imported Upstream version 0.9.0+dfsg
---
 CHANGELOG.md                         |  5 ++++
 CONTRIBUTING.md                      |  3 ++-
 Makefile                             |  8 +++----
 gyp/build.gyp                        | 12 +++++-----
 package.json                         |  2 +-
 src/vector_tile_datasource_pbf.hpp   |  8 +++----
 src/vector_tile_datasource_pbf.ipp   | 46 ++++++++++++++++++------------------
 src/vector_tile_geometry_decoder.hpp |  8 +++----
 src/vector_tile_geometry_encoder.hpp | 14 +++++------
 test/vector_tile.cpp                 |  4 ++--
 test/vector_tile_pbf.cpp             | 46 ++++++++++++++++++------------------
 11 files changed, 81 insertions(+), 75 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1226381..79e0380 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
 # Changelog
 
+## 0.9.0
+
+ - Upgraded to protozero v1.0.0
+ - Fixed attribute handling bug in tile_datasource_pbf
+
 ## 0.8.5
 
  - Remove geometries from clipping that never intersect with the bounding box of the tile (#135)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index d0a99ce..ad498ac 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -7,7 +7,8 @@ General guidelines for contributing to mapnik-vector-tile
 To release a new node-mapnik version:
 
  - Make sure that all tests as passing (including travis and appveyor tests).
- - Update the CHANGELOG.md and commit new version.
+ - Update the CHANGELOG.md
+ - Make a "bump commit" by updating the version in `package.json` and adding a commit like `-m "bump to v0.8.5"`
  - Create a github tag like `git tag -a v0.8.5 -m "v0.8.5"`
  - Ensure you have a clean checkout (no extra files in your check that are not known by git). You need to be careful, for instance, to avoid a large accidental file being packaged by npm. You can get a view of what npm will publish by running `make testpack`
  - Then publish the module to npm repositories by running `npm publish`
diff --git a/Makefile b/Makefile
index c3ee347..27454c1 100755
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ MAPNIK_PLUGINDIR := $(shell mapnik-config --input-plugins)
 BUILDTYPE ?= Release
 
 CLIPPER_REVISION=e0973e0802
-PBF_REVISION=1df6453
+PROTOZERO_REVISION=v1.0.0
 GYP_REVISION=3464008
 
 all: libvtile
@@ -10,13 +10,13 @@ all: libvtile
 ./deps/gyp:
 	git clone https://chromium.googlesource.com/external/gyp.git ./deps/gyp && cd ./deps/gyp && git checkout $(GYP_REVISION)
 
-./deps/pbf:
-	git clone https://github.com/mapbox/pbf.hpp.git ./deps/pbf && cd ./deps/pbf && git checkout $(PBF_REVISION)
+./deps/protozero:
+	git clone https://github.com/mapbox/protozero.git ./deps/protozero && cd ./deps/protozero && git checkout $(PROTOZERO_REVISION)
 
 ./deps/clipper:
 	git clone https://github.com/mapnik/clipper.git -b r493-mapnik ./deps/clipper && cd ./deps/clipper && git checkout $(CLIPPER_REVISION) && ./cpp/fix_members.sh
 
-build/Makefile: ./deps/gyp ./deps/clipper ./deps/pbf gyp/build.gyp test/*cpp
+build/Makefile: ./deps/gyp ./deps/clipper ./deps/protozero gyp/build.gyp test/*cpp
 	deps/gyp/gyp gyp/build.gyp --depth=. -DMAPNIK_PLUGINDIR=\"$(MAPNIK_PLUGINDIR)\" -Goutput_dir=. --generator-output=./build -f make
 
 libvtile: build/Makefile Makefile
diff --git a/gyp/build.gyp b/gyp/build.gyp
index 5f363e6..a9d8a5f 100644
--- a/gyp/build.gyp
+++ b/gyp/build.gyp
@@ -42,7 +42,7 @@
       ],
       'include_dirs': [
         '<(SHARED_INTERMEDIATE_DIR)/',
-        '../deps/pbf'
+        '../deps/protozero/include'
       ],
       'cflags_cc' : [
           '-D_THREAD_SAFE',
@@ -61,7 +61,7 @@
       'direct_dependent_settings': {
         'include_dirs': [
           '<(SHARED_INTERMEDIATE_DIR)/',
-          '../deps/pbf'
+          '../deps/protozero/include'
         ],
         'libraries':[
           '-lprotobuf-lite'
@@ -92,7 +92,7 @@
           '<!@(mapnik-config --cflags)'
       ],
       'include_dirs': [
-        '../deps/pbf',
+        '../deps/protozero/include',
         '../deps/clipper/cpp'
       ],
       'xcode_settings': {
@@ -103,7 +103,7 @@
       'direct_dependent_settings': {
         'include_dirs': [
           '<(SHARED_INTERMEDIATE_DIR)/',
-          '../deps/pbf',
+          '../deps/protozero/include',
           '../deps/clipper/cpp'
         ],
         'defines' : [
@@ -141,7 +141,7 @@
       ],
       "include_dirs": [
         "../src",
-        '../deps/pbf'
+        '../deps/protozero/include'
       ]
     },
     {
@@ -157,7 +157,7 @@
       ],
       "include_dirs": [
         "../src",
-        '../deps/pbf'
+        '../deps/protozero/include'
       ]
     },
     {
diff --git a/package.json b/package.json
index 2b3124a..849d896 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
     "name": "mapnik-vector-tile",
-    "version": "0.8.5",
+    "version": "0.9.0",
     "description": "Mapnik vector tile API",
     "main": "./package.json",
     "repository"   :  {
diff --git a/src/vector_tile_datasource_pbf.hpp b/src/vector_tile_datasource_pbf.hpp
index 5e778df..89024db 100644
--- a/src/vector_tile_datasource_pbf.hpp
+++ b/src/vector_tile_datasource_pbf.hpp
@@ -3,7 +3,7 @@
 
 #include <mapnik/datasource.hpp>
 #include <mapnik/box2d.hpp>
-#include "pbf_reader.hpp"
+#include <protozero/pbf_reader.hpp>
 
 namespace mapnik { namespace vector_tile_impl {
 
@@ -14,7 +14,7 @@ namespace mapnik { namespace vector_tile_impl {
     class tile_datasource_pbf : public datasource
     {
     public:
-        tile_datasource_pbf(mapbox::util::pbf const& layer,
+        tile_datasource_pbf(protozero::pbf_reader const& layer,
                         unsigned x,
                         unsigned y,
                         unsigned z,
@@ -32,7 +32,7 @@ namespace mapnik { namespace vector_tile_impl {
     private:
         mutable mapnik::layer_descriptor desc_;
         mutable bool attributes_added_;
-        mapbox::util::pbf layer_;
+        protozero::pbf_reader layer_;
         unsigned x_;
         unsigned y_;
         unsigned z_;
@@ -45,7 +45,7 @@ namespace mapnik { namespace vector_tile_impl {
         uint32_t layer_extent_;
 
         std::string name_;
-        std::vector<mapbox::util::pbf> features_;
+        std::vector<protozero::pbf_reader> features_;
         std::vector<std::string> layer_keys_;
         layer_pbf_attr_type layer_values_;
     };
diff --git a/src/vector_tile_datasource_pbf.ipp b/src/vector_tile_datasource_pbf.ipp
index e3ab58d..65ef644 100644
--- a/src/vector_tile_datasource_pbf.ipp
+++ b/src/vector_tile_datasource_pbf.ipp
@@ -27,6 +27,8 @@
 #include <stdexcept>
 #include <string>
 
+#include <protozero/pbf_reader.hpp>
+
 #include <boost/optional.hpp>
 #include <unicode/unistr.h>
 
@@ -40,7 +42,7 @@ namespace mapnik { namespace vector_tile_impl {
                         mapnik::box2d<double> const& tile_extent,
                         mapnik::box2d<double> const& unbuffered_query,
                         std::set<std::string> const& attribute_names,
-                        std::vector<mapbox::util::pbf> const& features,
+                        std::vector<protozero::pbf_reader> const& features,
                         double tile_x,
                         double tile_y,
                         double scale,
@@ -52,6 +54,8 @@ namespace mapnik { namespace vector_tile_impl {
               features_(features),
               layer_keys_(layer_keys),
               layer_values_(layer_values),
+              num_keys_(layer_keys_.size()),
+              num_values_(layer_values_.size()),
               tile_x_(tile_x),
               tile_y_(tile_y),
               scale_(scale),
@@ -80,14 +84,11 @@ namespace mapnik { namespace vector_tile_impl {
         {
             while ( itr_ < features_.size() )
             {
-                mapbox::util::pbf f = features_.at(itr_);
+                protozero::pbf_reader f = features_.at(itr_);
                 // TODO: auto-increment feature id counter here
                 mapnik::feature_ptr feature = mapnik::feature_factory::create(ctx_,itr_);
-                pbf_attr_value_type val;
 
                 ++itr_;
-                int tagcount=0;
-                uint32_t key_idx, val_idx;
                 int32_t geometry_type = 0; // vector_tile::Tile_GeomType_UNKNOWN
                 while (f.next())
                 {
@@ -98,22 +99,18 @@ namespace mapnik { namespace vector_tile_impl {
                             break;
                         case 2:
                             {
-                                auto tag_iterator = f.packed_uint32();
-
-                                for (auto _i = tag_iterator.first; _i != tag_iterator.second; ++_i)
+                                auto tag_iterator = f.get_packed_uint32();
+                                for (auto _i = tag_iterator.first; _i != tag_iterator.second;)
                                 {
-                                    if (tagcount % 2 == 0)
-                                    {
-                                        key_idx = *_i;
-                                        ++tagcount;
-                                    }
-                                    else
+                                    std::size_t key_name = *(_i++);
+                                    std::size_t key_value = *(_i++);
+                                    if (key_name < num_keys_
+                                        && key_value < num_values_)
                                     {
-                                        val_idx = *_i;
-                                        std::string name = layer_keys_.at(key_idx);
+                                        std::string const& name = layer_keys_.at(key_name);
                                         if (feature->has_key(name))
                                         {
-                                            val = layer_values_.at(val_idx);
+                                            pbf_attr_value_type val = layer_values_.at(key_value);
                                             if (val.is<std::string>())
                                             {
                                                 feature->put(name, tr_.transcode(val.get<std::string>().data(), val.get<std::string>().length()));
@@ -137,10 +134,11 @@ namespace mapnik { namespace vector_tile_impl {
                                             else if (val.is<float>())
                                             {
                                                 feature->put(name, static_cast<mapnik::value_double>(val.get<float>()));
-                                            } else {
+                                            }
+                                            else
+                                            {
                                                 throw std::runtime_error("unknown attribute type while reading feature");
                                             }
-                                            ++tagcount;
                                         }
                                     }
                                 }
@@ -210,7 +208,7 @@ namespace mapnik { namespace vector_tile_impl {
                             break;
                         case 4:
                             {
-                                auto geom_itr = f.packed_uint32();
+                                auto geom_itr = f.get_packed_uint32();
                                 mapnik::vector_tile_impl::GeometryPBF geoms(geom_itr, tile_x_,tile_y_,scale_,-1*scale_);
                                 mapnik::geometry::geometry<double> geom = decode_geometry(geoms, geometry_type);
                                 if (geom.is<mapnik::geometry::geometry_empty>())
@@ -245,9 +243,11 @@ namespace mapnik { namespace vector_tile_impl {
         Filter filter_;
         mapnik::box2d<double> tile_extent_;
         mapnik::box2d<double> unbuffered_query_;
-        std::vector<mapbox::util::pbf> const& features_;
+        std::vector<protozero::pbf_reader> const& features_;
         std::vector<std::string> const& layer_keys_;
         layer_pbf_attr_type const& layer_values_;
+        std::size_t num_keys_;
+        std::size_t num_values_;
 
         double tile_x_;
         double tile_y_;
@@ -259,7 +259,7 @@ namespace mapnik { namespace vector_tile_impl {
     };
 
     // tile_datasource impl
-    tile_datasource_pbf::tile_datasource_pbf(mapbox::util::pbf const& layer,
+    tile_datasource_pbf::tile_datasource_pbf(protozero::pbf_reader const& layer,
                                      unsigned x,
                                      unsigned y,
                                      unsigned z,
@@ -282,7 +282,7 @@ namespace mapnik { namespace vector_tile_impl {
         tile_x_ = -0.5 * mapnik::EARTH_CIRCUMFERENCE + x_ * resolution;
         tile_y_ =  0.5 * mapnik::EARTH_CIRCUMFERENCE - y_ * resolution;
 
-        mapbox::util::pbf val_msg;
+        protozero::pbf_reader val_msg;
 
         while (layer_.next())
         {
diff --git a/src/vector_tile_geometry_decoder.hpp b/src/vector_tile_geometry_decoder.hpp
index c3abdf8..1de0441 100644
--- a/src/vector_tile_geometry_decoder.hpp
+++ b/src/vector_tile_geometry_decoder.hpp
@@ -7,7 +7,7 @@
 #include "vector_tile.pb.h"
 #pragma GCC diagnostic pop
 
-#include "pbf_reader.hpp"
+#include <protozero/pbf_reader.hpp>
 
 #include <mapnik/util/is_clockwise.hpp>
 //std
@@ -50,7 +50,7 @@ private:
 class GeometryPBF {
 
 public:
-    inline explicit GeometryPBF(std::pair< mapbox::util::pbf::const_uint32_iterator, mapbox::util::pbf::const_uint32_iterator > const& geo_iterator,
+    inline explicit GeometryPBF(std::pair< protozero::pbf_reader::const_uint32_iterator, protozero::pbf_reader::const_uint32_iterator > const& geo_iterator,
                              double tile_x, double tile_y,
                              double scale_x, double scale_y);
 
@@ -65,7 +65,7 @@ public:
     inline command next(double& rx, double& ry);
 
 private:
-    std::pair< mapbox::util::pbf::const_uint32_iterator, mapbox::util::pbf::const_uint32_iterator > geo_iterator_;
+    std::pair< protozero::pbf_reader::const_uint32_iterator, protozero::pbf_reader::const_uint32_iterator > geo_iterator_;
     double scale_x_;
     double scale_y_;
     uint8_t cmd;
@@ -134,7 +134,7 @@ Geometry::command Geometry::next(double& rx, double& ry)
     }
 }
 
-GeometryPBF::GeometryPBF(std::pair<mapbox::util::pbf::const_uint32_iterator, mapbox::util::pbf::const_uint32_iterator > const& geo_iterator,
+GeometryPBF::GeometryPBF(std::pair<protozero::pbf_reader::const_uint32_iterator, protozero::pbf_reader::const_uint32_iterator > const& geo_iterator,
                    double tile_x, double tile_y,
                    double scale_x, double scale_y)
     : geo_iterator_(geo_iterator),
diff --git a/src/vector_tile_geometry_encoder.hpp b/src/vector_tile_geometry_encoder.hpp
index a4aae3d..4a2c71d 100644
--- a/src/vector_tile_geometry_encoder.hpp
+++ b/src/vector_tile_geometry_encoder.hpp
@@ -10,7 +10,7 @@
 
 #include <mapnik/geometry.hpp>
 #include "vector_tile_config.hpp"
-#include "pbf_writer.hpp"
+#include <protozero/pbf_writer.hpp>
 
 #include <cstdlib>
 #include <cmath>
@@ -28,8 +28,8 @@ inline unsigned encode_geometry(mapnik::geometry::point<std::int64_t> const& pt,
     int32_t dx = pt.x - start_x;
     int32_t dy = pt.y - start_y;
     // Manual zigzag encoding.
-    current_feature.add_geometry(mapbox::util::pbf_writer::encode_zigzag32(dx));
-    current_feature.add_geometry(mapbox::util::pbf_writer::encode_zigzag32(dy));
+    current_feature.add_geometry(protozero::encode_zigzag32(dx));
+    current_feature.add_geometry(protozero::encode_zigzag32(dy));
     start_x = pt.x;
     start_y = pt.y;
     return 1;
@@ -73,8 +73,8 @@ inline unsigned encode_geometry(mapnik::geometry::line_string<std::int64_t> cons
         int32_t dx = pt.x - start_x;
         int32_t dy = pt.y - start_y;
         // Manual zigzag encoding.
-        current_feature.add_geometry(mapbox::util::pbf_writer::encode_zigzag32(dx));
-        current_feature.add_geometry(mapbox::util::pbf_writer::encode_zigzag32(dy));
+        current_feature.add_geometry(protozero::encode_zigzag32(dx));
+        current_feature.add_geometry(protozero::encode_zigzag32(dy));
         start_x = pt.x;
         start_y = pt.y;
     }
@@ -128,8 +128,8 @@ inline unsigned encode_geometry(mapnik::geometry::linear_ring<std::int64_t> cons
         int32_t dx = pt.x - start_x;
         int32_t dy = pt.y - start_y;
         // Manual zigzag encoding.
-        current_feature.add_geometry(mapbox::util::pbf_writer::encode_zigzag32(dx));
-        current_feature.add_geometry(mapbox::util::pbf_writer::encode_zigzag32(dy));
+        current_feature.add_geometry(protozero::encode_zigzag32(dx));
+        current_feature.add_geometry(protozero::encode_zigzag32(dy));
         start_x = pt.x;
         start_y = pt.y;
         ++count;
diff --git a/test/vector_tile.cpp b/test/vector_tile.cpp
index 2716cfc..3276242 100644
--- a/test/vector_tile.cpp
+++ b/test/vector_tile.cpp
@@ -34,7 +34,7 @@
 
 // vector input api
 #include "vector_tile_datasource.hpp"
-#include "pbf_writer.hpp"
+#include "protozero/pbf_writer.hpp"
 
 /*
 TEST_CASE( "vector tile negative id", "hmm" ) {
@@ -532,7 +532,7 @@ TEST_CASE( "encoding single line 1", "should maintain start/end vertex" ) {
     // 5th and 6th are the x,y of the first line_to command
     // due zigzag encoding the 2,2 should be 4,4
     // delta encoding has no impact since the previous coordinate was 0,0
-    unsigned four = mapbox::util::pbf_writer::encode_zigzag32(2u);
+    unsigned four = protozero::encode_zigzag32(2u);
     CHECK(4 == four);
     CHECK(4 == f.geometry(4));
     CHECK(4 == f.geometry(5));
diff --git a/test/vector_tile_pbf.cpp b/test/vector_tile_pbf.cpp
index 8f2774f..ef5ccf9 100644
--- a/test/vector_tile_pbf.cpp
+++ b/test/vector_tile_pbf.cpp
@@ -39,7 +39,7 @@
 #include "vector_tile_datasource.hpp"
 #include "vector_tile_datasource_pbf.hpp"
 
-#include "pbf_reader.hpp"
+#include "protozero/pbf_reader.hpp"
 
 #include <string>
 #include <fstream>
@@ -79,9 +79,9 @@ TEST_CASE( "pbf vector tile input", "should be able to parse message and render
 
     mapnik::layer lyr2("layer",map.srs());
     
-    mapbox::util::pbf pbf_tile(buffer.c_str(), buffer.size());
+    protozero::pbf_reader pbf_tile(buffer.c_str(), buffer.size());
     pbf_tile.next();
-    mapbox::util::pbf layer3 = pbf_tile.get_message();
+    protozero::pbf_reader layer3 = pbf_tile.get_message();
     
     std::shared_ptr<mapnik::vector_tile_impl::tile_datasource_pbf> ds = std::make_shared<
                                     mapnik::vector_tile_impl::tile_datasource_pbf>(
@@ -157,9 +157,9 @@ TEST_CASE( "pbf vector tile datasource", "should filter features outside extent"
     
     std::string buffer;
     tile.SerializeToString(&buffer);
-    mapbox::util::pbf pbf_tile(buffer.c_str(), buffer.size());
+    protozero::pbf_reader pbf_tile(buffer.c_str(), buffer.size());
     pbf_tile.next();
-    mapbox::util::pbf layer2 = pbf_tile.get_message();
+    protozero::pbf_reader layer2 = pbf_tile.get_message();
     
     // now actually start the meat of the test
     mapnik::vector_tile_impl::tile_datasource_pbf ds(layer2,0,0,0,tile_size);
@@ -285,9 +285,9 @@ TEST_CASE( "pbf encoding multi line as one path", "should maintain second move_t
     
     std::string buffer;
     tile.SerializeToString(&buffer);
-    mapbox::util::pbf pbf_tile(buffer.c_str(), buffer.size());
+    protozero::pbf_reader pbf_tile(buffer.c_str(), buffer.size());
     pbf_tile.next();
-    mapbox::util::pbf layer2 = pbf_tile.get_message();
+    protozero::pbf_reader layer2 = pbf_tile.get_message();
     
 
     mapnik::vector_tile_impl::tile_datasource_pbf ds(layer2,0,0,0,tile_size);
@@ -309,17 +309,17 @@ TEST_CASE( "pbf encoding multi line as one path", "should maintain second move_t
 
 TEST_CASE( "pbf decoding empty buffer", "should throw exception" ) {
     std::string buffer;
-    mapbox::util::pbf pbf_tile(buffer.c_str(), buffer.size());
+    protozero::pbf_reader pbf_tile(buffer.c_str(), buffer.size());
     pbf_tile.next();
-    mapbox::util::pbf layer2;
+    protozero::pbf_reader layer2;
     REQUIRE_THROWS(layer2 = pbf_tile.get_message());
 }
 
 TEST_CASE( "pbf decoding garbage buffer", "should throw exception" ) {
     std::string buffer("daufyglwi3h7fseuhfas8w3h,dksufasdf");
-    mapbox::util::pbf pbf_tile(buffer.c_str(), buffer.size());
+    protozero::pbf_reader pbf_tile(buffer.c_str(), buffer.size());
     pbf_tile.next();
-    mapbox::util::pbf layer2;
+    protozero::pbf_reader layer2;
     REQUIRE_THROWS(layer2 = pbf_tile.get_message());
 }
 
@@ -363,9 +363,9 @@ TEST_CASE( "pbf decoding some truncated buffers", "should throw exception" ) {
     for (std::size_t i=1; i< buffer.size(); ++i)
     {
       CHECK_THROWS({
-          mapbox::util::pbf pbf_tile(buffer.c_str(), i);
+          protozero::pbf_reader pbf_tile(buffer.c_str(), i);
           pbf_tile.next();
-          mapbox::util::pbf layer2 = pbf_tile.get_message();
+          protozero::pbf_reader layer2 = pbf_tile.get_message();
           mapnik::vector_tile_impl::tile_datasource_pbf ds(layer2,0,0,0,tile_size);
           mapnik::featureset_ptr fs;
           mapnik::feature_ptr f_ptr;
@@ -412,19 +412,19 @@ TEST_CASE( "pbf vector tile from simplified geojson", "should create vector tile
 
     std::string buffer;
     tile.SerializeToString(&buffer);
-    mapbox::util::pbf pbf_tile(buffer.c_str(), buffer.size());
+    protozero::pbf_reader pbf_tile(buffer.c_str(), buffer.size());
     pbf_tile.next();
-    mapbox::util::pbf pbf_layer = pbf_tile.get_message();
+    protozero::pbf_reader pbf_layer = pbf_tile.get_message();
     // Need to loop because they could be encoded in any order
     bool found = false;
     while (!found && pbf_layer.next()) {
       // But there will be only one in our tile, so we'll break out of loop once we find it
       if (pbf_layer.tag() == 2) {
-          mapbox::util::pbf pbf_feature = pbf_layer.get_message();
+          protozero::pbf_reader pbf_feature = pbf_layer.get_message();
           while (!found && pbf_feature.next()) {
               if (pbf_feature.tag() == 4) {
                   found = true;
-                  std::pair< mapbox::util::pbf::const_uint32_iterator, mapbox::util::pbf::const_uint32_iterator > geom_itr = pbf_feature.packed_uint32();
+                  std::pair< protozero::pbf_reader::const_uint32_iterator, protozero::pbf_reader::const_uint32_iterator > geom_itr = pbf_feature.get_packed_uint32();
                   mapnik::vector_tile_impl::GeometryPBF geoms(geom_itr, tile_x,tile_y,scale,-1*scale);
                   auto geom = mapnik::vector_tile_impl::decode_geometry(geoms, f.type());
 
@@ -493,9 +493,9 @@ TEST_CASE( "pbf raster tile output", "should be able to overzoom raster" ) {
     std::string buffer;
     CHECK(tile.SerializeToString(&buffer));
 
-    mapbox::util::pbf pbf_tile(buffer.c_str(), buffer.size());
+    protozero::pbf_reader pbf_tile(buffer.c_str(), buffer.size());
     pbf_tile.next();
-    mapbox::util::pbf layer2 = pbf_tile.get_message();
+    protozero::pbf_reader layer2 = pbf_tile.get_message();
 
     // now read back and render image at larger size
     // and zoomed in
@@ -544,9 +544,9 @@ TEST_CASE("Check that we throw on various valid-but-we-don't-handle PBF encoded
 
         mapnik::box2d<double> bbox(-20037508.342789,-20037508.342789,20037508.342789,20037508.342789);
         unsigned tile_size = 256;
-          mapbox::util::pbf pbf_tile(buffer.c_str(), buffer.size());
+          protozero::pbf_reader pbf_tile(buffer.c_str(), buffer.size());
           pbf_tile.next();
-          mapbox::util::pbf layer2 = pbf_tile.get_message();
+          protozero::pbf_reader layer2 = pbf_tile.get_message();
           mapnik::vector_tile_impl::tile_datasource_pbf ds(layer2,0,0,0,tile_size);
           mapnik::featureset_ptr fs;
           mapnik::feature_ptr f_ptr;
@@ -584,9 +584,9 @@ TEST_CASE( "pbf vector tile from linestring geojson", "should create vector tile
     REQUIRE(3 == layer.features_size());
     std::string buffer;
     tile.SerializeToString(&buffer);
-    mapbox::util::pbf pbf_tile(buffer.c_str(), buffer.size());
+    protozero::pbf_reader pbf_tile(buffer.c_str(), buffer.size());
     pbf_tile.next();
-    mapbox::util::pbf layer3 = pbf_tile.get_message();
+    protozero::pbf_reader layer3 = pbf_tile.get_message();
     std::shared_ptr<mapnik::vector_tile_impl::tile_datasource_pbf> ds2 = std::make_shared<
                                     mapnik::vector_tile_impl::tile_datasource_pbf>(
                                         layer3,0,0,0,256);

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



More information about the Pkg-grass-devel mailing list