topojson grammar - add optional bbox element which is omitted

This commit is contained in:
artemp 2015-03-04 14:52:55 +01:00
parent b2c3598f8d
commit a6f0c30a74

View file

@ -113,13 +113,15 @@ topojson_grammar<Iterator, ErrorHandler>::topojson_grammar()
; ;
geometry_collection = lit('{') geometry_collection = lit('{')
>> lit("\"type\"") >> lit(':') >> lit("\"GeometryCollection\"") >> lit(',') >> lit("\"type\"") >> lit(':') >> lit("\"GeometryCollection\"")
>> lit("\"geometries\"") >> lit(':') >> lit('[') >> -(geometry[push_back(_r1, _1)] % lit(',')) >> -(lit(',') >> omit[bbox])
>> lit(',') >> lit("\"geometries\"") >> lit(':') >> lit('[') >> -(geometry[push_back(_r1, _1)] % lit(','))
>> lit(']') >> lit(']')
>> lit('}') >> lit('}')
; ;
point = lit('{') point = lit('{')
>> lit("\"type\"") >> lit(':') >> lit("\"Point\"") >> lit("\"type\"") >> lit(':') >> lit("\"Point\"")
>> -(lit(',') >> omit[bbox])
>> ((lit(',') >> lit("\"coordinates\"") >> lit(':') >> coordinate) >> ((lit(',') >> lit("\"coordinates\"") >> lit(':') >> coordinate)
^ (lit(',') >> properties) /*^ (lit(',') >> omit[id])*/) ^ (lit(',') >> properties) /*^ (lit(',') >> omit[id])*/)
>> lit('}') >> lit('}')
@ -127,6 +129,7 @@ topojson_grammar<Iterator, ErrorHandler>::topojson_grammar()
multi_point = lit('{') multi_point = lit('{')
>> lit("\"type\"") >> lit(':') >> lit("\"MultiPoint\"") >> lit("\"type\"") >> lit(':') >> lit("\"MultiPoint\"")
>> -(lit(',') >> omit[bbox])
>> ((lit(',') >> lit("\"coordinates\"") >> lit(':') >> ((lit(',') >> lit("\"coordinates\"") >> lit(':')
>> lit('[') >> -(coordinate % lit(',')) >> lit(']')) >> lit('[') >> -(coordinate % lit(',')) >> lit(']'))
^ (lit(',') >> properties) ^ (lit(',') >> omit[id])) ^ (lit(',') >> properties) ^ (lit(',') >> omit[id]))
@ -142,6 +145,7 @@ topojson_grammar<Iterator, ErrorHandler>::topojson_grammar()
multi_linestring = lit('{') multi_linestring = lit('{')
>> lit("\"type\"") >> lit(':') >> lit("\"MultiLineString\"") >> lit("\"type\"") >> lit(':') >> lit("\"MultiLineString\"")
>> -(lit(',') >> omit[bbox])
>> ((lit(',') >> lit("\"arcs\"") >> lit(':') >> lit('[') >> ((lit(',') >> lit("\"arcs\"") >> lit(':') >> lit('[')
>> -((lit('[') >> int_ >> lit(']')) % lit(',')) >> lit(']')) >> -((lit('[') >> int_ >> lit(']')) % lit(',')) >> lit(']'))
^ (lit(',') >> properties) ^ (lit(',') >> omit[id])) ^ (lit(',') >> properties) ^ (lit(',') >> omit[id]))
@ -150,6 +154,7 @@ topojson_grammar<Iterator, ErrorHandler>::topojson_grammar()
polygon = lit('{') polygon = lit('{')
>> lit("\"type\"") >> lit(':') >> lit("\"Polygon\"") >> lit("\"type\"") >> lit(':') >> lit("\"Polygon\"")
>> -(lit(',') >> omit[bbox])
>> ((lit(',') >> lit("\"arcs\"") >> lit(':') >> ((lit(',') >> lit("\"arcs\"") >> lit(':')
>> lit('[') >> -(ring % lit(',')) >> lit(']')) >> lit('[') >> -(ring % lit(',')) >> lit(']'))
^ (lit(',') >> properties) ^ (lit(',') >> omit[id])) ^ (lit(',') >> properties) ^ (lit(',') >> omit[id]))
@ -158,6 +163,7 @@ topojson_grammar<Iterator, ErrorHandler>::topojson_grammar()
multi_polygon = lit('{') multi_polygon = lit('{')
>> lit("\"type\"") >> lit(':') >> lit("\"MultiPolygon\"") >> lit("\"type\"") >> lit(':') >> lit("\"MultiPolygon\"")
>> -(lit(',') >> omit[bbox])
>> ((lit(',') >> lit("\"arcs\"") >> lit(':') >> ((lit(',') >> lit("\"arcs\"") >> lit(':')
>> lit('[') >> lit('[')
>> -((lit('[') >> -(ring % lit(',')) >> lit(']')) % lit(',')) >> -((lit('[') >> -(ring % lit(',')) >> lit(']')) % lit(','))