so I am having issues with a road network analysis I am conducting, which is aiamed to look at how far away each park entrance is from each postcode centroid in the London borough of Southwark. However, I have experienced errors in my analysis which have made all of the distances 0, which clearly shouldn't be the case. While I can't pinpoint exactly where the issue lies, one message has shown up which hasn't in past network analysis which I was successful in. I will show the code I ran and the error messages, with the packages I used to extract data
#packages loaded
library(here)
library(magrittr)
library(osmdata)
library(dodgr)
library(sf)
library(expss)
library(tmap)
# Define our bbox coordinates, here our coordinates relate to Southwark
southwark_bbox <- c(-0.121942,51.41078,-0.023347,51.508313)
# Pass our bounding box coordinates into the OverPassQuery (opq) function
osmdata <- opq(bbox = southwark_bbox) %>%
# Pipe this into the add_osm_feature data query function to extract our highways
# Note here, we specify the values we are interested in, omitting motorways
add_osm_feature(key = "highway", value = c("primary", "secondary", "tertiary", "residential",
"path", "footway", "unclassified", "living_street", "pedestrian")) %>%
# And then pipe this into our osmdata_sf object
osmdata_sf()
# Extract our spatial data into variables of their own
# Extract the points, with their osm_id.
southwark_roads_nodes <- osmdata$osm_points[, "osm_id"]
# Extract the lines, with their osm_id, name, type of highway, max speed and
# oneway attributes
southwark_roads_edges <- osmdata$osm_lines[, c("osm_id", "name", "highway", "maxspeed",
"oneway")]
#plotted just to see if Southwark was extracted properly, which it was
plot(southwark_roads_edges)
# Create network graph using are edge data, with the foot weighting profile
southwark_graph <- weight_streetnet(southwark_roads_edges)
it is with the last line of code I put in that i got a message saying "The following highway types are present in data yet lack corresponding weight_profile values: NA,". Am not entirely sure what this means or why it said that. It wasn't an error message as the object was still made, but later on in my analysis it led to each measure reading 0m which is clearly not true. If anyone can guide me on the right direction please do let me know.