Skip to content

Instantly share code, notes, and snippets.

@DenisCarriere
Last active January 4, 2022 03:05
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DenisCarriere/49cac1c32c2419394c8c9831b4ce163d to your computer and use it in GitHub Desktop.
Save DenisCarriere/49cac1c32c2419394c8c9831b4ce163d to your computer and use it in GitHub Desktop.
Python Geocoder reverse geocoding with OpenStreetMap

You can conduct reverse geocoding using the Python Geocoder library.

Notes: Input for coordinate is using [lat, lng] order.

Python

import geocoder
g = geocoder.osm([45,-75], method='reverse')
{...}

Command Line Interface

$ geocode "[45,-75]" --method reverse --provider osm | jq .
{...}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment