Skip to content

hexgis/geocoder

Repository files navigation

Geocoder

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.

Available urls:

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 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"
      }
    }
  ]
}

Development

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;

Using Docker

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

About

A django geocoder application based on Nominatim API.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •