What I am looking for?
I am looking for a python library with a method/module that gets coordinates and return country name without connect to external API
Why?
I have a pandas df with a lot of rows (much more 10000) and I don't want to send a request for each row.
this want I am doing now:
from geopy.geocoders import ArcGIS
...
...
...
geolocator = ArcGIS(scheme='http')
for index, row in df.iterrows():
if math.isnan(row['latitude']) or math.isnan(row['longitude']):
continue
else:
try:
location = geolocator.reverse((row['latitude'], row['longitude']), timeout=30)
# takes the country
location = str(location)
if len(location.split(",")) == 4:
country = location.split(",")[3][1:]
df.at[index, 'country'] = country
if it possible to send one request for all the rows it still fine