diff --git a/utils/mapnik-index/mapnik-index.cpp b/utils/mapnik-index/mapnik-index.cpp index a8f367332..7361c05de 100644 --- a/utils/mapnik-index/mapnik-index.cpp +++ b/utils/mapnik-index/mapnik-index.cpp @@ -187,7 +187,11 @@ int main (int argc, char** argv) { std::clog << "processing '" << filename << "' as GeoJSON\n"; auto result = mapnik::detail::process_geojson_file(boxes, filename, validate_features); - if (!result.first) continue; + if (!result.first) + { + std::clog << "Error: failed to process " << filename << std::endl; + continue; + } extent = result.second; } diff --git a/utils/mapnik-index/process_geojson_file.cpp b/utils/mapnik-index/process_geojson_file.cpp index b8f30894c..af9656bee 100644 --- a/utils/mapnik-index/process_geojson_file.cpp +++ b/utils/mapnik-index/process_geojson_file.cpp @@ -44,13 +44,17 @@ namespace { struct feature_validate_callback { - feature_validate_callback() {} + feature_validate_callback(mapnik::box2d const& box) + : box_(box) {} void operator() (mapnik::feature_ptr const& f) const { - auto bbox = f->envelope(); - std::cerr << bbox << std::endl; + if (box_ != f->envelope()) + { + throw std::runtime_error("Bounding boxes mismatch validation feature"); + } } + mapnik::box2d const& box_; }; using base_iterator_type = char const*; @@ -121,7 +125,7 @@ std::pair> process_geojson_file(T & boxes, std::string const& { base_iterator_type feat_itr = start + item.second.first; base_iterator_type feat_end = feat_itr + item.second.second; - feature_validate_callback callback; + feature_validate_callback callback(item.first); bool result = boost::spirit::qi::phrase_parse(feat_itr, feat_end, (fc_grammar) (boost::phoenix::ref(ctx), boost::phoenix::ref(start_id), boost::phoenix::ref(callback)), space);