Opened 5 months ago

#5754 new defect

ST_ForcePolygonCCW unexpectedly modifies line geometries

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

Description

In constrast to what the documentation states ("Non-polygonal geometries are returned unchanged"), the function ST_ForcePolygonCCW does modify line geometries.

Consider this SQL:

WITH geom AS ( SELECT ST_GeomFromText(
    'LINESTRING(0 0, 1 1, 2 0, 3 1, 4 0)'
    ) AS geom
)
SELECT ST_AsText(geom), ST_AsText(st_forcepolygonccw(geom)), st_astext(st_forcepolygoncw(st_forcepolygonccw(geom))) FROM geom;

In addition, using ST_ForcePolygonCW on the output of ST_ForcePolygonCCW does not modify the geometry. So I currently have no option to return to the original input line geometry.

Change History (0)

Note: See TracTickets for help on using tickets.