# NOT RUN {
roads <- osmar::get_osm(osmar::complete_file(),
source = osmar::osmsource_file(paste(system.file("extdata",
package="EmissV"),"/streets.osm.xz",sep="")))
roads <- osmar::as_sp(roads,what = "lines")
d3 <- gridInfo(paste0(system.file("extdata", package = "EmissV"),"/wrfinput_d03"))
roadLength <- lineSource(roads,d3,as_raster=TRUE)
sp::spplot(roadLength, scales = list(draw=TRUE), ylab="Lat", xlab="Lon",main="Length of roads",
sp.layout=list("sp.lines", roads))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab