Flask app to geocode locations and cache the results.
Using https://developer.here.com/documentation/geocoding-search-api/dev_guide/index.html.
https://developer.here.com/documentation/geocoding-search-api/api-reference-swagger.html
curl -u username:password https://geocode.app.vis.one/\?city=Berlin\&provider\=here\&country\=Deutschland\&state\=Berlin
Two endpoints:
GET https://geocode.app.vis.one/?provider=here&city=Haldensleben&county=B%C3%B6rde&state=Sachsen-Anhalt&country=Deutschland
Returns 400 if no location was found.
POST https://geocode.app.vis.one/
with data in body:
{
"provider": "here",
"locations": [
{
"query": {
"city": "Haldensleben",
"county": "Börde",
"state": "Sachsen-Anhalt",
"country": "Deutschland"
}
}
]
}
NB: Returns 200 even if no location wasn't found (for one item). Iterate over the responding array to verify if matching geo coords were found.
Create keys.txt
and store a HERE API key in it.
docker-compose up
Deploy with Dokku.
sudo dokku run geocode flask resetdb
MIT