[postgis-tickets] [PostGIS] #2587: CompoundCurve with empties parses differently from WKB and WKT

PostGIS trac at osgeo.org
Fri Dec 20 14:48:04 PST 2013


#2587: CompoundCurve with empties parses differently from WKB and WKT
---------------------+------------------------------------------------------
 Reporter:  mloskot  |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  medium   |   Milestone:  PostGIS 2.1.2
Component:  postgis  |     Version:  2.1.x        
 Keywords:  wkt,wkb  |  
---------------------+------------------------------------------------------
 Related to [http://lists.osgeo.org/pipermail/postgis-
 devel/2013-December/024020.html WKT/WKB/GeoJSON output always valid input]
 thread, this might seem like a fabricated example, so I'm not sure if
 could be considered as a bug. Here it is:

 PostGIS successfully parses this WKB
 {{{
 010900000002000000010200000000000000010800000000000000
 }}}
 which is equivalent to this WKT
 {{{
 COMPOUNDCURVE(EMPTY,CIRCULARSTRING EMPTY)
 COMPOUNDCURVE(LINESTRING EMPTY,CIRCULARSTRING EMPTY)
 }}}

 But fails, what is expected, to parse that WKT throwing:
 {{{
 ERROR:  incontinuous compound curve
 }}}


 In fact, all combinations of multiple empty components are rejected:
 {{{
 COMPOUNDCURVE (EMPTY, CIRCULARSTRING EMPTY)
 COMPOUNDCURVE (LINESTRING EMPTY, CIRCULARSTRING EMPTY)
 COMPOUNDCURVE (CIRCULARSTRING EMPTY, CIRCULARSTRING EMPTY)
 }}}

 Interestingly, mixing empty with non-empty:
 {{{
 COMPOUNDCURVE(EMPTY, CIRCULARSTRING(1 5,6 2,7 3))
 COMPOUNDCURVE(LINESTRING EMPTY, CIRCULARSTRING(1 5,6 2,7 3))
 COMPOUNDCURVE(CIRCULARSTRING EMPTY, CIRCULARSTRING(1 5,6 2,7 3))
 }}}

 results in different kind of error:
 {{{
 ERROR:  getPoint4d_p: point offset out of range
 }}}

 Shouldn't the last error be:
 {{{
 ERROR:  incontinuous compound curve
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2587>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list