[GRASS-dev] Output to Postgis Topology very slow

Moritz Lennert mlennert at club.worldonline.be
Wed May 7 01:23:30 PDT 2014


On 06/05/14 16:28, Rémi Cura wrote:
> Hello everybody,
>
> I'm trying to track why converting from grass 7 vector to postgis
> topology vector is so slow.
> (http://trac.osgeo.org/postgis/ticket/2695), few sec to import it into
> grass , few sec to build topology in grass,*several minutes to push it*
> into PostGIS topology.
>
>
> So far I found that the only sql function used by grass are
> topology.createtopology
> topology.addtopogeometrycolumn
> topology.addnode
> topology.addedge
>
> I replaced the 2 last with empty function (returning 1) and that doesn't
> change the execution time (meaning slowness comes from grass side).
>
> My command lines executed on grass svn 7 on windows XP (server has
> latest postgres postgis geos gdal on ubuntu 12.04 virtual box) are:
>
> v.external.out dsn="PG:host=localhost dbname=test_grass port=5433
> user=postgres password=yourguess" format=PostgreSQL
> options="TOPOLOGY=yes,SCHEMA=test_route_utf8_4,TOPOSCHEMA_NAME=toposchema,TOPOGEOM_NAME=tg,TOPO_TOLERANCE=0.1,TOPO_GEO_ONLY=NO,SIMPLE_FEATURE=NO"
>
> time v.in.ogr dsn="....myshapefile.shp"
> -t output=test --overwrite
>
> _1. Can somebody please confirm that grass is building the topology on
> the vector layer *before* exporting it? (it seems to also build a
> topolgy *after *export)
>
> _2. I am under the impression that the conversion is slow because many
> queries are getting fired instead of few big ones. Is there any way to
> get tables in postgis with exact grass topology data (/point,line,called
> nodes,boundary,centroid,area,face/) to test batch conversion?
>

Have you tried v.out.postgis ?

Moritz



More information about the grass-dev mailing list