
i'm trying to overlay a grid on a SpatialLines object but over() doesn't work, even if i load rgeos... 
-------- 
library(sp) 
library(rgeos) 

# SPATIAL LINES OBJECT 
tmp_sl <- SpatialLines( 
list( 
Lines( 
list( 
Line(matrix(c(0, 1, 1, 0, 0, 1), 3)) 
), 
ID = 'a' 
) 
) 
) 
plot(tmp_sl, axes = T, col = 'red', lwd = 4) 

# SPATIAL GRID TO COVER IT 
res <- 2^-3 
tmp_grd <- SpatialGrid( 
GridTopology( 
bbox(tmp_sl)[, 'min'], 
rep(res, 2), 
round(apply(bbox(tmp_sl), 1, diff) / res + 1) 
) 
) 
plot(tmp_grd, add = T) 

# DOESN'T WORK... 
over(tmp_grd, tmp_sl) 
# *** END *** 
-------- 


Lee De Cola, PhD, MCP. 
DATA to Insight 
LDECOLA@COMCAST.NET 
Reston, Virginia 
703 709 6972 
571 315 0577 mobile 

	[[alternative HTML version deleted]]

