[mapnik-vector-tile] 01/06: Imported Upstream version 1.2.2+dfsg
Bas Couwenberg
sebastic at debian.org
Mon Sep 12 08:30:04 UTC 2016
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 fd9578d3f60d1a720be3e9ea46bb1576ab7c336d
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Mon Sep 12 09:42:07 2016 +0200
Imported Upstream version 1.2.2+dfsg
---
.travis.yml | 14 ++++++++---
CHANGELOG.md | 5 ++++
CONTRIBUTING.md | 4 +--
Makefile | 2 +-
bootstrap.sh | 49 ++++++++++++++++++++++++------------
include_dirs.js | 2 ++
package.json | 4 +--
src/vector_tile_composite.hpp | 8 +++---
src/vector_tile_datasource_pbf.ipp | 6 ++---
src/vector_tile_featureset_pbf.ipp | 12 ++++-----
src/vector_tile_geometry_decoder.cpp | 16 ++++++++++++
src/vector_tile_geometry_decoder.hpp | 6 +++--
src/vector_tile_geometry_decoder.ipp | 35 +++++++++++++-------------
src/vector_tile_is_valid.hpp | 2 +-
src/vector_tile_load_tile.hpp | 10 ++++----
test/geometry_visual_test.cpp | 2 +-
test/unit/load/merge.cpp | 18 ++++++-------
test/utils/encoding_util.cpp | 2 +-
test/utils/round_trip.cpp | 2 +-
test/vector_tile.cpp | 2 +-
test/vector_tile_pbf.cpp | 2 +-
21 files changed, 126 insertions(+), 77 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 37b3b70..1fde783 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,22 +16,28 @@ matrix:
include:
- os: linux
sudo: false
+ compiler: ": gcc5"
+ env: JOBS=10 CXX="ccache g++-5" CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0"
+ addons:
+ apt:
+ sources: ['ubuntu-toolchain-r-test']
+ packages: [ 'libstdc++-5-dev','g++-5', 'xutils-dev']
+ - os: linux
+ sudo: false
compiler: ": clang"
env: JOBS=10 CXX="ccache clang++-3.8 -Qunused-arguments"
- sudo: false
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
- packages: [ 'libstdc++6', 'libstdc++-5-dev']
+ packages: [ 'libstdc++-5-dev', 'xutils-dev']
- os: linux
sudo: false
compiler: ": clang-coverage"
env: JOBS=10 CXX="ccache clang++-3.8 -Qunused-arguments" COVERAGE=true BUILDTYPE=Debug
- sudo: false
addons:
apt:
sources: ['ubuntu-toolchain-r-test']
- packages: [ 'libstdc++6', 'libstdc++-5-dev']
+ packages: [ 'libstdc++-5-dev', 'xutils-dev']
- os: osx
compiler: clang
env: JOBS=10
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0d2e606..766968d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
# Changelog
+## 1.2.2
+
+- Upgraded to protozer 1.4.2
+- Added ability to dynamically get include paths by requiring module in node.js
+
## 1.2.1
- Updated clipper
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index bdfe804..a01191b 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -4,9 +4,9 @@ General guidelines for contributing to mapnik-vector-tile
## Releasing
-To release a new node-mapnik version:
+To release a new mapnik-vector-tile version:
- - Make sure that all tests as passing (including travis and appveyor tests).
+ - Make sure that all tests as passing (including travis tests).
- 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" && git push --tags`
diff --git a/Makefile b/Makefile
index c600e56..5989923 100755
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ MAPNIK_PLUGINDIR := $(shell mapnik-config --input-plugins)
BUILDTYPE ?= Release
CLIPPER_REVISION=ac8d6bf2517f46c05647b5c19cac113fb180ffb4
-PROTOZERO_REVISION=v1.3.0
+PROTOZERO_REVISION=v1.4.2
GYP_REVISION=3464008
all: libvtile
diff --git a/bootstrap.sh b/bootstrap.sh
index 1320983..7f5eecb 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-MASON_VERSION="b709931"
+MASON_VERSION="new-pkgs"
function setup_mason() {
if [[ ! -d ./.mason ]]; then
@@ -19,6 +19,8 @@ function install() {
MASON_PLATFORM_ID=$(mason env MASON_PLATFORM_ID)
if [[ ! -d ./mason_packages/${MASON_PLATFORM_ID}/${1}/ ]]; then
mason install $1 $2
+ # the rm here is to workaround https://github.com/mapbox/mason/issues/230
+ rm -f ./mason_packages/.link/mason.ini
mason link $1 $2
fi
}
@@ -26,27 +28,42 @@ function install() {
ICU_VERSION="55.1"
function install_mason_deps() {
- install ccache 3.2.4 &
+ FAIL=0
install mapnik latest &
- install protobuf 2.6.1 &
- install freetype 2.6 &
- install harfbuzz 0.9.41 &
- wait
- install jpeg_turbo 1.4.0 &
- install libpng 1.6.20 &
- install webp 0.4.2 &
+ install ccache 3.2.4 &
+ 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 &
- install libtiff 4.0.4beta &
- wait
+ 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.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 &
install boost_libprogram_options 1.61.0 &
- install boost_libregex 1.61.0 &
- install pixman 0.32.6 &
- install cairo 1.14.2 &
- wait
+ install boost_libregex_icu 1.61.0 &
+ # technically boost thread and python are not a core dep, but installing
+ # 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.5 libfreetype &
+ install harfbuzz 1.3.0 libharfbuzz &
+ for job in $(jobs -p)
+ do
+ wait $job || let "FAIL+=1"
+ done
+ if [[ "$FAIL" != "0" ]]; then
+ exit ${FAIL}
+ fi
}
function setup_runtime_settings() {
diff --git a/include_dirs.js b/include_dirs.js
new file mode 100644
index 0000000..742c36b
--- /dev/null
+++ b/include_dirs.js
@@ -0,0 +1,2 @@
+var path = require('path');
+console.log(path.join(path.relative('.', __dirname),'src'));
diff --git a/package.json b/package.json
index 9f44867..8a0bc6c 100644
--- a/package.json
+++ b/package.json
@@ -1,8 +1,8 @@
{
"name": "mapnik-vector-tile",
- "version": "1.2.1",
+ "version": "1.2.2",
"description": "Mapnik Vector Tile API",
- "main": "./package.json",
+ "main": "include_dirs.js",
"repository" : {
"type" : "git",
"url" : "git://github.com/mapbox/mapnik-vector-tile.git"
diff --git a/src/vector_tile_composite.hpp b/src/vector_tile_composite.hpp
index aeb82b5..b3f17f0 100644
--- a/src/vector_tile_composite.hpp
+++ b/src/vector_tile_composite.hpp
@@ -57,8 +57,8 @@ void composite(merc_tile & target_vt,
while (tile_message.next(Tile_Encoding::LAYERS))
{
bool reencode_layer = reencode_tile;
- auto data_pair = tile_message.get_data();
- protozero::pbf_reader layer_message(data_pair);
+ const auto data_view = tile_message.get_view();
+ protozero::pbf_reader layer_message(data_view);
if (!layer_message.next(Layer_Encoding::NAME))
{
continue;
@@ -68,7 +68,7 @@ void composite(merc_tile & target_vt,
if (!reencode_layer)
{
- target_vt.append_layer_buffer(data_pair.first, data_pair.second, layer_name);
+ target_vt.append_layer_buffer(data_view.data(), data_view.size(), layer_name);
}
if (target_vt.has_layer(layer_name))
@@ -76,7 +76,7 @@ void composite(merc_tile & target_vt,
continue;
}
- protozero::pbf_reader layer_pbf(data_pair);
+ protozero::pbf_reader layer_pbf(data_view);
auto ds = std::make_shared<mapnik::vector_tile_impl::tile_datasource_pbf>(
layer_pbf,
vt->x(),
diff --git a/src/vector_tile_datasource_pbf.ipp b/src/vector_tile_datasource_pbf.ipp
index 9d83629..fd62bcb 100644
--- a/src/vector_tile_datasource_pbf.ipp
+++ b/src/vector_tile_datasource_pbf.ipp
@@ -74,14 +74,14 @@ tile_datasource_pbf::tile_datasource_pbf(protozero::pbf_reader const& layer,
break;
case Layer_Encoding::FEATURES:
{
- auto data_pair = layer_.get_data();
- protozero::pbf_reader check_feature(data_pair);
+ const auto data_view = layer_.get_view();
+ protozero::pbf_reader check_feature(data_view);
while (check_feature.next(Feature_Encoding::RASTER))
{
type_ = datasource::Raster;
check_feature.skip();
}
- protozero::pbf_reader f_msg(data_pair);
+ protozero::pbf_reader f_msg(data_view);
features_.push_back(f_msg);
}
break;
diff --git a/src/vector_tile_featureset_pbf.ipp b/src/vector_tile_featureset_pbf.ipp
index 1e7e86a..d19a463 100644
--- a/src/vector_tile_featureset_pbf.ipp
+++ b/src/vector_tile_featureset_pbf.ipp
@@ -123,7 +123,7 @@ feature_ptr tile_featureset_pbf<Filter>::next()
int32_t geometry_type = 0; // vector_tile::Tile_GeomType_UNKNOWN
bool has_geometry = false;
bool has_geometry_type = false;
- std::pair<protozero::pbf_reader::const_uint32_iterator, protozero::pbf_reader::const_uint32_iterator> geom_itr;
+ GeometryPBF::pbf_itr geom_itr;
bool has_raster = false;
std::unique_ptr<mapnik::image_reader> reader;
while (f.next())
@@ -136,10 +136,10 @@ feature_ptr tile_featureset_pbf<Filter>::next()
case 2:
{
auto tag_iterator = f.get_packed_uint32();
- for (auto _i = tag_iterator.first; _i != tag_iterator.second;)
+ for (auto _i = tag_iterator.begin(); _i != tag_iterator.end();)
{
std::size_t key_name = *(_i++);
- if (_i == tag_iterator.second)
+ if (_i == tag_iterator.end())
{
throw std::runtime_error("Vector Tile has a feature with an odd number of tags, therefore the tile is invalid.");
}
@@ -186,8 +186,8 @@ feature_ptr tile_featureset_pbf<Filter>::next()
throw std::runtime_error("Vector Tile has a feature with multiple raster fields, it must have only one of them");
}
has_raster = true;
- auto image_buffer = f.get_data();
- reader = std::unique_ptr<mapnik::image_reader>(mapnik::get_image_reader(image_buffer.first, image_buffer.second));
+ auto image_buffer = f.get_view();
+ reader = std::unique_ptr<mapnik::image_reader>(mapnik::get_image_reader(image_buffer.data(), image_buffer.size()));
}
break;
case 4:
@@ -306,7 +306,7 @@ feature_ptr tile_featureset_pbf<Filter>::next()
#endif
feature->set_geometry(std::move(geom));
}
- catch (std::exception const& e)
+ catch (std::exception const&)
{
// For v1 any invalid geometry errors lets just skip the feature
continue;
diff --git a/src/vector_tile_geometry_decoder.cpp b/src/vector_tile_geometry_decoder.cpp
index 07cfc39..528f6f5 100644
--- a/src/vector_tile_geometry_decoder.cpp
+++ b/src/vector_tile_geometry_decoder.cpp
@@ -22,6 +22,22 @@ template mapnik::geometry::geometry<std::int64_t> decode_geometry<std::int64_t>(
std::int64_t tile_y,
double scale_x,
double scale_y);
+template mapnik::geometry::geometry<double> decode_geometry<double>(GeometryPBF & paths,
+ int32_t geom_type,
+ unsigned version,
+ double tile_x,
+ double tile_y,
+ double scale_x,
+ double scale_y,
+ mapnik::box2d<double> const& bbox);
+template mapnik::geometry::geometry<std::int64_t> decode_geometry<std::int64_t>(GeometryPBF & paths,
+ int32_t geom_type,
+ unsigned version,
+ std::int64_t tile_x,
+ std::int64_t tile_y,
+ double scale_x,
+ double scale_y,
+ mapnik::box2d<double> const& bbox);
} // end ns vector_tile_impl
diff --git a/src/vector_tile_geometry_decoder.hpp b/src/vector_tile_geometry_decoder.hpp
index 3a1b5de..1e885df 100644
--- a/src/vector_tile_geometry_decoder.hpp
+++ b/src/vector_tile_geometry_decoder.hpp
@@ -31,7 +31,8 @@ class GeometryPBF
{
public:
using value_type = std::int64_t;
- using pbf_itr = std::pair<protozero::pbf_reader::const_uint32_iterator, protozero::pbf_reader::const_uint32_iterator >;
+ using iterator_type = protozero::pbf_reader::const_uint32_iterator;
+ using pbf_itr = protozero::iterator_range<iterator_type>;
explicit GeometryPBF(pbf_itr const& geo_iterator);
@@ -53,7 +54,8 @@ public:
command ring_next(value_type & rx, value_type & ry, bool skip_lineto_zero);
private:
- std::pair< protozero::pbf_reader::const_uint32_iterator, protozero::pbf_reader::const_uint32_iterator > geo_iterator_;
+ iterator_type geo_itr_;
+ iterator_type geo_end_itr_;
value_type x, y;
value_type ox, oy;
uint32_t length;
diff --git a/src/vector_tile_geometry_decoder.ipp b/src/vector_tile_geometry_decoder.ipp
index 3947f13..d4bc43e 100644
--- a/src/vector_tile_geometry_decoder.ipp
+++ b/src/vector_tile_geometry_decoder.ipp
@@ -554,7 +554,8 @@ void decode_polygon(mapnik::geometry::geometry<geom_value_type> & geom,
} // end ns detail
GeometryPBF::GeometryPBF(pbf_itr const& geo_iterator)
- : geo_iterator_(geo_iterator),
+ : geo_itr_(geo_iterator.begin()),
+ geo_end_itr_(geo_iterator.end()),
x(0),
y(0),
ox(0),
@@ -571,9 +572,9 @@ typename GeometryPBF::command GeometryPBF::point_next(value_type & rx, value_typ
{
if (length == 0)
{
- if (geo_iterator_.first != geo_iterator_.second)
+ if (geo_itr_ != geo_end_itr_)
{
- uint32_t cmd_length = static_cast<uint32_t>(*geo_iterator_.first++);
+ uint32_t cmd_length = static_cast<uint32_t>(*geo_itr_++);
cmd = cmd_length & 0x7;
length = cmd_length >> 3;
if (cmd == move_to)
@@ -611,8 +612,8 @@ typename GeometryPBF::command GeometryPBF::point_next(value_type & rx, value_typ
// If an exception occurs it will likely be a end_of_buffer_exception with the text:
// "end of buffer exception"
// While this error message is not verbose a try catch here would slow down processing.
- int32_t dx = protozero::decode_zigzag32(static_cast<uint32_t>(*geo_iterator_.first++));
- int32_t dy = protozero::decode_zigzag32(static_cast<uint32_t>(*geo_iterator_.first++));
+ int32_t dx = protozero::decode_zigzag32(static_cast<uint32_t>(*geo_itr_++));
+ int32_t dy = protozero::decode_zigzag32(static_cast<uint32_t>(*geo_itr_++));
detail::move_cursor(x, y, dx, dy);
rx = x;
ry = y;
@@ -625,9 +626,9 @@ typename GeometryPBF::command GeometryPBF::line_next(value_type & rx,
{
if (length == 0)
{
- if (geo_iterator_.first != geo_iterator_.second)
+ if (geo_itr_ != geo_end_itr_)
{
- uint32_t cmd_length = static_cast<uint32_t>(*geo_iterator_.first++);
+ uint32_t cmd_length = static_cast<uint32_t>(*geo_itr_++);
cmd = cmd_length & 0x7;
length = cmd_length >> 3;
if (cmd == move_to)
@@ -642,8 +643,8 @@ typename GeometryPBF::command GeometryPBF::line_next(value_type & rx,
// If an exception occurs it will likely be a end_of_buffer_exception with the text:
// "end of buffer exception"
// While this error message is not verbose a try catch here would slow down processing.
- int32_t dx = protozero::decode_zigzag32(static_cast<uint32_t>(*geo_iterator_.first++));
- int32_t dy = protozero::decode_zigzag32(static_cast<uint32_t>(*geo_iterator_.first++));
+ int32_t dx = protozero::decode_zigzag32(static_cast<uint32_t>(*geo_itr_++));
+ int32_t dy = protozero::decode_zigzag32(static_cast<uint32_t>(*geo_itr_++));
detail::move_cursor(x, y, dx, dy);
rx = x;
ry = y;
@@ -680,8 +681,8 @@ typename GeometryPBF::command GeometryPBF::line_next(value_type & rx,
// If an exception occurs it will likely be a end_of_buffer_exception with the text:
// "end of buffer exception"
// While this error message is not verbose a try catch here would slow down processing.
- int32_t dx = protozero::decode_zigzag32(static_cast<uint32_t>(*geo_iterator_.first++));
- int32_t dy = protozero::decode_zigzag32(static_cast<uint32_t>(*geo_iterator_.first++));
+ int32_t dx = protozero::decode_zigzag32(static_cast<uint32_t>(*geo_itr_++));
+ int32_t dy = protozero::decode_zigzag32(static_cast<uint32_t>(*geo_itr_++));
if (skip_lineto_zero && dx == 0 && dy == 0)
{
// We are going to skip this vertex as the point doesn't move call line_next again
@@ -699,9 +700,9 @@ typename GeometryPBF::command GeometryPBF::ring_next(value_type & rx,
{
if (length == 0)
{
- if (geo_iterator_.first != geo_iterator_.second)
+ if (geo_itr_ != geo_end_itr_)
{
- uint32_t cmd_length = static_cast<uint32_t>(*geo_iterator_.first++);
+ uint32_t cmd_length = static_cast<uint32_t>(*geo_itr_++);
cmd = cmd_length & 0x7;
length = cmd_length >> 3;
if (cmd == move_to)
@@ -716,8 +717,8 @@ typename GeometryPBF::command GeometryPBF::ring_next(value_type & rx,
// If an exception occurs it will likely be a end_of_buffer_exception with the text:
// "end of buffer exception"
// While this error message is not verbose a try catch here would slow down processing.
- int32_t dx = protozero::decode_zigzag32(static_cast<uint32_t>(*geo_iterator_.first++));
- int32_t dy = protozero::decode_zigzag32(static_cast<uint32_t>(*geo_iterator_.first++));
+ int32_t dx = protozero::decode_zigzag32(static_cast<uint32_t>(*geo_itr_++));
+ int32_t dy = protozero::decode_zigzag32(static_cast<uint32_t>(*geo_itr_++));
detail::move_cursor(x, y, dx, dy);
rx = x;
ry = y;
@@ -759,8 +760,8 @@ typename GeometryPBF::command GeometryPBF::ring_next(value_type & rx,
// If an exception occurs it will likely be a end_of_buffer_exception with the text:
// "end of buffer exception"
// While this error message is not verbose a try catch here would slow down processing.
- int32_t dx = protozero::decode_zigzag32(static_cast<uint32_t>(*geo_iterator_.first++));
- int32_t dy = protozero::decode_zigzag32(static_cast<uint32_t>(*geo_iterator_.first++));
+ int32_t dx = protozero::decode_zigzag32(static_cast<uint32_t>(*geo_itr_++));
+ int32_t dy = protozero::decode_zigzag32(static_cast<uint32_t>(*geo_itr_++));
if (skip_lineto_zero && dx == 0 && dy == 0)
{
// We are going to skip this vertex as the point doesn't move call ring_next again
diff --git a/src/vector_tile_is_valid.hpp b/src/vector_tile_is_valid.hpp
index 18e5266..4198f80 100644
--- a/src/vector_tile_is_valid.hpp
+++ b/src/vector_tile_is_valid.hpp
@@ -201,7 +201,7 @@ inline void feature_is_valid(protozero::pbf_reader & feature_msg,
}
has_raster = true;
++raster_feature_count;
- feature_msg.get_data();
+ feature_msg.get_view();
break;
default:
errors.insert(FEATURE_HAS_UNKNOWN_TAG);
diff --git a/src/vector_tile_load_tile.hpp b/src/vector_tile_load_tile.hpp
index 9cc1d3c..db9d3ed 100644
--- a/src/vector_tile_load_tile.hpp
+++ b/src/vector_tile_load_tile.hpp
@@ -62,8 +62,8 @@ void merge_from_buffer(merc_tile & t, const char * data, std::size_t size, bool
{
case Tile_Encoding::LAYERS:
{
- auto layer_data = tile_msg.get_data();
- protozero::pbf_reader layer_props_msg(layer_data);
+ const auto layer_view = tile_msg.get_view();
+ protozero::pbf_reader layer_props_msg(layer_view);
auto layer_info = get_layer_name_and_version(layer_props_msg);
std::string const& layer_name = layer_info.first;
std::uint32_t version = layer_info.second;
@@ -78,7 +78,7 @@ void merge_from_buffer(merc_tile & t, const char * data, std::size_t size, bool
{
errors.insert(TILE_REPEATED_LAYER_NAMES);
}
- protozero::pbf_reader layer_valid_msg(layer_data);
+ protozero::pbf_reader layer_valid_msg(layer_view);
layer_is_valid(layer_valid_msg, errors);
if (!errors.empty())
{
@@ -94,7 +94,7 @@ void merge_from_buffer(merc_tile & t, const char * data, std::size_t size, bool
if (upgrade && version == 1)
{
// v1 tiles will be converted to v2
- protozero::pbf_reader layer_msg(layer_data);
+ protozero::pbf_reader layer_msg(layer_view);
ds_vec.push_back(std::make_shared<mapnik::vector_tile_impl::tile_datasource_pbf>(
layer_msg,
t.x(),
@@ -104,7 +104,7 @@ void merge_from_buffer(merc_tile & t, const char * data, std::size_t size, bool
}
else
{
- t.append_layer_buffer(layer_data.first, layer_data.second, layer_name);
+ t.append_layer_buffer(layer_view.data(), layer_view.size(), layer_name);
}
}
break;
diff --git a/test/geometry_visual_test.cpp b/test/geometry_visual_test.cpp
index 3c94cf5..a09d9c5 100644
--- a/test/geometry_visual_test.cpp
+++ b/test/geometry_visual_test.cpp
@@ -68,7 +68,7 @@ void clip_geometry(mapnik::Map const& map,
{
protozero::pbf_reader feature_reader = layer_reader.get_message();
int32_t geometry_type = mapnik::vector_tile_impl::Geometry_Type::UNKNOWN;
- std::pair<protozero::pbf_reader::const_uint32_iterator, protozero::pbf_reader::const_uint32_iterator> geom_itr;
+ mapnik::vector_tile_impl::GeometryPBF::pbf_itr geom_itr;
while (feature_reader.next())
{
if (feature_reader.tag() == mapnik::vector_tile_impl::Feature_Encoding::GEOMETRY)
diff --git a/test/unit/load/merge.cpp b/test/unit/load/merge.cpp
index 6579b88..0daa048 100644
--- a/test/unit/load/merge.cpp
+++ b/test/unit/load/merge.cpp
@@ -24,15 +24,15 @@ TEST_CASE( "merge_from_compressed_buffer - vector" )
protozero::pbf_reader tile_msg(tile.get_buffer());
while (tile_msg.next(mapnik::vector_tile_impl::Tile_Encoding::LAYERS))
{
- auto layer_data = tile_msg.get_data();
- protozero::pbf_reader layer_props_msg(layer_data);
+ const auto layer_view = tile_msg.get_view();
+ protozero::pbf_reader layer_props_msg(layer_view);
auto layer_info = mapnik::vector_tile_impl::get_layer_name_and_version(layer_props_msg);
std::string const& layer_name = layer_info.first;
std::uint32_t version = layer_info.second;
CHECK(layer_name == "water");
CHECK(version == 1);
std::set<mapnik::vector_tile_impl::validity_error> errors;
- protozero::pbf_reader layer_valid_msg(layer_data);
+ protozero::pbf_reader layer_valid_msg(layer_view);
layer_is_valid(layer_valid_msg, errors);
CHECK(errors.size() == 0);
}
@@ -51,15 +51,15 @@ TEST_CASE( "merge_from_compressed_buffer - vector" )
protozero::pbf_reader tile_msg(tile2.get_buffer());
while (tile_msg.next(mapnik::vector_tile_impl::Tile_Encoding::LAYERS))
{
- auto layer_data = tile_msg.get_data();
- protozero::pbf_reader layer_props_msg(layer_data);
+ const auto layer_view = tile_msg.get_view();
+ protozero::pbf_reader layer_props_msg(layer_view);
auto layer_info = mapnik::vector_tile_impl::get_layer_name_and_version(layer_props_msg);
std::string const& layer_name = layer_info.first;
std::uint32_t version = layer_info.second;
CHECK(layer_name == "water");
CHECK(version == 2);
std::set<mapnik::vector_tile_impl::validity_error> errors;
- protozero::pbf_reader layer_valid_msg(layer_data);
+ protozero::pbf_reader layer_valid_msg(layer_view);
layer_is_valid(layer_valid_msg, errors);
CHECK(errors.size() == 0);
}
@@ -79,15 +79,15 @@ TEST_CASE( "merge_from_compressed_buffer - raster" )
protozero::pbf_reader tile_msg(tile.get_buffer());
while (tile_msg.next(mapnik::vector_tile_impl::Tile_Encoding::LAYERS))
{
- auto layer_data = tile_msg.get_data();
- protozero::pbf_reader layer_props_msg(layer_data);
+ const auto layer_view = tile_msg.get_view();
+ protozero::pbf_reader layer_props_msg(layer_view);
auto layer_info = mapnik::vector_tile_impl::get_layer_name_and_version(layer_props_msg);
std::string const& layer_name = layer_info.first;
std::uint32_t version = layer_info.second;
CHECK(layer_name == "layer");
CHECK(version == 2);
std::set<mapnik::vector_tile_impl::validity_error> errors;
- protozero::pbf_reader layer_valid_msg(layer_data);
+ protozero::pbf_reader layer_valid_msg(layer_view);
layer_is_valid(layer_valid_msg, errors);
CHECK(errors.size() == 0);
}
diff --git a/test/utils/encoding_util.cpp b/test/utils/encoding_util.cpp
index 6611aee..665bbb9 100644
--- a/test/utils/encoding_util.cpp
+++ b/test/utils/encoding_util.cpp
@@ -65,7 +65,7 @@ std::string compare_pbf(mapnik::geometry::geometry<std::int64_t> const& g, unsig
REQUIRE(mapnik::vector_tile_impl::encode_geometry_pbf(g, feature_writer, x, y));
protozero::pbf_reader feature_reader(feature_str);
int32_t geometry_type = mapnik::vector_tile_impl::Geometry_Type::UNKNOWN;
- std::pair<protozero::pbf_reader::const_uint32_iterator, protozero::pbf_reader::const_uint32_iterator> geom_itr;
+ mapnik::vector_tile_impl::GeometryPBF::pbf_itr geom_itr;
while (feature_reader.next())
{
if (feature_reader.tag() == mapnik::vector_tile_impl::Feature_Encoding::GEOMETRY)
diff --git a/test/utils/round_trip.cpp b/test/utils/round_trip.cpp
index dbf2b1e..25c21ba 100644
--- a/test/utils/round_trip.cpp
+++ b/test/utils/round_trip.cpp
@@ -70,7 +70,7 @@ mapnik::geometry::geometry<double> round_trip(mapnik::geometry::geometry<double>
}
protozero::pbf_reader feature_reader = layer_reader.get_message();
int32_t geometry_type = mapnik::vector_tile_impl::Geometry_Type::UNKNOWN;
- std::pair<protozero::pbf_reader::const_uint32_iterator, protozero::pbf_reader::const_uint32_iterator> geom_itr;
+ mapnik::vector_tile_impl::GeometryPBF::pbf_itr geom_itr;
while (feature_reader.next())
{
if (feature_reader.tag() == mapnik::vector_tile_impl::Feature_Encoding::GEOMETRY)
diff --git a/test/vector_tile.cpp b/test/vector_tile.cpp
index cfe566b..9686102 100644
--- a/test/vector_tile.cpp
+++ b/test/vector_tile.cpp
@@ -71,7 +71,7 @@ TEST_CASE("vector tile from simplified geojson")
REQUIRE(layer_reader.next(mapnik::vector_tile_impl::Layer_Encoding::FEATURES));
protozero::pbf_reader feature_reader = layer_reader.get_message();
int32_t geometry_type = mapnik::vector_tile_impl::Geometry_Type::UNKNOWN;
- std::pair<protozero::pbf_reader::const_uint32_iterator, protozero::pbf_reader::const_uint32_iterator> geom_itr;
+ mapnik::vector_tile_impl::GeometryPBF::pbf_itr geom_itr;
while (feature_reader.next())
{
if (feature_reader.tag() == mapnik::vector_tile_impl::Feature_Encoding::GEOMETRY)
diff --git a/test/vector_tile_pbf.cpp b/test/vector_tile_pbf.cpp
index ce00c7f..8890277 100644
--- a/test/vector_tile_pbf.cpp
+++ b/test/vector_tile_pbf.cpp
@@ -414,7 +414,7 @@ TEST_CASE("pbf vector tile from simplified geojson")
while (!found && pbf_feature.next(4))
{
found = true;
- 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::pbf_itr geom_itr = pbf_feature.get_packed_uint32();
mapnik::vector_tile_impl::GeometryPBF geoms(geom_itr);
auto geom = mapnik::vector_tile_impl::decode_geometry<double>(geoms, f.type(), 2, tile_x, tile_y, scale, -1.0 * scale);
unsigned int n_err = 0;
--
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