I am trying to run the following code to perform a geocode using the geopy package.
import geopandas as gpd
import pandas as pd
import os
from time import sleep
from geopy.geocoders import Nominatim
end = pd.read_csv ('/home/hammer/transfer/coord.csv', sep=';')
from geopy.exc import GeocoderTimedOut
def do_geocode(coor):
try:
return geopy.geocode(coor)
except GeocoderTimedOut:
return do_geocode(coor)
coor = gpd.tools.geocode(end["address"],
provider = "nominatim", user_agent="gis", country_bias="Brazil", timeout=5)
I'd like to do the geocode of 90.000 addresses, though I'm having the timeout problem. Even after using this function above it was a user's suggestion here from the community.
An alternative I thought was to create a container docker from the nominatim. That way I could accomplish as many geocodes as I needed, without suffering from the limitations of the public API.
To create the docker I used this peterevans/nominatim image, available here (https://hub.docker.com/r/peterevans/nominatim/). However I have not found anywhere how I should change in my script to do the geocode from my container. When I try to change the provider parameters, it gives error and says that I can only use the parameters of the package.
Can someone help me with this? Or point me to another possible solution?