## NAME

v.drape - Convert 2D vector to 3D vector by sampling of elevation raster. Default sampling by nearest neighbor

## KEYWORDS

vector

## SYNOPSIS

v.drape
v.drape help
v.drape input=name [type=string[,string,...]] [rast=string] [method=string] output=name [--overwrite]

### Flags:

--overwrite
  Force overwrite of output files

### Parameters:

input=name
  Name of input vector map
type=string[,string,...]
  Type
  Options: point,centroid,line,boundary,face,kernel
  Default: point,centroid,line,boundary,face,kernel
rast=string
  Elevation raster for height extraction
method=string
  Sampling method
  Options: nearest,bilinear,cubic
  Default: nearest
  nearest: nearest neighbor
  bilinear: bilinear interpolation
  cubic: cubic convolution interpolation
output=name
  Name for output vector map

## DESCRIPTION

v.drape converts 2D vector point or line data into 3D vector format via sampling of an elevation surface. Three sampling algorithms adapted fromv v.sample were incorporated into this module: nearest neighbor, bilinear, and cubic convultion.

## NOTES

Please run beforehand

    g.region vect=2D_vector

and make sure that the extent of the elevation raster is at least as big as the vector to convert.

Additional vertices can be added to the input 2D vector with v.split.

The module can be used in conjunction with v.out.pov and r.out.pov to export a complete set of vector and raster data for display in POVRAY.

## EXAMPLE

Spearfish example:

    g.region -p vect=roads align=elevation.10m
    v.drape in=roads rast=elevation.10m method=bilinear out=roads3d
    v.info roads3d

## POVRAY EXAMPLE

    #setup the region
    g.region vect=roads align=elevation.10m -p
    #export the vector data
    v.drape in=roads out=roads3d rast=elevation.10m
    v.out.pov roads3d out=roads3d.pov
    #export the raster data
    r.out.pov elevation.10m tga=elevation.tga
    r.out.png landcover.30m out=landcover30m.png

    # now write a complete povray-script and launch povray

## ERROR MESSAGES

If the following error message appears

     WARNING: [demname in mapset] - read request for row -1 is outside region
     ERROR: problem reading raster cell file

it indicates that the vector map is spatially larger than the raster map. To avoid this problem, the vector map needs to be clipped to the raster map extent, for example:

    g.region rast=demname
    v.in.region clipbox
    v.overlay ain=clipbox bin=vectmap out=vectmap_clipped op=and
    v.drape vectmap_clipped out=vectdrape rast=demname

Then v.drape should perform the draping.

## SEE ALSO

r.out.pov, v.in.region, v.out.pov, v.overlay, v.split, v.what.rast

## AUTHOR

Dylan Beaudette, University of California at Davis.
Raster sampling routines borrowed from v.sample.

Last changed: $Date: 2007/07/09 15:15:57 $

Main index - vector index - Full index