split_emis split street emissions into a grid.

split_emis(net, distance, add_column, verbose = TRUE)

Arguments

net

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

distance

Numeric distance or a grid with class "sf".

add_column

Character indicating name of column of distance. For instance, if distance is an sf object, and you wand to add one extra column to the resulting object.

verbose

Logical, to show more information.

Examples

{ data(net) g <- make_grid(net, 1/102.47/2) #500m in degrees names(net) dim(net) netsf <- sf::st_as_sf(net)[, "ldv"] x <- split_emis(netsf, g) dim(x) g$A <- rep(letters, length = 20)[1:nrow(g)] g$B <- rev(g$A) netsf <- sf::st_as_sf(net)[, c("ldv", "hdv")] xx <- split_emis(netsf, g, add_column = c("A", "B")) }
#> Number of lon points: 23 #> Number of lat points: 19 #> #> Total Emissions 1946.955 kg #> Intersecting
#> although coordinates are longitude/latitude, st_intersection assumes that they are planar
#> Warning: attribute variables are assumed to be spatially constant throughout all geometries
#> Total Emissions 1946.955 kg #> Total Emissions 2095.073 kg #> Intersecting
#> although coordinates are longitude/latitude, st_intersection assumes that they are planar
#> Warning: attribute variables are assumed to be spatially constant throughout all geometries
#> Total Emissions 2095.073 kg #> Adding Column