[PostGIS] #5698: XX000: SQL/MM Spatial exception - point not on edge

PostGIS trac at osgeo.org
Fri Mar 22 09:02:20 PDT 2024


#5698: XX000: SQL/MM Spatial exception - point not on edge
--------------------------------+---------------------------
  Reporter:  Lars Aksel Opsahl  |      Owner:  strk
      Type:  defect             |     Status:  new
  Priority:  medium             |  Milestone:  PostGIS 3.4.3
 Component:  topology           |    Version:  3.4.x
Resolution:                     |   Keywords:
--------------------------------+---------------------------
Comment (by strk):

 Further simplification: it is the addition of the last point of the second
 linestring to trigger the error:
 {{{
 SELECT topology.CreateTopology ('ticket_5698');

 SELECT topology.TopoGeo_addLinestring('ticket_5698','LINESTRING(
 15.796760167740288 69.05714853429149,
 15.795906966300288 69.05725770093837)');

 SELECT topology.TopoGeo_addPoint('ticket_5698',
 'POINT(15.796760167739626 69.05714853429157)');
 }}}

 The incoming point is found to be below computed tolerance from the
 existing edge which wants then to be splitted by it. The code is unable to
 split the edge by the node.

 Interesting, this query shows exactly the same problem:
 {{{
 =# select ST_AsText(ST_Split(
 'LINESTRING(15.796760167740288 69.05714853429149,15.796760167739626
 69.05714853429157,15.795906966300288 69.05725770093837)'::geometry,
 'POINT(15.796760167739626 69.05714853429157)'::geometry));
 st_astext
 ------------------------------------------------------------------------------------------------------------------------------------------------
  GEOMETRYCOLLECTION(LINESTRING(15.796760167740288
 69.05714853429149,15.796760167739626 69.05714853429157,15.795906966300288
 69.05725770093837))
 (1 row)
 }}}

 Even worse:
 {{{
 =# select st_astext(ST_PointN(e,2)), st_astext(st_split(e,st_pointn(e,2)))
 from ( select 'LINESTRING(15.796760167740288
 69.05714853429149,15.796760167739626 69.05714853429157,15.795906966300288
 69.05725770093837)'::geometry e ) foo;
 -[ RECORD 1
 ]---------------------------------------------------------------------------------------------------------------------------------------------
 st_astext | POINT(15.796760167739626 69.05714853429157)
 st_astext | GEOMETRYCOLLECTION(LINESTRING(15.796760167740288
 69.05714853429149,15.796760167739626 69.05714853429157,15.795906966300288
 69.05725770093837))
 }}}

 The above shows how ST_Split is unable to split a 3-vertices line by the
 central vertex.
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5698#comment:7>
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