Difference between revisions of "GRASS 6 Tutorial/Vector spatial analysis"

From GRASS-Wiki
Jump to: navigation, search
(Vector Spatial Analysis)
 
(11 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
==Vector Spatial Analysis==
 
==Vector Spatial Analysis==
  
The following examples demonstrate how basic vector data processing operations, such as overlay, union and clipping can be performed in GRASS 6.4. These operations are all performed using the GRASS module, [http://grass.osgeo.org/grass64/manuals/v.overlay.html <code>v.overlay</code>] For the purposes of these examples, the two datasets that we will use are <code>urbanarea</code> and <code>census_wake2000</code>. All examples are created using the vector datasets in the North Carolina database. [[File:Census and urban.png|thumb|alt=Both vector files in window.|Zoom of input datasets]]
+
The following examples demonstrate how basic vector data processing operations, such as overlay, union and clipping can be performed in GRASS 6.4. These operations are all performed using the GRASS module, [http://grass.osgeo.org/grass64/manuals/v.overlay.html <code>v.overlay</code>], which can either be run using the GUI or from the command-line interface. The following examples are demonstrated using the CLI, using two vector datasets, namely: <code>urbanarea</code> and <code>census_wake2000</code> from the North Carolina database.  
  
 
  d.mon start=x0
 
  d.mon start=x0
Line 8: Line 8:
 
  d.vect urbanarea col=red type=boundary
 
  d.vect urbanarea col=red type=boundary
  
 +
[[File:Census and urban.png|300px|center]]
  
 
===Vector Union===
 
===Vector Union===
Line 16: Line 17:
  
 
with urban_census2000 created as follows.
 
with urban_census2000 created as follows.
 +
 +
[[File: Census_urban_union.png|300px|center]]
  
 
===Vector Intersection===
 
===Vector Intersection===
Line 23: Line 26:
 
   
 
   
 
  v.overlay ain=census_wake2000 bin=urbanarea out=urban_census2000_intersect operator=and
 
  v.overlay ain=census_wake2000 bin=urbanarea out=urban_census2000_intersect operator=and
 +
 +
[[File: Census_urban_intersect.png|300px|center]]
  
 
===Vector Clip===
 
===Vector Clip===
Line 30: Line 35:
 
   
 
   
 
  v.overlay ain=census_wake2000 bin=urbanarea out=urban_census2000_intersect operator=not
 
  v.overlay ain=census_wake2000 bin=urbanarea out=urban_census2000_intersect operator=not
 +
 +
[[File: Census_urban_clip.png|300px|center]]
 +
 +
==Vector Analysis using the GUI==
 +
 +
The above examples can be easily replicated using the <code>v.overlay</code> GUI, available under ''Vector --> Overlay Vector Maps --> Overlay Vector Maps [v.overlay]''. The default tab allows you to select the two vector files (ainput and binput):
 +
 +
[[File: Voverlay_gui.png|300px|center]]
 +
 +
The second tab ('Optional') allows you to specify the vector operator (or, and, not, ...) as well as other options:
 +
 +
[[File: Voverlay_gui2.png|300px|center]]
 +
 +
Once you have made your selections, simply click '''Run'''
 +
 +
 +
 +
 +
[[Category: Tutorial]]

Latest revision as of 01:45, 9 August 2013

Vector Spatial Analysis

The following examples demonstrate how basic vector data processing operations, such as overlay, union and clipping can be performed in GRASS 6.4. These operations are all performed using the GRASS module, v.overlay, which can either be run using the GUI or from the command-line interface. The following examples are demonstrated using the CLI, using two vector datasets, namely: urbanarea and census_wake2000 from the North Carolina database.

d.mon start=x0
g.region vect=census_wake2000 
d.vect census_wake2000 col=blue
d.vect urbanarea col=red type=boundary
Census and urban.png

Vector Union

The following command creates a union (operator or) of the two polygon vectors:

v.overlay ain=census_wake2000 bin=urbanarea out=urban_census2000 operator=or

with urban_census2000 created as follows.

Census urban union.png

Vector Intersection

The following command creates an intersection (operator and) of the two polygon vectors:

v.overlay ain=census_wake2000 bin=urbanarea out=urban_census2000_intersect operator=and
Census urban intersect.png

Vector Clip

The following command clips (cuts out) intersection (operator not) of the two polygon vectors:

v.overlay ain=census_wake2000 bin=urbanarea out=urban_census2000_intersect operator=not
Census urban clip.png

Vector Analysis using the GUI

The above examples can be easily replicated using the v.overlay GUI, available under Vector --> Overlay Vector Maps --> Overlay Vector Maps [v.overlay]. The default tab allows you to select the two vector files (ainput and binput):

Voverlay gui.png

The second tab ('Optional') allows you to specify the vector operator (or, and, not, ...) as well as other options:

Voverlay gui2.png

Once you have made your selections, simply click Run