geopandas.tools.reverse_geocode#

geopandas.tools.reverse_geocode(points, provider=None, **kwargs)[source]#

Reverse geocode a set of points and get a GeoDataFrame of the resulting addresses.

The points

Parameters:
pointslist or Series of Shapely Point objects.

x coordinate is longitude y coordinate is latitude

providerstr or geopy.geocoder (opt)

Specifies geocoding service to use. If none is provided, will use ‘photon’ (see the Photon’s terms of service at: https://photon.komoot.io).

Either the string name used by geopy (as specified in geopy.geocoders.SERVICE_TO_GEOCODER) or a geopy Geocoder instance (e.g., geopy.geocoders.Photon) may be used.

Some providers require additional arguments such as access keys See each geocoder’s specific parameters in geopy.geocoders

Notes

Ensure proper use of the results by consulting the Terms of Service for your provider.

Reverse geocoding requires geopy. Install it using ‘pip install geopy’. See also geopy/geopy

Examples

>>> from shapely.geometry import Point
>>> df = geopandas.tools.reverse_geocode(  
...     [Point(-71.0594869, 42.3584697), Point(-77.0365305, 38.8977332)]
... )
>>> df  
                     geometry                                            address
0  POINT (-71.05941 42.35837)       29 Court Sq, Boston, MA 02108, United States
1  POINT (-77.03641 38.89766)  1600 Pennsylvania Ave NW, Washington, DC 20006...