[postgis-tickets] [PostGIS] #4568: Oversimplification of polygon inner rings in ST_Simplify

PostGIS trac at osgeo.org
Thu Oct 31 02:56:13 PDT 2019


#4568: Oversimplification of polygon inner rings in ST_Simplify
------------------------+---------------------------
 Reporter:  Algunenano  |      Owner:  pramsey
     Type:  defect      |     Status:  new
 Priority:  high        |  Milestone:  PostGIS 3.0.1
Component:  postgis     |    Version:  3.0.x
 Keywords:              |
------------------------+---------------------------
 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

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4568>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list