[postgis-users] ST_CreateTopoGeo

Sandro Santilli strk at kbt.io
Tue Feb 25 05:06:12 PST 2020


On Tue, Feb 25, 2020 at 12:10:07PM +0000, paul.malm at lfv.se wrote:
> 
> Hi,
> I'm running this command:
> SELECT topology.ST_CreateTopoGeo('topo1',ST_Collect("geom")) from "countries_first";
> 
> and are getting this message:
> ERROR: Corrupted topology: adjacent edges 71 and -72 bind different face (36 and 0) CONTEXT: SQL-sats: "SELECT topology.ST_AddEdgeModFace(atopology, snode_id, enode_id, rec.geom)" PL/pgSQL-funktion topology.st_createtopogeo(character varying,geometry) row 151 at PERFORM SQL state: XX000
> 
> I've tried running ST_Makevalid on "countries_first" (polygon layer) before executing ST_CreateTopoGeo
> Is there anyone who has a clue on what is wrong?

It's probably just a robustness issue.

What ST_CreateTopoGeo does, at the moment, is invoking
TopoGeo_AddPoint for each point and TopoGeo_AddLinestring
for each line in your collected input.

You could do the same yourself, to stop on first failure
and see what's wrong. Most of the times  playing a bit with
different tolerances can help get past an hard-to-digest
input.

PS: it helps showing output of `postgis_full_version()` when
    reporting issues

--strk;


More information about the postgis-users mailing list