# NOT RUN {
{
data(net)
data(pc_profile)
data(fkm)
PC_G <- c(33491,22340,24818,31808,46458,28574,24856,28972,37818,49050,87923,
133833,138441,142682,171029,151048,115228,98664,126444,101027,
84771,55864,36306,21079,20138,17439, 7854,2215,656,1262,476,512,
1181, 4991, 3711, 5653, 7039, 5839, 4257,3824, 3068)
pc1 <- my_age(x = net$ldv, y = PC_G, name = "PC")
# Estimation for morning rush hour and local emission factors
lef <- EmissionFactorsList(ef_cetesb("CO", "PC_G"))
E_CO <- emis(veh = pc1,lkm = net$lkm, ef = lef,
profile = 1)
E_CO_STREETS <- emis_post(arra = E_CO, by = "streets", net = net)
g <- make_grid(net, 1/102.47/2) #500m in degrees
gCO <- emis_grid(spobj = E_CO_STREETS, g = g)
gCO$emission <- gCO$V1
#
# }
# NOT RUN {
#do not run
library(osmdata)
library(sf)
osm <- osmdata_sf(
add_osm_feature(
opq(bbox = st_bbox(gCO)),
key = 'highway'))$osm_lines[, c("highway")]
st <- c("motorway", "motorway_link", "trunk", "trunk_link",
"primary", "primary_link", "secondary", "secondary_link",
"tertiary", "tertiary_link")
osm <- osm[osm$highway %in% st, ]
plot(osm, axes = T)
xnet <- grid_emis(osm, gCO)
plot(xnet, axes = T)
# }
# NOT RUN {
}
# }
Run the code above in your browser using DataCamp Workspace