[R-sig-Geo] raster directions to vectorial lines (Stream to Feature)

Mauricio Zambrano-Bigiarini mauricio.zambrano at jrc.ec.europa.eu
Thu Mar 21 11:20:31 CET 2013


Dear List,

I have a raster file representing flow directions, and I would like to 
know if is there any function for transforming this raster file into a 
vectorial representation (with lines)

The original raster only has 9 possible values:

1: 225 deg (South-West)
2: 270 deg (South)
3: 315 deg (South-East)
4: 180 deg (West)
5: NA (no flow)
6:   0 deg (East)
7: 135 deg (North-West)
8:  90 deg (North)
9:  45 deg (North-East)

I can use the function 'reclassify' provided by the raster package to 
re-class the 9 values into the corresponding decimal degrees.
However, I don't know how to create a line from each cell centre to the 
next cell, following the direction stored in each cell.

My colleagues do this with the 'Stream to Feature' tool of Spatial 
Analyst (ArcGis 10.0, 
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z00000058000000.htm), 
but I would like to do it in R.

I would highly appreciate any ideas about how to carry out this task in R.

Thanks in advance,

Mauricio Zambrano-Bigiarini
-- 
=================================================
Water Resources Unit
Institute for Environment and Sustainability (IES)
Joint Research Centre (JRC), European Commission
TP 261, Via Enrico Fermi 2749, 21027 Ispra (VA), IT
webinfo    : http://floods.jrc.ec.europa.eu/
=================================================
DISCLAIMER:\ "The views expressed are purely those of th...{{dropped:10}}



More information about the R-sig-Geo mailing list