v.what.rast

## NAME

v.what.rast - Uploads raster values at positions of vector points to the table

## KEYWORDS

vector, raster, attribute table

## SYNOPSIS

v.what.rast
v.what.rast help
v.what.rast vector=name raster=string [layer=integer] column=string

### Parameters:

vector=name
  Name of input vector points map for which to edit attribute table
raster=string
  Name of existing raster map to be queried
layer=integer
  Layer number
  Default: 1
column=string
  Column name (will be updated by raster values)

## DESCRIPTION

v.what.rast reads raster value for each point in the vector and updates col column in vector attribute table by this value. The column should be type number (integer, float, double, ... ).
If more points have the same category, attribute value is set to NULL. If raster values is NULL, attribute value is set to NULL.

## EXAMPLE

A) Reading values from raster map at position of vector points, writing these values into column of vector map:

    v.what.rast vect=pnt rast=demf col=valf

B) In case of a vector map without attached attribute table, first one row for each category has to be generated. Then the new table can be populated with values from the raster map query:

    v.db.connect -p vectpoints
    # .. no table yet.

    echo 'create table vectpoints (cat integer, value integer)' | db.execute
    #link new table to vector map:
    v.db.connect table=vectpoints map=vectpoints

    #generate rows for each category:
    v.to.db map=vectpoints option=cat

    #query raster map and write values into vector table:
    v.what.rast vect=vectpoints rast=rastmap col=value

    #verify statistics of uploaded values:
    v.univar map=vectpoints col=value type=point

## SEE ALSO

v.drape, v.what.vect

## AUTHOR

Radim Blazek

Last changed: $Date: 2007/03/20 06:24:52 $

Main index - vector index - Full index