[PostGIS] #5868: Add Function to Detect Valid Polygons with Point Touching Rings

PostGIS trac at osgeo.org
Fri Mar 21 08:10:35 PDT 2025


#5868: Add Function to Detect Valid Polygons with Point Touching Rings
---------------------------+---------------------------
  Reporter:  gravitystorm  |      Owner:  pramsey
      Type:  defect        |     Status:  new
  Priority:  medium        |  Milestone:  PostGIS 3.5.3
 Component:  postgis       |    Version:  3.4.x
Resolution:                |   Keywords:
---------------------------+---------------------------
Comment (by gravitystorm):

 Thanks for looking into this mdavis, and I'm sorry I wasn't clear enough
 about the situation.

 This issue is about valid polygons only, so st_isvalid and st_makevalid
 don't help. Specifically, this is not about polygons with self-touching
 rings, it's about polygons with an inner ring(s) that touch(es) the outer
 ring at one vertex (valid polygon example (i) in https://postgis.net/docs
 /manual-dev/using_postgis_dbmanagement.html#OGC_Validity ).

 Despite being valid, these valid polygons throw an error with certain
 functions, see #5867

 So we have two sub-groups of valid polygons:

 * Group A - valid polygons that work with GC_StraightSkeleton (and similar
 functions)
 * Group B - valid polygons that error with GC_StraightSkeleton (and
 similar functions)

 An example of group A is `POLYGON((0 0, 3 0, 3 3, 0 3, 0 0))` (a square)

 An example of group B is `POLYGON((0 0, 3 0, 3 3, 0 3, 0 0),(0 0, 1 2, 2
 1, 0 0))` (a square with an inner ring that touches at one vertex, which
 despite being valid, still causes the error in those functions).

 {{{
 gis=# select st_straightskeleton(st_geomfromtext('POLYGON((0 0, 3 0, 3 3,
 0 3, 0 0),(0 0, 1 2, 2 1, 0 0))'));
 NOTICE:  During straight_skeleton(A) :
 NOTICE:    with A: POLYGON((0/1 0/1,3/1 0/1,3/1 3/1,0/1 3/1,0/1 0/1),(0/1
 0/1,1/1 2/1,2/1 1/1,0/1 0/1))
 ERROR:  straight skeleton of Polygon with point touching rings is not
 implemented.
 }}}

 So I'm looking for a function that can detect Group B valid polygons, so
 that the function can be used to avoid triggering errors in
 GC_StraightSkeleton.
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5868#comment:4>
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