A django geocoder application based on Nominatim API.
A very simple django application that uses nominatim engine to search locations in OpenStreetMap.
Please, check privacy policies for nominatim application and enable your own cache data policies.
The search and reverse urls accept GET
and POST
methods, and will search data in the Nominatim API.
/search?location
/reverse?lat=-12&lon=-53
Examples:curl -X GET localhost:8080/search?location=MyCity
orcurl -X POST localhost:8080/search -d location=MyCity
The response will be:
{
"type":"FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type":"Point",
"coordinates": [
10.5525370239731, 52.9689393
]
},
"properties": {
"name":"mycity, Friedensreich-Hundertwasser-Platz, Veerßen, Uelzen, Niedersachsen, 29525, Deutschland"
}
}
]
}
Cloning project:
$ git clone http://github.com/dagnaldo/geocoder.git
Install requirements for dev:
$ pip install -r requirements_dev.txt
Apply django migrations:
$ python manage.py migrate
Run tests:
$ python manage.py test
Run project locally:
$ python manage.py runserver
Now, by default, the server will be available in http://localhost:8000 that will be possible to see both search and reverse urls;
For docker development, we add a Dockerfile that will help with the applications and containers for development.
The default configurations is available in docker-compose.yaml
file and can be changed according to your development preferences.
Running docker-compose
$ docker-compose up