[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
Sun Oct 11 22:10:21 PDT 2020


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

Comment (by laopsahl):

 Replying to [comment:11 strk]:
 > Upon trying to make the patch official I'm even less convinced about the
 patch.
 > The thing is that at that point in code we're expecting the input line
 to have been fully noded, but this is NOT the case. This is the problem.
 I'm not even sure the edge should not be touched, in that vertices have
 more importance over lines, because vertices are what you survey, not
 lines, so if a measurement finds a points in a place, that's more likely
 to exist there.
 > In the case above, attracting the line to the vertex would make the more
 sense to me. Not an easy task to deal with, as it requires implementing
 merge of edges...

 Is it possible to use ST_ClosestPoint in any way to help out with this ?

 When adding the second line with code the below we get the blue point and
 not the red point close by and we can add the last without any error.

 {{{
 select topology.TopoGeo_addLinestring('t4758',
 ST_MakeLine(
 (
 select ST_ClosestPoint(e.geom,p)
 from t4758.edge_data e ,
 ST_MakePoint(11.3832721,60.408194249999994) p
 where ST_DWithin(p,e.geom,1e-06)
 )
 ,
 (
 select ST_ClosestPoint(e.geom,p)
 from t4758.edge_data e ,
 ST_MakePoint(11.38327215,60.4081942) p
 where ST_DWithin(p,e.geom,1e-06)
 )
 )
 ); -- length: 7.071067643283874e-08
     -- distance of start point from first edge: 4.9893601355070966e-09

 }}}

 If it's possible will it then kill the performance ?

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