[postgis-tickets] [PostGIS] #4758: ERROR: XX000: SQL/MM Spatial exception - geometry crosses edge 2, LOCATION: pg_error, lwgeom_pg.c:250

PostGIS trac at osgeo.org
Thu Sep 24 10:08:14 PDT 2020


#4758: ERROR:  XX000: SQL/MM Spatial exception - geometry crosses edge 2,
LOCATION:  pg_error, lwgeom_pg.c:250
-----------------------+---------------------------
  Reporter:  laopsahl  |      Owner:  pramsey
      Type:  defect    |     Status:  new
  Priority:  medium    |  Milestone:  PostGIS 3.1.0
 Component:  postgis   |    Version:  3.0.x
Resolution:            |   Keywords:
-----------------------+---------------------------

Comment (by strk):

 This patch fixes this case, although I'm afraid it would make the code
 more fragile, due to missing handling of collapsed edges:

 {{{

 diff --git a/liblwgeom/lwgeom_topo.c b/liblwgeom/lwgeom_topo.c
 index 236a292fb..97b3b5aef 100644
 --- a/liblwgeom/lwgeom_topo.c
 +++ b/liblwgeom/lwgeom_topo.c
 @@ -5351,7 +5351,7 @@ _lwt_AddLineEdge( LWT_TOPOLOGY* topo, LWLINE* edge,
 double tol,
      return 0; /* must be empty */
    }
    nid[0] = _lwt_AddPoint( topo, start_point,
 -
 _lwt_minTolerance(lwpoint_as_lwgeom(start_point)),
 +                          tol,
                            handleFaceSplit, &mm );
    lwpoint_free(start_point); /* too late if lwt_AddPoint calls lwerror */
    if ( nid[0] == -1 ) return -1; /* lwerror should have been called */

 }}}

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4758#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