hrbrmstr / nominatim

:earth_asia: Tools for Working with the 'Nominatim' API in R
Other
74 stars 20 forks source link

match inputs in osm_geocode() #17

Open will-r-chase opened 5 years ago

will-r-chase commented 5 years ago

Wondering if there's a way to match or include the input query in the output when using osm_geocode(). I have a list of locations which include some junk entries which won't return a result from osm_geocode(), so when I try geocoding the output just removes all the empty returns and I have no way to figure out which output geocode matches which input query.

See an example here: I have 6 queries, but osm_geocode() only returns 4 results. That's fine, but then I have no way to match the output with the input.

library(nominatim)

locations <- c("Paris-Nice", "Toronto, Ontario", "Philadelphia, PA", " Canada much of the time", "Houston, TX", "Grand Rapids, MI ")
geocodes <- osm_geocode(locations, key = "my_key")
kylerove commented 3 years ago

+1 Same issue. For some reason, osm_geocode fails on every variation of "Oklahoma City, OK, USA" and had to manually search through input list to figure out this one didn't return anything.