L'objectif est de fournir une API simple afin d'améliorer la sélection d'une adresse physique. L'api reçoit l'adresse rentrée par l'utilisateur, et doit fournir en sortie une liste d'adresse (10 max) possible. Exemples de formats d'adresse différents:
- 2 Lotissement Le Panoramique 1400 L'Abergement-Clémenciat
- 167 rue Alexandre Bérard, Ambérieu-en-Bugey
- Troyes, 13 rue voltaire
All commands must be run from the current path(config,data,srv,env.py,...)
- config/config.yaml contains configurable parameters
- Run Import Data in Elasticsearch : python env.py
- Run API Server : python srv/index.py
- Download on https://bano.openstreetmap.fr/data/ file named "full.sjson.gz"
- Decompress it in the folder "data" with default name "full.sjson" (The file name is configurable in the file config/congi.yaml )
- Run your elasticsearch server
- Run command python env.py to import data into elastic search (This may take a long time because of the size of "full.sjson" )
- Run command python srv/index.py to launch the HTTP Server and querying address
- Python 3.5.*
- Elasticsearch 5.1.*
- Python package : flask,elasticsearch,codecs,json (Run "pip install packagename" )
- GET http://adresse:port/
- return { "elasticsearch": "state of elasticsearch cluster", "start_time": "start_time of server" }
- GET http://adresse:port/adresse?name=your adresse
- { "house_number_find": "number of results find", "query": "your input query", "results": [{ "city": "City Find", "house_number": "", "lat": "", "lon": "", "name": "", "postcode": "", "region": "", "score": "" }]}
- GET http://adresse:port/adresse?name=your adresse&lat=your latitude&lon=your longitude
- { "house_number_find": "number of results find", "query": "your input query", "results": [{ "city": """, "distance": Distance Between input coordinates and find coordinates", "house_number": "", "lat": "", "lon": "", "name": "", "postcode": "", "region": "", "score": "" }]}