You can use ST_IsValid() to know if it is "valid" for postgres. Even best, you can try to see what it looks like in qgis.
Cheers, Rémi-C 2014/1/15 Ludovic Granjon <[email protected]> > Hello > > I think, I can do > SELECT st_geometryN(geom,1) FROM ec; > without error > > I get > > "POLYGON((504935.641400002 2310827.805,504952.193899997 > 2310825.6349,504964.4124 2310824.033,504964.191799998 > 2310823.56,504964.037199996 2310822.9832,504963.987400003 > 2310822.5117,504948.949900001 2310822.7941,504940.407399997 > 2310823.3589,504932.090300001 2310824.5769,504931.797399998 > 2310824.7718,504931.360100001 2310824.9757,504930.894100003 > 2310825.1006,504930.735399999 2310825.1239,504929.7368 > 2310825.2555,504929.7368 2310825.8138,504929.847599998 > 2310828.5646,504935.641400002 2310827.805))" > > Thanks > > Ludovic > > > > Le 15/01/2014 10:47, Christophe Vergon a écrit : > > 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 > [email protected] > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > > > > _______________________________________________ > postgis-users mailing list > [email protected] > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users > > > > > > _______________________________________________ > postgis-users mailing list > [email protected] > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users >
_______________________________________________ postgis-users mailing list [email protected] http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
