From 2b8226316f04a9a24358e5314224063ab539f315 Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Fri, 10 Aug 2018 21:03:07 +0200 Subject: [PATCH] topojson: fix parsing empty topology --- include/mapnik/json/topojson_grammar_x3_def.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/mapnik/json/topojson_grammar_x3_def.hpp b/include/mapnik/json/topojson_grammar_x3_def.hpp index 54ba23963..87e6fc6f8 100644 --- a/include/mapnik/json/topojson_grammar_x3_def.hpp +++ b/include/mapnik/json/topojson_grammar_x3_def.hpp @@ -276,7 +276,7 @@ using x3::lit; using x3::double_; using x3::int_; using x3::omit; -using x3::char_; + namespace { // import unicode string rule @@ -360,9 +360,13 @@ auto const bbox_def = lit("\"bbox\"") > lit(':') ; +// A topology must have an “objects” member whose value is an object. +// This object may have any number of members, whose value must be a geometry object. auto const objects_def = lit("\"objects\"") > lit(':') > lit('{') - > ((omit[*~char_(':')] > lit(':') > ((geometry_collection[push_collection] | geometry[push_geometry]))) % lit(',')) + > -((omit[json_string] > ':' > ( geometry_collection[push_collection] + | geometry[push_geometry] + )) % ',') > lit('}') ;