Opened 9 years ago

Closed 9 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 by strk, 9 years ago

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

comment:2 by strk, 9 years ago

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 by strk, 9 years ago

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

comment:4 by pramsey, 9 years ago

agreed, I think start/end points are pretty sacrosant

comment:5 by strk, 9 years ago

Paul, are you going to fix this one then ?

comment:6 by pramsey, 9 years ago

Priority: mediumcritical

Yes

comment:7 by pramsey, 9 years ago

Fixed in trunk at r14493

comment:8 by pramsey, 9 years ago

Resolution: fixed
Status: newclosed

Fixed in 2.2 at r14494

Note: See TracTickets for help on using tickets.