Open Robinlovelace opened 4 years ago
Equivalent code in osmdata
takes 2 seconds!
library(osmdata)
library(sf)
system.time({ # around 2 seconds
n = "louvain-la-neuve"
v = "primary|secondary|cycleway"
louvain = opq(n) %>%
add_osm_feature("highway", v,
value_exact = F) %>%
osmdata_sf()
})
#> user system elapsed
#> 0.125 0.020 1.814
louvain_highway = louvain$osm_lines
plot(louvain_highway)
It's clear that there are many cases when bulk extract download is not the best way to get OSM data. Would be useful to users to know when
osmdata
is quicker.Example: you want cycleways in Louvain-la-Neuve in Belgium. With geofabrik:
Created on 2020-02-06 by the reprex package (v0.3.0)