Opened 6 days ago

Last modified 5 days ago

#5868 new defect

Add Function to Detect Valid Polygons with Point Touching Rings — at Initial Version

Reported by: gravitystorm Owned by: pramsey
Priority: medium Milestone: PostGIS 3.5.3
Component: postgis Version: 3.4.x
Keywords: Cc: gravitystorm

Description

Certain functions are not implemented for valid polygons with point touching rings (see https://trac.osgeo.org/postgis/ticket/5867).

For some use-cases, it would be handy if there was a function that could be used to detect such polygons ahead of time, in order to handle them separately. I haven't been able to find any existing postgis function that does this, but if I've missed one please let me know.

With such a function, you could choose to ignore these polygons, e.g.

select CG_StraightSkeleton(geom)
  from table
 where !ST_PolygonHasPointTouchingRing(geom)

Alternatively, you could buffer only the geometries that have point touching rings, without buffering the vast majority that don't, e.g.

select CG_StraightSkeleton(
       case when ST_PolygonHasPointTouchingRing(geom)
       then st_buffer(geom, 0.0001)
       else geom
       end)
  from table

Change History (0)

Note: See TracTickets for help on using tickets.