vein (version 0.7.8)

emis_grid: Allocate emissions into a grid

Description

emis_grid allocates emissions proportionally to each grid cell. The process is performed by intersection between geometries and the grid. It means that requires "sr" according with your location for the projection. It is assumed that spobj is a Spatial*DataFrame or an "sf" with the pollutants in data. This function returns an object of class "sf".

Usage

emis_grid(spobj, g, sr, type = "lines")

Arguments

spobj

A spatial dataframe of class "sp" or "sf". When class is "sp" it is transformed to "sf".

g

A grid with class "SpatialPolygonsDataFrame" or "sf".

sr

Spatial reference e.g: 31983. It is required if spobj and g are not projected. Please, see http://spatialreference.org/.

type

type of geometry: "lines" or "points".

Examples

Run this code
# NOT RUN {
{
data(net)
g <- make_grid(net, 1/102.47/2) #500m in degrees
names(net)
netsf <- sf::st_as_sf(net)
netg <- emis_grid(spobj = netsf[, c("ldv", "hdv")], g = g, sr= 31983)
plot(netg["ldv"], axes = TRUE)
plot(netg["hdv"], axes = TRUE)
}
# }

Run the code above in your browser using DataLab