GRASS 5.7: Vector overlay/clipping tutorial

Tutorial HOME | Table of contents
GRASS 5.7 is currently under development. In case the examples described here do not work properly, you are kindly invited to send us further examples and/or code bugfixes/enhancements.

Some vector overlay/clipping examples
To illustrate the GRASS vector overlay/clipping capabilities, we use data from VMAP 0, in particular the political boundaries of Germany. The data set was extracted, reprojected to LatLong/WGS84 and converted to SHAPE with 'ogr2ogr'.
In a LatLong GRASS location we can do:

Import of this SHAPE file:

v.in.ogr polbnda_germany.shp out=polbnda_germany
d.vect polbnda_germany

GRASS vector overlay/clipping example

Digitizing a triangle:

v.digit -n clipmap
d.erase ; d.vect polbnda_germany col=blue
d.vect clipmap col=green

Vector union (OR):

v.overlay ainput=polbnda_germany binput=clipmap output=clipmap_union operator=or -t
d.erase ; d.vect clipmap_union

GRASS vector overlay/clipping example

Vector intersection (AND):

v.overlay ainput=polbnda_germany binput=clipmap output=clipmap_intersection operator=and -t
d.erase ; d.vect clipmap_intersection

GRASS vector overlay/clipping example

Vector cut out: features from polbnda_germany NOT in clipmap (NOT):

v.overlay ainput=polbnda_germany binput=clipmap output=clipmap_not operator=not -t
d.erase ; d.vect clipmap_not

GRASS vector overlay/clipping example

Vector features from either polbnda_germany or clipmap but not those from polbnda_germany overlayed by clipmap (XOR)

v.overlay ainput=polbnda_germany binput=clipmap output=clipmap_xor operator=xor -t
d.erase ; d.vect clipmap_xor

GRASS vector overlay/clipping example

Further Links (related software, SQL reference etc).

© 2003 Markus Neteler
Comments about this page | FAQ | Download | Support | Docs | Programming | Back 5.7 Tutorial Home
Last change: $Date: 2008-03-27 21:31:14 +0000 (Thu, 27 Mar 2008) $