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=-53Examples:
curl -X GET localhost:8080/search?location=MyCity
or
curl -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.gitInstall requirements for dev:
$ pip install -r requirements_dev.txtApply django migrations:
$ python manage.py migrateRun tests:
$ python manage.py testRun project locally:
$ python manage.py runserverNow, 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