Opened 7 years ago
Closed 7 years ago
#3843 closed defect (fixed)
st_RemoveRepeatedPoints misses duplicate in polygon
Reported by: | crispond | Owned by: | pramsey |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.4.3 |
Component: | postgis | Version: | 2.4.x |
Keywords: | st_RemoveRepeatedPoints | Cc: |
Description
Apologies if this has already been fixed. I couldn't find a reference to it.
st_RemoveRepeatedPoints appears to be removing the first duplicate in a polygon, but not the second. The function works correctly in a linestring, and correctly if you add a third duplicate.
Perhaps, it is due to the small size of the geometry.
--Does not remove point (2 3): select st_astext(st_RemoveRepeatedPoints('POLYGON((0 0,1 1,1 1,2 3,2 3,1 34,0 0))'::geometry)); --Works correctly: select st_astext(st_RemoveRepeatedPoints('LINESTRING(0 0,1 1,1 1,2 3,2 3,1 34,0 0)'::geometry)); --Adding a third repetition also works correctly: select st_astext(st_RemoveRepeatedPoints('POLYGON((0 0,1 1,1 1,2 3,2 3,1 34,1 34,0 0))'::geometry));
Thanks!
-cris
Change History (9)
comment:1 by , 7 years ago
comment:4 by , 7 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Paul,
Were you going to back port this to 2.3.4? Or it will just be a 2.4.0 fix?
comment:5 by , 7 years ago
It was a big enough change and a small enough issue that I wasn't going to back-port it.
comment:6 by , 7 years ago
Milestone: | PostGIS 2.3.4 → PostGIS 2.4.0 |
---|---|
Resolution: | → fixed |
Status: | reopened → closed |
comment:7 by , 7 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Version: | 2.2.x → 2.4.x |
We've found same problem with ST_RemoveRepeatedPoints. This sql fails to drop duplicated node 90.352327 23.79429:
SELECT ST_AsText(ST_RemoveRepeatedPoints('POLYGON((90.352399 23.794183,90.352332 23.79418,90.352327 23.79429,90.352327 23.79429,90.352399 23.794183))'))
But on linestring it works:
SELECT ST_AsText(ST_RemoveRepeatedPoints('LINESTRING(90.352399 23.794183,90.352332 23.79418,90.352327 23.79429,90.352327 23.79429,90.352399 23.794183)'))
Was tested it on:
- "POSTGIS="2.4.1 r16012" PGSQL="100" GEOS="3.6.2-CAPI-1.10.2 4d2925d" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.2.2, released 2017/09/15" LIBXML="2.7.8" LIBJSON="0.12" LIBPROTOBUF="1.2.1" RASTER"
comment:8 by , 7 years ago
I'm seeing it working right on my system on svn trunk
postgis25=# SELECT ST_AsText(ST_RemoveRepeatedPoints('POLYGON((90.352399 23.794183,90.352332 23.79418,90.352327 23.79429,90.352327 23.79429,90.352399 23.794183))')); st_astext ------------------------------------------------------------------------------------------ POLYGON((90.352399 23.794183,90.352332 23.79418,90.352327 23.79429,90.352399 23.794183)) (1 row) postgis25=# SELECT ST_AsText(ST_RemoveRepeatedPoints('LINESTRING(90.352399 23.794183,90.352332 23.79418,90.352327 23.79429,90.352327 23.79429,90.352399 23.794183)')); st_astext ------------------------------------------------------------------------------------------- LINESTRING(90.352399 23.794183,90.352332 23.79418,90.352327 23.79429,90.352399 23.794183) (1 row)
comment:9 by , 7 years ago
Milestone: | PostGIS 2.4.0 → PostGIS 2.4.3 |
---|
comment:10 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Yes, its definitely a function of the minpoints protection for polygons, I'm just not 100% sure why I'm protecting at 5 instead of four, I need think long and hard before I decrement it…