From 99617ad71c17b186143779d91396e8f23fbd7f90 Mon Sep 17 00:00:00 2001 From: artemp Date: Fri, 25 Sep 2015 10:43:10 +0100 Subject: [PATCH] spatial_index<...> - use operator>> for reading Value's + update shape_index_featureset --- include/mapnik/util/spatial_index.hpp | 4 ++-- plugins/input/shape/shape_index_featureset.cpp | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/include/mapnik/util/spatial_index.hpp b/include/mapnik/util/spatial_index.hpp index 441bad53d..fd64702fb 100644 --- a/include/mapnik/util/spatial_index.hpp +++ b/include/mapnik/util/spatial_index.hpp @@ -103,8 +103,8 @@ void spatial_index::query_node(Filter const& filter, for (int i = 0; i < num_shapes; ++i) { Value item; - in.read(reinterpret_cast(&item), sizeof(item)); // FIXME : use operator>> - results.push_back(item); + in >> item; + results.push_back(std::move(item)); } int children = read_ndr_integer(in); diff --git a/plugins/input/shape/shape_index_featureset.cpp b/plugins/input/shape/shape_index_featureset.cpp index efc698702..f5084c660 100644 --- a/plugins/input/shape/shape_index_featureset.cpp +++ b/plugins/input/shape/shape_index_featureset.cpp @@ -40,6 +40,15 @@ #include "shape_utils.hpp" #include + +// operator>> needed by mapnik::spatial_index +template +InputStream & operator>>(InputStream & in, std::streampos pos) +{ + in.read(reinterpret_cast(&pos), sizeof(std::streampos)); + return in; +} + using mapnik::feature_factory; template