[postgis-tickets] [PostGIS] #2165: ST_NumPoints regression failure with CircularString

PostGIS trac at osgeo.org
Sun Jan 6 14:43:06 PST 2013


#2165: ST_NumPoints regression failure with CircularString
---------------------+------------------------------------------------------
 Reporter:  robe     |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  medium   |   Milestone:  PostGIS 2.0.3
Component:  postgis  |     Version:  2.0.x        
 Keywords:           |  
---------------------+------------------------------------------------------
 I know we said that ST_NumPoints along with family of ST_StartPoint,
 ST_EndPoint etc should only work with single linestrings.

 I do think though if I am not mistaken, that OGC considers
 ST_CircularString as a subset of the Linestring family.  In updating
 PostGIS in Action book for Second Edition, CircularString now returns NULL
 where as in 1.5 and below, it used to return a number. The other
 regressions are expected but this one I don't think is.
 Sample query from book:

 {{{
  SELECT type, ST_NPoints(geom) As npoints,
   ST_NumPoints(geom) As numpoints
 FROM (VALUES ('LinestringM' ,
   ST_GeomFromEWKT('LINESTRINGM(1 2 3, 3 4 5, 5 8 7, 6 10 11)')),
  ('Circularstring',
   ST_GeomFromText('CIRCULARSTRING(2.5 2.5, 4.5 2.5, 4.5 4.5)')),
 ('Polygon (Triangle)',
   ST_GeomFromText('POLYGON((0 1,1 -1,-1 -1,0 1))')),
 ('Multilinestring',
   ST_GeomFromText('MULTILINESTRING ((1 2, 3 4, 5 6),
    (10 20, 30 40))')),
 ('Collection', ST_Collect(
   ST_GeomFromText('POLYGON((0 1,1 -1,-1 -1,0 1))'),
    ST_Point(1,3)))
 ) As foo(type, geom);

 }}}


 -- in 1.5
 {{{
         type        | npoints | numpoints
 --------------------+---------+-----------
  LinestringM        |       4 |         4
  Circularstring     |       3 |         3
  Polygon (Triangle) |       4 |
  Multilinestring    |       5 |         3
  Collection         |       5 |
 }}}

 -- in 2.0, 2.1

 {{{
         type        | npoints | numpoints
 --------------------+---------+-----------
  LinestringM        |       4 |         4
  Circularstring     |       3 |
  Polygon (Triangle) |       4 |
  Multilinestring    |       5 |
  Collection         |       5 |
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2165>
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