<div dir="ltr"><div><div><div><div>Note you could have directly exported into postgis topology, which is slow but very convenient (stil faster than postgis topology conversion).<br></div>I'm not a grass user,<br></div>from what I understood you have to use the "-l" switch in the command "<b>v.out.postgis</b>"<br><br></div>Glad it helped =)<br></div>Cheers,<br>Rémi-C<br></div><div class="gmail_extra"><br><div class="gmail_quote">2014-11-10 13:56 GMT+01:00 Humberto Cereser Ibanez <span dir="ltr"><<a href="mailto:humberto@pastoraldacrianca.org.br" target="_blank">humberto@pastoraldacrianca.org.br</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I was with the same problem, getting gaps in some adjacent polygons<br>
while trying to simplify polygons with Postgis.<br>
Thank Guillaume / Rémi / Sandro by the contributions.<br>
Illuminated by this thread, I created a script in which I avoided gaps<br>
from the bad polygons. Really the most appropriate tool, GRASS, became<br>
this work easier.<br>
<span class=""><br>
On Fri, 2014-11-07 at 13:14 -0800, Guillaume Drolet wrote:<br>
> I finally finished cleaning my topology, using a mix of SQL commands,<br>
> functions, and also using Sandro's QGIS topology editor plugin.<br>
><br>
> In parallel, I also tried going the GRASS route, importing my original<br>
> shapefile in GRASS and applying the cleaning function (v.clean ...) as<br>
> suggested by Remi. I injected the result into PostGIS and created a<br>
> topology. Most of the 23 slivers were there in the topology so one of two<br>
> things: 1) GRASS didn't fix them (maybe I didn't choose an appropriate<br>
> tolerance) or 2) they were created by PostGIS when building the topology.<br>
</span>Simplifying polygons with QGIS and GRASS<br>
   Note: SRID = 4326<br>
1) Open shapefile in QGIS<br>
2) Create New Mapset<br>
    Import Extent from opened Shapefile<br>
3) Check the smaller area of the polygons involved<br>
    select ST_Area (geo_polygon) from table order by<br>
ST_Area(geo_polygon);<br>
    Smaller area = 0.005471<br>
4) Import shapefile into GRASS<br>
    v.in.ogr dsn = /home/humberto/shapefiles/pr/41MUE250GC_SIR.shp<br>
output = prGrass snap = 0.0001 min_area = 0.004 -o<br>
    Settings of parameters: Snapping threshold for boundaries = 0.0001<br>
and Minimum size of area to be imported (squere units) = 0.004<br>
    Note: The 0.004 value was chosen to allow importing of the smaller<br>
area = 0.005 and all areas greater than it, avoiding any small ring that<br>
would be arising from this importing.<br>
5) Simplify the Shapefile polygon imported<br>
    v.generalize input=prGrass@elimSlivers type=area layer=1 -c<br>
type=boundary method=douglas threshold=0.001 look_ahead=7 reduction=50<br>
slide=0.5 angle_thresh=3 degree_thresh=0 closeness_thresh=0<br>
betweeness_thresh=0 alpha=1.0 beta=1.0 iterations=1<br>
output=prGrassGeneralized<br>
    Settings of parameters: threshold = 0.001<br>
    Note: the threshold value 0.001 was chosen by trial<br>
6) Export the simplified polygon to Postgis<br>
   <a href="http://v.out.ogr.pg.py" target="_blank">v.out.ogr.pg.py</a> input=prGrassGeneralized@elimSlivers type=area<br>
layer=1 olayer=prgeneralized database=simp22 host=127.0.0.1 port=5432<br>
user=name password=nonono<br>
<span class=""><br>
><br>
> Anyway, I got what I finally got what I need, thanks a lot to all of you who<br>
> helped me.<br>
><br>
> I'm gonna ask you one last thing if I may: I want to replace the original<br>
> geom column (i.e. that used to build the topogeom) with a topologically<br>
> correct one, and keep all the associated ecological attributes. Is this the<br>
> right way to do it:<br>
><br>
> UPDATE syshiera.de_20k SET geom = topogeom::geometry; ?<br>
><br>
> Thanks.<br>
><br>
><br>
><br>
> --<br>
> View this message in context: <a href="http://postgis.17.x6.nabble.com/Topology-cannot-delete-slivers-or-gaps-tp5007250p5007286.html" target="_blank">http://postgis.17.x6.nabble.com/Topology-cannot-delete-slivers-or-gaps-tp5007250p5007286.html</a><br>
> Sent from the PostGIS - User mailing list archive at Nabble.com.<br>
> _______________________________________________<br>
> postgis-users mailing list<br>
> <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
> <a 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>
</span>Thanks,<br>
<br>
Humberto<br>
<div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a></div></div></blockquote></div><br></div>