If you find this document usefull, please consider ordering a printed hardcopy!


Subsections


2 Data intersection, data overlay, data union

The possibility of intersecting, overlaying or unifying vector data is offered in GRASS by the module v.overlay.

Figure 19: VMAP0 data Germany
0.4
\includegraphics[width=0.35\textwidth]{./vmap0ger.eps}

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


1 Data union

Data union is only possible in GRASS if a polygon map is chosen as the input map (parameter ainput). As an example the political borders are joined with the inland waterways:

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.


2 Data intersection

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.


3 Data cutout

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


4 Data overlay

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!


© 2005, GDF Hannover bR - Solutions for spatial data analysis and remote sensing
Last modified: 29-08-2005