Description Usage Arguments Value Examples
Finds the nearest OSM node(s) to a lat/lon coordinate.
1 | osmdata_nearest_nodes(osmarobj, lon, lat, num = 1)
|
osmarobj |
an |
lon |
The longitude |
lat |
The latitude |
num |
The number of points to return |
a list
containing the OSM data pertaining to the points as well
as the computed distances
1 2 3 4 5 6 7 8 | #use extract_highways to get highway data
wv <- prettymapr::searchbbox("wolfville, ns", source="google")
d2 <- osmdata_highways(wv)
#use nearest_nodes to get nearest road names to a location
nearesthwys <- osmdata_nearest_nodes(d2, -64.3557, 45.0857, num=10)
waysdata <- subset(d2, way_ids = nearesthwys$info$way_ids)
waynames <- unique(as.character(waysdata$ways$tags$v[waysdata$ways$tags$k=="name"]))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.