Skip to content
Posts
Introduction In the previous post I outlined how to set up a Nominatim server that allows us to find a geolocation for any address on the planet. Now let’s use our newfound power in Django. Again, all code snippets are CC0 so make free use of them. But I’d be very happy if you tell me if you use them for something cool!
Prerquisites You have a working geocoding server or use a public one You have a working django app If you want to do geocoding in a different environment you will still be able to use a lot of the the following examples, just skip the Django-specifics and configure the GEOCODING_API_URL according to your needs.
Introduction Geocoding is the process of translating a text input like Ungewitterweg, Berlin into a location with longitude and latitude such as 52.544022/13.147589. So whenever you search in OpenStreetMap or Google Maps for a location, it does exactly that (and sometimes more, but we don’t focus on that now).
For a pet project of mine (notfellchen.org) I wanted to do exactly that: When a animal is added there to be adopted, the user must input a location that is geocoded and saved with it’s coordinates.