If you find this document usefull, please consider ordering a printed hardcopy!
The possibility of intersecting, overlaying or unifying vector data is offered in GRASS by the module v.overlay.
To explain the steps we will use simple examples. We will use a
small VMAP0 dataset of Germany.
This dataset contains political borders, inland waterways, roads
and railways as well as elevation data of Germany which have been
reprojected and prepared for this script by GDF Hannover bR. The
data can also be downloaded at the following website:
http://www.gdf-hannover.de/download.
First the necessary SHAPE data needs to be imported. A new location can automatically be created for the data using the projection information available in the SHAPE files.
# create location from within a GRASS session: v.in.ogr pol_borders.shp out=pol_borders location=germany exit # Re-start with the newly created location: grass60 /home/user/grassdata/germany/PERMANENT v.in.ogr -e dsn=./inlandwaterways .shp out=inlandwaterways v.in.ogr -e dsn=./roads.shp out=roads v.in.ogr -e dsn=./railways.shp out=railways v.in.ogr -e dsn=./heightpoints.shp out=heightpoints
v.overlay ainput=pol_borders binput=inlandwaterways \ output=lakeinborders operator=or
When controlling the resulting map`s attribute table both category values of the input maps are conserved. A joint table was created with each column assigned a corresponding prefix (a_ or b_) indicating, in the columnheader, the source dataset.
When two vector maps are intersected the resulting map only contains those areas which occur in both input maps. All other fields fall out:
v.overlay ainput=pol_borders binput=inlandwaterways \ output=borderswherelakes operator=and
In this case the th resulting map shows that only areas of the inland waterways persist.
Data cutout is the opposite of data union. The resulting map shows the features in ainput not overlayed by features in binput:
v.overlay ainput=pol_borders binput=inlandwaterways \ output=borderswherenolakes operator=not
During the overlay, data features of ainput or binput are adopted as long as ainput is not overlain by binput. The following example shows that the features of the maps inlandwaterways and pol_borders are adopted in the new map bordersoverlakes as long as inlandwaterways is not overlayed by pol_borders.
v.overlay ainput=inlandwaterways binput=pol_borders \ output=bordersoverlakes operator=xor
If you find this document usefull, please consider ordering a printed hardcopy!