Opened 6 years ago

Closed 5 years ago

#2165 closed defect (fixed)

ST_NumPoints regression failure with CircularString

Reported by: robe Owned by: pramsey
Priority: medium Milestone: PostGIS 2.0.4
Component: postgis Version: 2.0.x
Keywords: history Cc:

Description

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 |

Change History (5)

comment:1 Changed 6 years ago by pramsey

What do you think about just having the npoints behavior on numpoints?

comment:2 Changed 6 years ago by pramsey

Resolution: fixed
Status: newclosed

Committed gentle back-off to 2.0 at r11527 and trunk at r11528

comment:3 Changed 6 years ago by robe

Keywords: history added

comment:4 Changed 6 years ago by strk

Resolution: fixed
Status: closedreopened

This is missing an entry in the NEWS file

comment:5 Changed 5 years ago by robe

Resolution: fixed
Status: reopenedclosed

I see this in the news file already.

Note: See TracTickets for help on using tickets.