From 65d1c7d1ade9fe7de7c09a240f501e422a500218 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 16 Oct 2015 17:08:17 -0700 Subject: [PATCH] fix # of returned features for toGeoJSON + validation reporters --- src/mapnik_vector_tile.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/mapnik_vector_tile.cpp b/src/mapnik_vector_tile.cpp index 7cb13ba9ec..53ba40c23a 100644 --- a/src/mapnik_vector_tile.cpp +++ b/src/mapnik_vector_tile.cpp @@ -2012,7 +2012,13 @@ bool layer_to_geojson(vector_tile::Tile_Layer const& layer, mapnik::projection wgs84("+init=epsg:4326",true); mapnik::projection merc("+init=epsg:3857",true); mapnik::proj_transform prj_trans(merc,wgs84); - mapnik::query q(ds.envelope()); + // This mega box ensures we capture all features, including those + // outside the tile extent. Geometries outside the tile extent are + // likely when the vtile was created by clipping to a buffered extent + mapnik::query q(mapnik::box2d(std::numeric_limits::lowest(), + std::numeric_limits::lowest(), + std::numeric_limits::max(), + std::numeric_limits::max())); mapnik::layer_descriptor ld = ds.get_descriptor(); for (auto const& item : ld.get_descriptors()) { @@ -4011,7 +4017,10 @@ void layer_not_simple(vector_tile::Tile_Layer const& layer, y, z, width); - mapnik::query q(ds.envelope()); + mapnik::query q(mapnik::box2d(std::numeric_limits::lowest(), + std::numeric_limits::lowest(), + std::numeric_limits::max(), + std::numeric_limits::max())); mapnik::layer_descriptor ld = ds.get_descriptor(); for (auto const& item : ld.get_descriptors()) { @@ -4043,7 +4052,10 @@ void layer_not_valid(vector_tile::Tile_Layer const& layer, y, z, width); - mapnik::query q(ds.envelope()); + mapnik::query q(mapnik::box2d(std::numeric_limits::lowest(), + std::numeric_limits::lowest(), + std::numeric_limits::max(), + std::numeric_limits::max())); mapnik::layer_descriptor ld = ds.get_descriptor(); for (auto const& item : ld.get_descriptors()) {