项目作者: hexgis

项目描述 :
A django geocoder application based on Nominatim API.
高级语言: Python
项目地址: git://github.com/hexgis/geocoder.git
创建时间: 2016-12-06T21:22:04Z
项目社区:https://github.com/hexgis/geocoder

开源协议:MIT License

下载


Geocoder

A very simple django application that uses nominatim engine to search locations in OpenStreetMap.

  1. 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.

  1. /search?location
  2. /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:

  1. {
  2. "type":"FeatureCollection",
  3. "features": [
  4. {
  5. "type": "Feature",
  6. "geometry": {
  7. "type":"Point",
  8. "coordinates": [
  9. 10.5525370239731, 52.9689393
  10. ]
  11. },
  12. "properties": {
  13. "name":"mycity, Friedensreich-Hundertwasser-Platz, Veerßen, Uelzen, Niedersachsen, 29525, Deutschland"
  14. }
  15. }
  16. ]
  17. }

Development

Cloning project:

  1. $ git clone http://github.com/dagnaldo/geocoder.git

Install requirements for dev:

  1. $ pip install -r requirements_dev.txt

Apply django migrations:

  1. $ python manage.py migrate

Run tests:

  1. $ python manage.py test

Run project locally:

  1. $ 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

  1. $ docker-compose up