-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[FEATURE] Around function #238
Comments
Thanks @maellecoursonnais, this has finally worked its way to very high on priority list, and will be done very soon via #199. kkeep an eye on that issue and you'll start to see the commits which implement it. Feel free to help at any stage!! |
@maellecoursonnais thanks again for this. Took a while to get there, but here it is in action, direct from example code of new library (osmdata)
#> Data (c) OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright
packageVersion ("osmdata")
#> [1] `0..1.8.10`
lat <- 53.94542
lon <- -2.52017
key <- "amenity"
value <- "bench"
radius <- 100
opq_around (lon, lat, radius, key, value) |>
osmdata_sf ()
#> Object of class 'osmdata' with:
#> $bbox :
#> $overpass_call : The call submitted to the overpass API
#> $meta : metadata including timestamp and version numbers
#> $osm_points : 'sf' Simple Features Collection with 5 points
#> $osm_lines : NULL
#> $osm_polygons : 'sf' Simple Features Collection with 0 polygons
#> $osm_multilines : NULL
#> $osm_multipolygons : NULL Created on 2021-11-04 by the reprex package (v2.0.1.9000) |
Thank you for the hard work @mpadge! You're making research so much easier! |
Hello,
In the overpass API, it is possible to use the
around
parameter to get nodes, ways or relations that specify a certain criterion under a limited radius (see, e.g., here).For instance, a query that tries to find the closest school within a 400-meter radius around the point with coordinates (48.06435,-1.718673) is
"[out:json][timeout:80];(way(around:400,48.06435,-1.718673)[amenity=school]; node(around:400,48.06428,-1.718692)[amenity=school]; );(._;>;); out;"
It feels like it's not possible to do that with
osmdata
; but it would be a very cool feature to add. I found it okay to find the way to do it, but I find it very hard to turn that into an actually usable dataframe in R, and this is where your (wonderful) package could be helpful!EDIT: I see here that you've started to work on that, so tell me if you need help on this one!
Best,
Maël
The text was updated successfully, but these errors were encountered: