[postgis-users] ST_CreateTopoGeo

paul.malm at lfv.se paul.malm at lfv.se
Tue Feb 25 05:22:39 PST 2020


Hi,
Where do you mean I can play with the tolerance?
This is what I have done before the ST_createTopoGeo
SELECT topology.CreateTopology('topo1', 4326)";
SELECT topology.ST_CreateTopoGeo('topo1', ST_Collect(geom)) from "countries_first";
Btw, I'm intending to simplify later on in my SQL command list.

SELECT PostGIS_Full_Version():
POSTGIS="2.5.1 r17027" [EXTENSION] PGSQL="110" GEOS="3.7.0-CAPI-1.11.0 3.7.1" SFCGAL="1.3.2" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.2.4, released 2018/03/19" LIBXML="2.7.8" LIBJSON="0.12" LIBPROTOBUF="1.2.1" TOPOLOGY RASTER

-----Ursprungligt meddelande-----
Från: postgis-users [mailto:postgis-users-bounces at lists.osgeo.org] För Sandro Santilli
Skickat: den 25 februari 2020 14:06
Till: PostGIS Users Discussion
Ämne: Re: [postgis-users] ST_CreateTopoGeo

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;
_______________________________________________
postgis-users mailing list
postgis-users at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users


More information about the postgis-users mailing list