Opened 4 years ago

Closed 4 years ago

#3388 closed defect (fixed)

ST_RemoveRepeatedPoints can change endpoint

Reported by: strk Owned by: pramsey
Priority: critical Milestone: PostGIS 2.2.1
Component: postgis Version: 2.2.x
Keywords: Cc:

Description

I don't think ST_RemoveRepeatedPoints should move endpoints. The last point can instead disappear:

=$ select ST_AsText(ST_RemoveRepeatedPoints('LINESTRING(10 0,10 9,10 10)', 2));
       st_astext       
-----------------------
 LINESTRING(10 0,10 9)
(1 row)

Change History (8)

comment:1 Changed 4 years ago by strk

Ok, this is debatable, maybe better discussed on mailing list

comment:2 Changed 4 years ago by strk

Indeed the last point is retained IFF the line is a 2 vertices line:

select ST_AsText(ST_RemoveRepeatedPoints('LINESTRING(10 0,10 1)', 2));
       st_astext       
-----------------------
 LINESTRING(10 0,10 1)
(1 row)

comment:3 Changed 4 years ago by strk

This is even worst on polygon, where the function returns invalid ones. Paul, I think this is important to fix.

comment:4 Changed 4 years ago by pramsey

agreed, I think start/end points are pretty sacrosant

comment:5 Changed 4 years ago by strk

Paul, are you going to fix this one then ?

comment:6 Changed 4 years ago by pramsey

Priority: mediumcritical

Yes

comment:7 Changed 4 years ago by pramsey

Fixed in trunk at r14493

comment:8 Changed 4 years ago by pramsey

Resolution: fixed
Status: newclosed

Fixed in 2.2 at r14494

Note: See TracTickets for help on using tickets.