I am trying to extract data from openstreetmap in R via the osmdata package like so:
extract_data <- function(bbx){
highway_vals <- c("motorway", "trunk", "primary", "secondary")
data <- bbx %>%
opq(timeout = 100) %>%
add_osm_feature(
key = "highway",
value = highway_vals
)
data_of_interest <- list(osm_lines = data$osm_lines, osm_polygons = data$osm_polygons)
data_of_interest
}
As you can see from this function, I am only really interested in the lines and polygons. Is there a way to put this restriction into the query? I already tried to look at available_features() but nothing fit the bill. Though, I have seen here that in principle it should be possible to query by geometry such as "multipolygon".
Especially for large bounding boxes I will inevitably download a huge amount of points, i.e. there is always data$osm_points in the data variable after the query is executed. I believe that this wastes a huge amount of resources (at least the memory that is allocated to the variable data is way larger than the amount that is allocated to data_of_interest) and actually brings me to my download limit quite fast, i.e. I hit the Please check /api/status for the quota of your IP address error.