[PostGIS] #5862: TopoGeo_add* silently corrupt topology: edge crosses edge, mixed face labeling in ring

PostGIS trac at osgeo.org
Mon Apr 14 02:54:47 PDT 2025


#5862: TopoGeo_add* silently corrupt topology: edge crosses edge, mixed face
labeling in ring
--------------------------------+------------------------
  Reporter:  Lars Aksel Opsahl  |      Owner:  strk
      Type:  defect             |     Status:  new
  Priority:  high               |  Milestone:
 Component:  topology           |    Version:  master
Resolution:                     |   Keywords:  robustness
--------------------------------+------------------------
Comment (by strk):

 The code seems to be miscomputing which edge is encountered going
 clockwise and counter-clockwise around the new node when splitting edge 1.

 [[Image(edgeend.png)]]

 Node 12 is the new split node (pink in figure).

 Edge 2 is the first part of original Edge 2, incoming to node 12 (from
 below).

 Edge 16 is the second part original Edge 2, outgoing from node 12 (going
 to the right).

 Edge 1 is the first part of original Edge 1, incoming to node 12 (from
 above).

 Edge 17 is the second part of original Edge 1, outgoing from node 12
 (going down).

 The almost coincident edges portions are are 17 and 2, but 2 is supposed
 to be on the right of 17 or topology validation would have found an edge
 intersection, which wasn't found.

 From the logs we see that the EdgeStar ordering places 17 before 2, when
 going clockwise:
 {{{
 Star around node 12 has 4 edgeEnds
  EdgeEnd 2 is incoming edge  1, azimuth=0.371830671185702
  EdgeEnd 0 is outgoing edge 16, azimuth=1.60267460060034
  EdgeEnd 3 is outgoing edge 17, azimuth=3.51342332479771
  EdgeEnd 1 is incoming edge  2, azimuth=3.51342332480257
 }}}

 This case seems to be similar to that observed in #5786 - whereas we don't
 know which computation to trust (was ValidateTopology failing to report
 validity upfront ? is it reporting a false invalidity after ?).

 See https://trac.osgeo.org/postgis/ticket/5786#comment:18
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5862#comment:10>
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