[postgis-users] Topology: cannot delete slivers (or gaps)

Sandro Santilli strk at keybit.net
Thu Nov 6 03:17:26 PST 2014


On Wed, Nov 05, 2014 at 03:37:32PM -0800, Guillaume Drolet wrote:

> So the next step is to split edge 6340 about its middle, with the goal of
> then connecting the newly created node with node 4753, thus creating an edge
> where there should be one (i.e. on the light grey line). 
> 
> However, I get the error: *point not on edge* when running ST_ModEdgeSplit.

[...]

> How is one supposed to find a point that IS on an edge?

This is indeed tricky. The easiest way could be adding an explicit node
with TopoGeo_addPoint and a tolerance value large enough. Something like:

  SELECT
    TopoGeo_addPoint('de_20k_topo',
        ST_ClosestPoint(
          e.line, 
          ST_GeomFromText('POINT(-208737.346 811681.163)', 32198)
        ),
        1.0 -- tolerance
    )
  FROM edge e
  WHERE edge_id = 6340;

The query will return the id of the nelwy added node, which would
split edge 6340 if it's closer than 1.0 units from it.

You can verify if the split happened by checking if either
start_node or end_node of edge 6340 are equal to the returned id.

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html


More information about the postgis-users mailing list