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

Guillaume Drolet droletguillaume at gmail.com
Fri Oct 31 07:17:48 PDT 2014


Hi!

I'm am turning to you all hoping you'll have some tricks to help with
this problem:

I created a topology for 2290 polygons and populated a topogeom column
using these commands:

SELECT topology.CreateTopology('de_20k_topo', find_srid('syshiera',
'de_20k', 'geom_32198'), 1e-4);
SELECT topology.AddTopoGeometryColumn('de_20k_topo', 'syshiera',
'de_20k', 'topogeom', 'MULTIPOLYGON');

DO $$DECLARE r record;
BEGIN
  FOR r IN SELECT * FROM syshiera.de_20k LOOP
    BEGIN
      UPDATE syshiera.de_20k SET topogeom = toTopoGeom(geom_32198,
'de_20k_topo', 1, 1e-4)
      WHERE gid = r.gid;
    EXCEPTION
      WHEN OTHERS THEN
        RAISE WARNING 'Loading of record % failed: %', r.gid, SQLERRM;
    END;
  END LOOP;
END$$;

-- For testing:
SELECT topology.CopyTopology('de_20k_topo', 'de_20k_topo_tests');


I need to fix 1) extra nodes along edges that are not at an
intersection and 2) sliver polygons.

For cases in 1, I was successful using 'ST_NewEdgeHeal' and a plPgsql script.

For cases in 2, I can remove some slivers with 'ST_RemEdgeModFace' but
some of them I just can't delete:

I get either:

ERROR: TopoGeom 1123 in layer 1 (de_20k_topo_tests.LAYER1.) cannot be
represented healing faces 1514 and 1502

Or, when trying with remove a node with 'topology.ST_NewEdgeHeal':

ERROR:  SQL/MM Spatial exception - other edges connected (3912)

In this particular example, two edges are connected two the same two
nodes, similar to what was discussed here:

http://postgis.17.x6.nabble.com/PostGIS-1955-Exception-when-2-edges-passed-to-ST-ModEdgeHeal-that-are-attached-to-the-same-2-nodes-td4999383.html

But according to that discussion thread, this was fixed in an earlier
version (I'm using topology version 2.1.3).

Maybe my problem is different but I'll need your help to get it
sorted. Here's an example showing the small face (1502) I want remove:

https://dl.dropboxusercontent.com/u/5196336/example1.bmp

Thanks for your help!


More information about the postgis-users mailing list