Opened 5 years ago
Closed 5 years ago
#4568 closed defect (fixed)
Oversimplification of polygon inner rings in ST_Simplify
Reported by: | Algunenano | Owned by: | Algunenano |
---|---|---|---|
Priority: | high | Milestone: | PostGIS 3.0.1 |
Component: | postgis | Version: | 3.0.x |
Keywords: | Cc: |
Description
Initially reported by Komzpa
I went to far when dropping inner rings of polygons in my optimization of inner rings, you can only drop all inner rings when the outer ring collapse, not when any of them collapse.
Bug example:
Select ST_AsText(ST_Simplify('POLYGON((0 0, 100 0, 100 100, 0 100, 0 0), (20 20, 20 40, 40 40, 40 20, 20 20), (1 1, 1 5, 5 5, 5 1, 1 1))'::geometry, 10)); st_astext ------------------------------------------------------------------------ POLYGON((0 0,100 0,100 100,0 100,0 0),(20 20,20 40,40 40,40 20,20 20))
Same polygon but with the smaller inner ring first:
Select ST_AsText(ST_Simplify('POLYGON((0 0, 100 0, 100 100, 0 100, 0 0), (1 1, 1 5, 5 5, 5 1, 1 1), (20 20, 20 40, 40 40, 40 20, 20 20))'::geometry, 10)); st_astext ---------------------------------------- POLYGON((0 0,100 0,100 100,0 100,0 0)) (1 row)
PR: https://github.com/postgis/postgis/pull/504 Affected 3.0 and master
Note:
See TracTickets
for help on using tickets.
This seems to also explain an fix #4556