[GRASS-user] v.out.postgis -l running for hours

Sandro Santilli strk at keybit.net
Tue Nov 18 15:17:33 PST 2014


I've imported a ~1 million small polygons dataset from PostGIS into
GRASS with v.in.ogr, which tool less than 30 minutes and was now
trying to export it into the PostGIS Topology model with v.out.postgis -l.

Unexpectedly this latter step is beeing running for hours and did not
even complete the first part:

GRASS 7.0.0beta3 (world):/usr/src/grass/grass-7.0.0beta3 > time \
v.out.postgis -l input=million_poly_topo1 \
olayer=grass_million_poly_topo1 dsn="PG:dbname=strk" \
olink=pg_million_poly_topo1
Copying features...
  35%

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
15997 strk      20   0 4928752 2.069g 1.578g R  98.5 13.3 280:28.46 postgres: strk strk [local] UPDATE
15994 strk      20   0 2796056 2.506g   7432 S   1.6 16.1  10:07.11 v.out.postgis -l input=million_poly_topo1 olayer=grass_million_poly_topo1 dsn+

On the PostgreSQL side there's no data load visible:

 strk=# select count(*) from grass_million_poly_topo1;
  count
 -------
      0
 (1 row)

 strk=# select topologysummary('topo_grass_million_poly_topo1');
                           topologysummary
 --------------------------------------------------------------------
  Topology topo_grass_million_poly_topo1 (2405), SRID 0, precision 0+
  0 nodes, 0 edges, 0 faces, 0 topogeoms, 1 layers                  +
  Layer 1, type Polygonal (3), 0 topogeoms                          +
   Deploy: public.grass_million_poly_topo1.topo                     +
 
 (1 row)

I guess things are being done in a transaction ?

>From the output table structure it looks like v.out.postgis is also
trying to export simple features (the "geom" field):

 strk=# \d grass_million_poly_topo1
                                Table "public.grass_million_poly_topo1"
  Column |       Type        |                               Modifiers
 --------+-------------------+------------------------------------------------------------------------
  fid    | integer           | not null default nextval('grass_million_poly_topo1_fid_seq'::regclass)
  cat    | integer           |
  value  | integer           |
  geom   | geometry(Polygon) |
  topo   | topogeometry      |
 Indexes:
     "grass_million_poly_topo1_pkey" PRIMARY KEY, btree (fid)
     "grass_million_poly_topo1_cat_idx" btree (cat)
     "grass_million_poly_topo1_geom_idx" gist (geom)
     "public_grass_million_poly_topo1_topo_idx" btree (((topo).id))
 Check constraints:
     "check_topogeom_topo" CHECK ((topo).topology_id = 2405 AND (topo).layer_id = 1 AND (topo).type = 3)

Could that be the cause of the slowness ? Is there a way to disable
conversion to simple-feature, which is already supported by
PostGIS Topology itself ?

Thanks in advance.

--strk;

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html


More information about the grass-user mailing list