Opened 12 years ago

Closed 12 years ago

#1703 closed defect (fixed)

Parse error on WKT for multi with empty elements

Reported by: strk Owned by: pramsey
Priority: medium Milestone: PostGIS 2.0.0
Component: postgis Version: master
Keywords: Cc:


strk=# select ST_summary('010700000002000000010600000002000000010300000000000000010300000001000000050000000000000000003440000000000000000000000000000034400000000000003440000000000000444000000000000034400000000000004440000000000000000000000000000034400000000000000000010100000000000000000024400000000000002440'::geometry);
 GeometryCollection[B] with 2 elements+
   MultiPolygon[] with 2 elements     +
     Polygon[] with 0 rings           +
     Polygon[] with 1 rings           +
    ring 0 has 5 points               +
(1 row)

You can see the first element is MULTIPOLYGON with an EMPTY and a non-EMPTY element.

ST_IsValid returns true on it, but ST_AsText and ST_AsEWKT both given a representation which is not understood correctly on parsing:

 GEOMETRYCOLLECTION(MULTIPOLYGON( EMPTY,((20 0,20 20,40 20,40 0,20 0))),POINT(10 10))

The parser refuses to parse it back:

=# select ST_AsText('010700000002000000010600000002000000010300000000000000010300000001000000050000000000000000003440000000000000000000000000000034400000000000003440000000000000444000000000000034400000000000004440000000000000000000000000000034400000000000000000010100000000000000000024400000000000002440'::geometry)::geometry;
ERROR:  parse error - invalid geometry

I don't think it's fair :)

Change History (1)

comment:1 by pramsey, 12 years ago

Resolution: fixed
Status: newclosed

Wouldn't want to be unfair. r9530

Note: See TracTickets for help on using tickets.