<div dir="ltr"><div><div><div><br>Update :<br></div>using v.build dump ,<br>importing it into postgres<br></div>parsing it to reconstitue tables (node, line, node-line_connection_info)<br></div>is about 10 sec(dump) +15 sec (import+parsing).<br>
However if those table are functionnaly equivalent to postgis topology (node, egde), I didn't write the conversion.<br><br>This figures seems to indicate that grass v.out.postgis topology=yes should be about 5+10 sec (not 180 sec).<br>
<br>Is there any way to change the current behaviour to group the insert before sending to data base <br>and/or <br>to just output grass topology table (node_grass, line_grass, area_grass, isle_grass), so I could try batch conversion to postgis_topology?<br>
<br>Cheers,<br>Rémi-C<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-05-07 17:37 GMT+02:00 Rémi Cura <span dir="ltr"><<a href="mailto:remi.cura@gmail.com" target="_blank">remi.cura@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2014-05-07 10:23 GMT+02:00 Moritz Lennert <span dir="ltr"><<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>></span>:<div>
<div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>On 06/05/14 16:28, Rémi Cura wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
Hello everybody,<br>
<br>
I'm trying to track why converting from grass 7 vector to postgis<br>
topology vector is so slow.<br>
(<a href="http://trac.osgeo.org/postgis/ticket/2695" target="_blank">http://trac.osgeo.org/<u></u>postgis/ticket/2695</a>), few sec to import it into<br></div>
grass , few sec to build topology in grass,*several minutes to push it*<div><br>
into PostGIS topology.<br>
<br>
<br>
So far I found that the only sql function used by grass are<br>
topology.createtopology<br>
topology.addtopogeometrycolumn<br>
topology.addnode<br>
topology.addedge<br>
<br>
I replaced the 2 last with empty function (returning 1) and that doesn't<br>
change the execution time (meaning slowness comes from grass side).<br>
<br>
My command lines executed on grass svn 7 on windows XP (server has<br>
latest postgres postgis geos gdal on ubuntu 12.04 virtual box) are:<br>
<br>
v.external.out dsn="PG:host=localhost dbname=test_grass port=5433<br>
user=postgres password=yourguess" format=PostgreSQL<br>
options="TOPOLOGY=yes,SCHEMA=<u></u>test_route_utf8_4,TOPOSCHEMA_<u></u>NAME=toposchema,TOPOGEOM_NAME=<u></u>tg,TOPO_TOLERANCE=0.1,TOPO_<u></u>GEO_ONLY=NO,SIMPLE_FEATURE=NO"<br>
<br>
time v.in.ogr dsn="....myshapefile.shp"<br>
-t output=test --overwrite<br>
<br>
_1. Can somebody please confirm that grass is building the topology on<br></div>
the vector layer *before* exporting it? (it seems to also build a<br>
topolgy *after *export)<div><br>
<br>
_2. I am under the impression that the conversion is slow because many<br>
queries are getting fired instead of few big ones. Is there any way to<br></div>
get tables in postgis with exact grass topology data (/point,line,called<br>
nodes,boundary,centroid,area,<u></u>face/) to test batch conversion?<br>
<br>
</blockquote>
<br>
Have you tried v.out.postgis ?<span><font color="#888888"><br>
<br>
<br>
</font></span></blockquote></div></div></div>Yes of course.<br></div><div class="gmail_extra">I benched the following way :<br></div><div class="gmail_extra"><br>shapefile to postgres table<br>no topology<br><div style="margin-left:40px">
with attributes <br></div><div style="margin-left:40px"><div style="margin-left:40px">grass (v.external.out then v.in.ogr): about 40 sec<br>grass (v.external.out (PG_USE_COPY=YES) then v.in.ogr): about 40 sec<br></div></div>
<div style="margin-left:40px"><div style="margin-left:40px">grass ( v.in.ogr then v.out.postgis ): about 40 sec<br>grass ( v.in.ogr then v.out.ogr (PG_USE_COPY=NO)): about 30 sec<br>grass ( v.in.ogr then v.out.ogr (PG_USE_COPY=YES)): about 4 sec<br>
<br></div></div><div style="margin-left:80px">ogr2ogr (PG_USE_COPY=YES) : 4 sec<br>ogr2ogr (PG_USE_COPY=NO) : 30 sec<br></div><div style="margin-left:80px">shp2pgsql : 3 sec<br><br></div>with topology<br><div style="margin-left:40px">
grass (v.external.out (PG_USE_COPY=YES) then v.in.ogr ) : about 180 sec<br>grass (v.external.out (PG_USE_COPY=NO) then v.in.ogr ) : about 180 sec<br></div><div style="margin-left:40px">grass ( v.in.ogr then v.out.postgis ) same.<br>
<br></div><br></div><div class="gmail_extra">Cheers,<br>Rémi-C<br>
</div><div class="gmail_extra"><div style="margin-left:80px"><br></div></div></div>
</blockquote></div><br></div>