+ allow empty arrays in "coordinates" property

This commit is contained in:
Artem Pavlenko 2012-06-12 13:55:15 +01:00
parent 49b49362a8
commit 203e0fd392

View file

@ -279,29 +279,29 @@ struct feature_grammar :
;
linestring_coordinates = eps[ _a = new_<geometry_type>(LineString)]
> (points(_a) [push_back(_r1,_a)]
> -(points(_a) [push_back(_r1,_a)]
| eps[cleanup_(_a)][_pass = false])
;
polygon_coordinates = eps[ _a = new_<geometry_type>(Polygon) ]
> ((lit('[')
> points(_a) % lit(',')
> -(points(_a) % lit(','))
> lit(']')) [push_back(_r1,_a)]
| eps[cleanup_(_a)][_pass = false])
;
multipoint_coordinates = lit('[')
> (point_coordinates(_r1) % lit(','))
> -(point_coordinates(_r1) % lit(','))
> lit(']')
;
multilinestring_coordinates = lit('[')
> (linestring_coordinates(_r1) % lit(','))
> -(linestring_coordinates(_r1) % lit(','))
> lit(']')
;
multipolygon_coordinates = lit('[')
> (polygon_coordinates(_r1) % lit(','))
> -(polygon_coordinates(_r1) % lit(','))
> lit(']')
;
@ -309,10 +309,9 @@ struct feature_grammar :
;
// point
point = (lit('[') > double_ > lit(',') > double_ > lit(']')) [push_vertex_(_r1,_r2,_1,_2)];
point = lit('[') > -((double_ > lit(',') > double_)[push_vertex_(_r1,_r2,_1,_2)]) > lit(']');
// points
points = lit('[')[_a = SEG_MOVETO] > point (_a,_r1) % lit(',') [_a = SEG_LINETO] > lit(']');
points = lit('[')[_a = SEG_MOVETO] > -(point (_a,_r1) % lit(',')[_a = SEG_LINETO]) > lit(']');
on_error<fail>
(
feature