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

From GRASS-Wiki

(Created page with "==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....") |
(→Vector Spatial Analysis) |
||

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. | + | 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. |

d.mon start=x0 | d.mon start=x0 | ||

− | d.vect | + | g.region vect=census_wake2000 |

− | d.vect | + | d.vect census_wake2000 col=blue |

+ | d.vect urbanarea col=red type=boundary | ||

===Vector Union=== | ===Vector Union=== | ||

+ | |||

+ | The following command creates a union (operator <code>or</code>) of the two polygon vectors: | ||

+ | |||

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

+ | |||

+ | with urban_census2000 created as follows. | ||

+ | |||

+ | ===Vector Intersection=== | ||

+ | |||

+ | |||

+ | The following command creates an intersection (operator <code>and</code>) of the two polygon vectors: | ||

+ | |||

+ | v.overlay ain=census_wake2000 bin=urbanarea out=urban_census2000_intersect operator=and | ||

+ | |||

+ | ===Vector Clip=== | ||

+ | |||

+ | |||

+ | The following command clips (cuts out) intersection (operator <code>not</code>) of the two polygon vectors: | ||

+ | |||

+ | v.overlay ain=census_wake2000 bin=urbanarea out=urban_census2000_intersect operator=not |

## Revision as of 07:23, 26 July 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`

For the purposes of these examples, the two datasets that we will use are `urbanarea`

and `census_wake2000`

. All examples are created using the vector datasets in 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

### 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.

### 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

### 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