Learn R Programming

EmissV (version 0.664.5)

lineSource: Distribution of emissions by streets

Description

Create a distribution from sp spatial lines data frame or spatial lines

Usage

lineSource(s, grid, as_raster = F, verbose = T)

Arguments

s

SpatialLinesDataFrame of SpatialLines object

grid

grid object with the grid information

as_raster

output format, TRUE for raster, FALSE for matrix

verbose

display additional information

See Also

gridInfo and rasterSource

Examples

Run this code
# 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