<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi<br>
thanks<br>
With <br>
SELECT ST_IsValid(st_geometryN(geom,1)) FROM ec;<br>
all is true<br>
no problem in qgis<br>
<br>
regards<br>
<br>
Ludovic<br>
<br>
Le 15/01/2014 11:04, Rémi Cura a écrit :<br>
</div>
<blockquote
cite="mid:CAJvUf_vFuVkO=r5k2aCmKV1-Cmm9A_r4Asd1Nzz0aVEW1eRaCw@mail.gmail.com"
type="cite">
<div dir="ltr">You can use ST_IsValid() to know if it is "valid"
for postgres.
<div>Even best, you can try to see what it looks like in qgis.</div>
<div><br>
</div>
<div>Cheers,</div>
<div>Rémi-C</div>
</div>
<div class="gmail_extra">
<br>
<br>
<div class="gmail_quote">2014/1/15 Ludovic Granjon <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:ludovic.granjon@u-bourgogne.fr"
target="_blank">ludovic.granjon@u-bourgogne.fr</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div>Hello<br>
<br>
I think, I can do<br>
SELECT st_geometryN(geom,1) FROM ec;<br>
without error<br>
<br>
I get<br>
<br>
"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))"<br>
<br>
Thanks<br>
<br>
Ludovic<br>
<br>
<br>
<br>
Le 15/01/2014 10:47, Christophe Vergon a écrit :<br>
</div>
<div>
<div class="h5">
<blockquote type="cite">
<div>Hello,<br>
<br>
Is st_geometryN(r.geomp,1) a valid geometry ?<br>
<br>
<br>
<br>
Ludovic Granjon a écrit :<br>
</div>
<blockquote type="cite">
<div>Hello (Bonjour Christophe)<br>
<br>
I don't use french cadastre, only specific
archaelogical data.<br>
<br>
Thanks for this, I try but, I don't realy
understand how worked topogeo_addpolygon.<br>
If I do :<br>
<br>
CREATE EXTENSION postgis;<br>
CREATE EXTENSION postgis_topology;<br>
SET search_path = topology,public;<br>
<br>
I import my layer with QGIS<br>
<br>
SELECT topology.CreateTopology('ec_topo',
27572);<br>
SELECT
topology.AddTopoGeometryColumn('ec_topo','public','ec','topo_geom','POLYGON');<br>
<br>
DO $$DECLARE r record;<br>
BEGIN<br>
FOR r IN SELECT * FROM ec LOOP<br>
BEGIN<br>
SELECT
topology.TopoGeo_AddPolygon('ec_topo',st_geometryn(r.geom,1),1);<br>
EXCEPTION<br>
WHEN OTHERS THEN<br>
RAISE WARNING 'Loading of record %
failed: %', <a moz-do-not-send="true"
href="http://r.id" target="_blank">r.id</a>,
SQLERRM;<br>
END;<br>
END LOOP;<br>
END$$;<br>
<br>
I have :<br>
ATTENTION: Loading of record 1 failed: la
requête n'a pas de destination pour les données
résultantes<br>
<br>
I don't know where I'm wrong<br>
<br>
If you have an idea<br>
<br>
Thanks<br>
<br>
Regards<br>
<br>
Ludovic<br>
<br>
PS : (si j'avais sur que c'était toi qui
répondrait, j'aurai écrit sur nos forums
francophone ;-) )<br>
<br>
Le 15/01/2014 08:25, Christophe Vergon a écrit :<br>
</div>
<blockquote type="cite">Hello, (bonjour) <br>
<br>
When you udpdate a topology by using a SET
statement if a polygon intersect an other you
will have this error. <br>
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. <br>
<br>
If, as I mean, you use a french survey
"cadastre" data set, it's the best way to do
that. <br>
<br>
<br>
<br>
Ludovic Granjon a écrit : <br>
<blockquote type="cite">Hi all <br>
<br>
I try to import a polygon layer to postgis and
build topology with tolerance. <br>
I try something like that <br>
<br>
SELECT CreateTopology('ec_topo2', 27572); <br>
SELECT AddTopoGeometryColumn('ec_topo2',
'public', 'ec', 'topogeom2', 'MULTIPOLYGON');
<br>
UPDATE ec SET topogeom2 = toTopoGeom(geom,
'ec_topo', 1, 1.0); <br>
<br>
But when I do that, I have <br>
<br>
********** Erreur ********** <br>
<br>
ERREUR: Spatial exception - geometry
intersects edge 262 <br>
État SQL :P0001 <br>
Contexte : fonction PL/pgsql «
topogeo_addlinestring », ligne 124 à
affectation <br>
SQL statement "SELECT array_cat(edges,
array_agg(x)) FROM ( select
topology.TopoGeo_addLinestring(atopology,
rec.geom, tol) as x ) as foo" <br>
fonction PL/pgsql « topogeo_addpolygon »,
ligne 24 à affectation <br>
fonction PL/pgsql « totopogeom », ligne 112 à
FOR sur des lignes de SELECT <br>
fonction PL/pgsql « totopogeom », ligne 94 à
affectation <br>
<br>
I try to modify the tolerance parameter but it
still doesn't work <br>
<br>
Have you a solution for that ? <br>
<br>
Thanks a lot <br>
<br>
Regards <br>
<br>
Ludovic <br>
<br>
<br>
<br>
_______________________________________________
<br>
postgis-users mailing list <br>
<a moz-do-not-send="true"
href="mailto:postgis-users@lists.osgeo.org"
target="_blank">postgis-users@lists.osgeo.org</a>
<br>
<a moz-do-not-send="true"
href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users"
target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a>
<br>
</blockquote>
<br>
<br>
_______________________________________________
<br>
postgis-users mailing list <br>
<a moz-do-not-send="true"
href="mailto:postgis-users@lists.osgeo.org"
target="_blank">postgis-users@lists.osgeo.org</a>
<br>
<a moz-do-not-send="true"
href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users"
target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a>
<br>
<br>
</blockquote>
<br>
</blockquote>
<br>
</blockquote>
<br>
</div>
</div>
</div>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a moz-do-not-send="true"
href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a moz-do-not-send="true"
href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users"
target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a></pre>
</blockquote>
<br>
</body>
</html>