[GRASS-user] Clipping shapefiles

Hamish hamish_b at yahoo.com
Fri Sep 12 16:22:14 EDT 2008


Hi Matthew,

> I'm trying to clip a largeish shapefile (100Mb) containing contour  
> lines of a reasonably hilly area, into an area that is about 1/12 of 
> it.  I'm finding v.overlay very slow (in excess of 17 hours on a quad
> core 4GB Windows machine), am I doing something wrong?

v.overlay is just slow. see:
  http://trac.osgeo.org/grass/browser/grass/trunk/doc/vector/TODO#L219
and v.in.ogr note on line 242.

> g.region vect=NZMG_s27
> v.in.region output=cutter type=line --overwrite
> v.overlay ainput=wellington_contours atype=line \
>    binput=cutter output=clipped operator=and


Solution:

during import with v.in.ogr use the spatial=w,s,e,n option to import only
relevant lines, or after import use v.select to crop out only lines which
fully or partly fall into your region. Then clip off fringes if needed
with v.overlay and a box created with v.in.region. It will be much faster
this time.


Hamish
(Dunedin)



      



More information about the grass-user mailing list