[GRASS5] Re: [GRASSLIST:6547] Re: problem importing vector

Hamish hamish_nospam at yahoo.com
Tue Apr 19 22:51:19 EDT 2005


> > I'm new to GRASS (and to GIS).  I'm having trouble importing a
> > vector  file (using v.in.ogr) of the Everglades coastline in
> > Florida, USA. The  coastline is very irregular with many small
> > islands.
> 
> The import of areas can be slow if some features cover big part of the
> map as it this case probably the costline. The reason is that v.in.ogr
> will try to intersect the costline with other features in bounding
> box,  if the box is big, many features must be processed.
> 
> Hamish posted more deatails about the patch.
> 
> You can verify if this is the problem. If you have current CVS version
> of GRASS, try:
> 
> v.in.ogr -c
> v.split
> v.clean tool=break

Ok, I've done this; needed to add a v.type step before and after v.split
as it doesn't support boundaries yet. Also note that it lost the DB
connection during the v.split step, but easy enough to reconnect to
original DB when done.


BEFORE:

time v.in.ogr dsn=`pwd` layer=Coast_islands out=test_pre
real    576m40.151s
user    572m45.630s
sys     2m55.560s


AFTER:

_method_
v.in.ogr -c
v.type type=boundary,line
v.split
v.type type=line,boundary
v.clean tool=break
db.copy
v.db.connect


time v.in.ogr -c dsn=`pwd` layer=Coast_islands out=test_pre
real    2m34.380s
user    1m47.290s
sys     0m42.980s

v.type in=test_pre out=test_pre2 type=boundary,line
v.split in=test_pre2 out=test_pre3 vertices=100
v.type in=test_pre3 out=test_pre4 type=line,boundary
[all fast]

time v.clean in=test_pre4 out=test_pre5 tool=break
real    0m41.982s
user    0m41.310s
sys     0m0.580s

db.copy from_table=test_pre to_table=test_pre5
v.db.connect test_pre5 table=test_pre5
[fast]


9.6 hours -> 3.25 minutes. Not bad, I think you guessed correctly Radim...
[2.8GHz P4, Linux]



Hamish




More information about the grass-dev mailing list