[PostGIS] #5699: ERROR: XX000: SQL/MM Spatial exception - geometry crosses an edge

PostGIS trac at osgeo.org
Mon Mar 25 09:25:34 PDT 2024


#5699: ERROR:  XX000: SQL/MM Spatial exception - geometry crosses an edge
--------------------------------+---------------------------
  Reporter:  Lars Aksel Opsahl  |      Owner:  strk
      Type:  defect             |     Status:  assigned
  Priority:  medium             |  Milestone:  PostGIS 3.4.3
 Component:  topology           |    Version:  3.4.x
Resolution:                     |   Keywords:  robustness
--------------------------------+---------------------------
Comment (by strk):

 Using squared distance, edge2 is confirmed being closer than edge1:
 {{{
 psql:break.sql:10: DEBUG:  [topo/lwgeom_topo.c:_lwt_AddPoint:5079] Edge 2
 squared distance: 0
 psql:break.sql:10: DEBUG:  [topo/lwgeom_topo.c:_lwt_AddPoint:5079] Edge 1
 squared distance: 1.64235648202829e-31
 psql:break.sql:10: DEBUG:  [topo/lwgeom_topo.c:_lwt_AddPoint:5110]
 Splitting edge 2
 }}}

 So what happens here is that edge 1 is indeed crossed by the incoming edge
 because the added node only splits edge 2 and leaves edge 1 untouched,
 with the result that noding in the topology breaks.

 I believe the solution here would be to implement snapping of all edges
 upon inserting a new node, same as with
 https://trac.osgeo.org/postgis/ticket/5310#comment:3 - handling edges
 collapse as needed (the portions of edge1 and edge2 going from the new
 node to their shared node would be equal and thus need to be collapsed
 into one).

 By changing
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5699#comment:5>
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