As the option NOMINATIM.search_base allow to change the base url for search it could be done. Below a proposition:
1) Allow search without API key when NOMINATIM.search is not the default:
change the following piece of code (in osm_geocode function)
if (nchar(key) == 0) {
stop("Please provide a openstreet API key")
}
with
if ((getOption("NOMINATIM.search_base")=="http://open.mapquestapi.com/nominatim/v1/search.php")&(nchar(key) == 0)) {
stop("Please provide a MapQuest API key")
}
2) Change " " with "%20" (and not "+")
I suppose that this change does not break anything in mapquest search (not tested in mapquest !)
change the following piece of code (in osm_geocode function)
3) Add the key only when needed
change the following line
params <- sprintf("%s&key=%s", params, key)
with
if (key!="") params <- sprintf("%s&key=%s", params, key)
As I do not use other function in nominatim I don't know if other changes are needed...
Is it possible to allow geocoding from "http://nominatim.openstreetmap.org/search" in osm_geocode ?
As the option NOMINATIM.search_base allow to change the base url for search it could be done. Below a proposition: 1) Allow search without API key when NOMINATIM.search is not the default: change the following piece of code (in osm_geocode function)
with
2) Change
" "
with"%20"
(and not"+"
) I suppose that this change does not break anything in mapquest search (not tested in mapquest !) change the following piece of code (in osm_geocode function)with
3) Add the key only when needed change the following line
params <- sprintf("%s&key=%s", params, key)
withif (key!="") params <- sprintf("%s&key=%s", params, key)
As I do not use other function in nominatim I don't know if other changes are needed...
Thanks Pierre-Andre