diff --git a/include/mapnik/json/extract_bounding_box_grammar_impl.hpp b/include/mapnik/json/extract_bounding_box_grammar_impl.hpp index 9b66a9c6f..a6d3218cc 100644 --- a/include/mapnik/json/extract_bounding_box_grammar_impl.hpp +++ b/include/mapnik/json/extract_bounding_box_grammar_impl.hpp @@ -65,22 +65,25 @@ extract_bounding_box_grammar::extract_bounding_box_gramm ; features = no_skip[iter_pos[_a = _1]] >> -(lit('{') - >> *((json.key_value - lit("\"features\"")) >> lit(',')) - >> lit("\"features\"") - >> lit(':')) - >> lit('[') >> (feature(_r1,_a) % lit(',')) >> lit(']') + >> *((json.key_value - lit("\"features\"")) >> lit(',')) + >> lit("\"features\"") + >> lit(':')) + >> lit('[') >> (feature(_r1,_a) % lit(',')) >> lit(']') ; feature = raw[lit('{')[_a = 1] - >> *(eps(_a > 0) >> (lit('{')[_a += 1] - | - lit('}')[_a -=1] - | - coords[_b = _1] - | - json.string_ - | - char_))][push_box(_r1, _r2, _b, _1)] + >> *(eps(_a > 0) >> ( + lit("\"FeatureCollection\"") > eps(false) // fail if nested FeatureCollection + | + lit('{')[_a += 1] + | + lit('}')[_a -= 1] + | + coords[_b = _1] + | + json.string_ + | + char_))][push_box(_r1, _r2, _b, _1)] ; coords = lit("\"coordinates\"") diff --git a/utils/mapnik-index/process_geojson_file.cpp b/utils/mapnik-index/process_geojson_file.cpp index 960d9e932..9a9ee9368 100644 --- a/utils/mapnik-index/process_geojson_file.cpp +++ b/utils/mapnik-index/process_geojson_file.cpp @@ -94,7 +94,7 @@ std::pair> process_geojson_file(T & boxes, std::string const& } catch (std::exception const& ex) { - std::clog << "mapnik-index:" << ex.what() << std::endl; + std::clog << "mapnik-index (GeoJSON): " << ex.what() << std::endl; } for (auto const& item : boxes) {