5 Selecting, clipping, unions, intersections

For our clipping example we import the TIGER 2000 urban areas (again within the map package tiger2000_UTM13_nad27.tar.gz for the Spearfish area):

     v.in.ogr dsn=UA_46081_UTM13_nad27.shp out=urban_areas

     d.vect urban_areas

We want to extract all roads which are within the urban areas. For this we use v.select and specify the urban area polygon map and the roads line map as parameters (ainput and binput):

     v.select ain=roads bin=urban_areas out=urban_roads

     d.vect urban_roads col=red

As a second example we want to clip the unified school districts from TIGER2000 to the urban areas which we first import. In this case we have to use a different command which permits us to use polygon maps as input:

     v.in.ogr dsn=tgr46081uni_UTM13_nad27.shp out=school_dist_unified

     v.overlay ain=urban_areas bin=school_dist_unified $\backslash$

               out=urban_school_dist op=and

     d.vect urban_school_dist fcol=yellow

To verify, we can query the newly created map:

     d.what.vect urban_school_dist

There are further methods implemented in these two commands, see the manual pages for details.

To extract data from a single map according to IDs or based on a SQL statement, use v.extract.


© 2005, GDF Hannover bR - Solutions for spatial data analysis and remote sensing