tmap/ tmaptools geocode_OSM function error

781 views Asked by At

I have a dataframe of ~ 2050 addresses that I'd like to geocode using the geocode_OSM function. The dataframe (df) has an id column and an address column.

library(tmaptools)
library(tmap)
library(geosphere)
geocoded_addresses <- geocode_OSM(df$address_column, as.data.frame = TRUE)

The code above was working yesterday, but today when I run the same code, I receive the following error:

  cannot open URL 'http://nominatim.openstreetmap.org/search?q=127+Public+Square,+Cleveland,+OH+44114&format=xml&polygon=0&addressdetails=0'

Even if I run a simple line of code, such as geocode_OSM("Milan, Italy") I receive the same error.

Error in download.file(addr[k], destfile = tmpfile, mode = "wb", quiet = TRUE) : 
  cannot open URL 'http://nominatim.openstreetmap.org/search?q=Milan,+Italy&format=xml&polygon=0&addressdetails=0'

Please help me, I have no idea why this isn't working!

This is the only information I've been able to find on this error, but it's not very helpful as there are no umlauts in my file: https://github.com/mtennekes/tmap/issues/66

1

There are 1 answers

0
ra_learns On BEST ANSWER

I resolved this issue myself by simply restarting my computer and logging in again to my VPN. I don't know if this will be useful to others, but it is what resolved this issue for me.