[postgis-users] postgis topology

Christophe Vergon christophevergon-girtec at orange.fr
Wed Jan 15 01:47:59 PST 2014


Hello,

Is st_geometryN(r.geomp,1)  a valid geometry ?



Ludovic Granjon a écrit :
> Hello (Bonjour Christophe)
>
> I don't use french cadastre, only specific archaelogical data.
>
> Thanks for this, I try but, I don't realy understand how worked 
> topogeo_addpolygon.
> If I do :
>
> CREATE EXTENSION postgis;
> CREATE EXTENSION postgis_topology;
> SET search_path = topology,public;
>
> I import my layer with QGIS
>
> SELECT topology.CreateTopology('ec_topo', 27572);
> SELECT 
> topology.AddTopoGeometryColumn('ec_topo','public','ec','topo_geom','POLYGON');
>
> DO $$DECLARE r record;
> BEGIN
>   FOR r IN SELECT * FROM ec LOOP
>     BEGIN
>     SELECT 
> topology.TopoGeo_AddPolygon('ec_topo',st_geometryn(r.geom,1),1);
>     EXCEPTION
>       WHEN OTHERS THEN
>         RAISE WARNING 'Loading of record % failed: %', r.id, SQLERRM;
>     END;
>   END LOOP;
> END$$;
>
> I have :
> ATTENTION:  Loading of record 1 failed: la requête n'a pas de 
> destination pour les données résultantes
>
> I don't know where I'm wrong
>
> If you have an idea
>
> Thanks
>
> Regards
>
> Ludovic
>
> PS : (si j'avais sur que c'était toi qui répondrait, j'aurai écrit sur 
> nos forums francophone ;-) )
>
> Le 15/01/2014 08:25, Christophe Vergon a écrit :
>> Hello, (bonjour)
>>
>> When you udpdate a topology by using a SET statement if a polygon 
>> intersect an other you will have this error.
>> If you want to create a topology from polygons try to use the 
>> topogeo_addpolygon function, the intersection between two polygons 
>> will be a new face.
>>
>> If, as I mean, you use a french survey "cadastre" data set, it's the 
>> best way to do that.
>>
>>
>>
>> Ludovic Granjon a écrit :
>>> Hi all
>>>
>>> I try to import a polygon layer to postgis and build topology with 
>>> tolerance.
>>> I try something like that
>>>
>>> SELECT CreateTopology('ec_topo2', 27572);
>>> SELECT AddTopoGeometryColumn('ec_topo2', 'public', 'ec', 
>>> 'topogeom2', 'MULTIPOLYGON');
>>> UPDATE ec SET topogeom2 = toTopoGeom(geom, 'ec_topo', 1, 1.0);
>>>
>>> But when I do that, I have
>>>
>>> ********** Erreur **********
>>>
>>> ERREUR: Spatial exception - geometry intersects edge 262
>>> État SQL :P0001
>>> Contexte : fonction PL/pgsql « topogeo_addlinestring », ligne 124 à 
>>> affectation
>>> SQL statement "SELECT array_cat(edges, array_agg(x)) FROM ( select 
>>> topology.TopoGeo_addLinestring(atopology, rec.geom, tol) as x ) as foo"
>>> fonction PL/pgsql « topogeo_addpolygon », ligne 24 à affectation
>>> fonction PL/pgsql « totopogeom », ligne 112 à FOR sur des lignes de 
>>> SELECT
>>> fonction PL/pgsql « totopogeom », ligne 94 à affectation
>>>
>>> I try to modify the tolerance parameter but it still doesn't work
>>>
>>> Have  you a solution for that ?
>>>
>>> Thanks a lot
>>>
>>> Regards
>>>
>>> Ludovic
>>>
>>>
>>>
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at lists.osgeo.org
>>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20140115/47a1b435/attachment.html>


More information about the postgis-users mailing list