[R-sig-Geo] vertical profile of raster DEM along road (package raster)
Omphalodes Verna
omphalodes.verna at yahoo.com
Thu Mar 21 18:03:50 CET 2013
Dear list.
I am asking for advice for getting verticale profile of DEM along line object. I konw, it is easy for one straight line (distance and extract functions) also with using a combination of GRASS and R ( http://casoilresource.lawr.ucdavis.edu/drupal/node/375 ). Is in R possible to do this.
Thanks to all. OV
Here is a sample code:
library(raster)
library(sp)
set.seed(2)
data(volcano)
r <- raster(volcano)
plot(r)
l1 = cbind(c(seq(0,1 , by = 0.1)), runif(11, 0, 1))
S1 = Lines(list(Line(l1)), ID = "a")
lines(S1, asp = 1, col = "red")
More information about the R-sig-Geo
mailing list