topojson: fix parsing empty topology
This commit is contained in:
parent
6a3452da96
commit
2b8226316f
1 changed files with 6 additions and 2 deletions
|
@ -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('}')
|
||||
;
|
||||
|
||||
|
|
Loading…
Reference in a new issue