[GRASS-user] Re: [R-sig-Geo] comparing raster and vector data with Grass/R

Our primary developer for starspan (I designed the program, but did none of
the coding) has since moved on to bigger and better things, but I would
LOVE to get some help getting starspan cleaned up so it can be a GRASS
add-on. If anyone is interested, please send me an email about it --
ultimately I'd like to write this up for a short paper in Computers and
Geosciences, and I'd be happy to make anyone who wants to take over the
coding aspect a co-author...

--j

(P.S. Email me at greenberg@ucdavis.edu, I need to update my email on this
listserv)

On 3/7/07 12:33 PM, "Roger Bivand" <Roger.Bivand@nhh.no> wrote:

On Wed, 7 Mar 2007, Schmitt Thierry wrote:

I am struggling to overlay spatialLinesDataFrame and
SpatialGridDataFrame. The overlay method doesn't allow me to do so.

There is no overlay method, you would need to write one, or interpolate
points along your lines and overlay the resulting point object on the
raster.

As mentioned by matt, I might have a look at starspan. However, I might
be interested to have some solution within the Grass/R interface

Could I suggest that you try v.to.rast in GRASS, and simply use multiple
rasters? You may need care with the resolution, but in spearfish:

v.to.rast input=roads output=v_roads use=cat

then in R:

library(spgrass6)
sp <- readRAST6(c("v_roads", "elevation.dem"))
summary(sp)
sp1 <- as(sp, "SpatialPixelsDataFrame")
summary(sp1)
sp2 <- sp1[!is.na(sp1$v_roads),]
summary(sp2)
by(sp2$elevation.dem, sp2$v_roads, summary)

which just preserves the raster cells crossed by roads as defined by
v.to.rast.

Hope this helps,

Roger

Thierry

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

--
Jonathan A. Greenberg, PhD
Postdoctoral Scholar
Center for Spatial Technologies and Remote Sensing (CSTARS)
University of California, Davis
One Shields Avenue
The Barn, Room 250N
Davis, CA 95616
Cell: 415-794-5043
AIM: jgrn307
MSN: jgrn307@hotmail.com