From aafc5d6d5123c48216619e677a9669edcab992f1 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Mon, 11 Sep 2017 09:48:10 -0700 Subject: [PATCH 1/2] revert accidentally committed change to geobuf plugin --- plugins/input/geobuf/geobuf.hpp | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/plugins/input/geobuf/geobuf.hpp b/plugins/input/geobuf/geobuf.hpp index cf5b5bbb5..55fa25532 100644 --- a/plugins/input/geobuf/geobuf.hpp +++ b/plugins/input/geobuf/geobuf.hpp @@ -83,7 +83,7 @@ struct geobuf : util::noncopyable double precision = std::pow(10,6); bool is_topo = false; bool transformed = false; - //std::size_t lengths = 0; + std::size_t lengths = 0; std::vector keys_; std::vector values_; protozero::pbf_reader reader_; @@ -429,11 +429,6 @@ private: template geometry::multi_line_string read_multi_linestring(T & reader, boost::optional> const& lengths) { - if (!lengths) { - std::clog << "rml not set!\n"; - } else { - std::clog << "rml lengths: " << lengths->size() << "\n"; - } geometry::multi_line_string multi_line; multi_line.reserve(!lengths ? 1 : lengths->size()); auto pi = reader.get_packed_sint64(); @@ -460,11 +455,6 @@ private: geometry::polygon read_polygon(T & reader, boost::optional> const& lengths) { geometry::polygon poly; - if (!lengths) { - std::clog << "rp not set!\n"; - } else { - std::clog << "rp lengths: " << lengths->size() << "\n"; - } poly.reserve(!lengths ? 1 : lengths->size()); auto pi = reader.get_packed_sint64(); if (!lengths) @@ -490,11 +480,6 @@ private: geometry::multi_polygon read_multi_polygon(T & reader, boost::optional> const& lengths) { geometry::multi_polygon multi_poly; - if (!lengths) { - std::clog << "rmp not set!\n"; - } else { - std::clog << "rmp lengths: " << lengths->size() << "\n"; - } if (!lengths) { auto poly = read_polygon(reader, lengths); @@ -539,12 +524,8 @@ private: } case 2: { - std::clog << "here\n"; auto val = read_lengths(reader); - if (!val.empty()) { - std::clog << "lenghts " << val.size() << "\n"; - lengths = std::move(val); - } + if (!val.empty()) lengths = std::move(val); break; } case 3: From e97759d01b32a55423db9b5df09b1888e7a31714 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Mon, 11 Sep 2017 17:54:54 +0100 Subject: [PATCH 2/2] geojson test - require throwing on an empty feature collection (not sure this is correct but needed to preserve 3.0.x behaviour) --- test/unit/datasource/geojson.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/test/unit/datasource/geojson.cpp b/test/unit/datasource/geojson.cpp index 60af00de8..2ed99d9e2 100644 --- a/test/unit/datasource/geojson.cpp +++ b/test/unit/datasource/geojson.cpp @@ -108,14 +108,7 @@ TEST_CASE("geojson") { params["type"] = "geojson"; params["file"] = "./test/data/json/empty_featurecollection.json"; params["cache_features"] = cache_features; - auto ds = mapnik::datasource_cache::instance().create(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 - } + REQUIRE_THROWS(mapnik::datasource_cache::instance().create(params)); } }