Reverse geocoding as a simple offline service.
For a given latitude,longitude returns the matching country code, the administrative region and the name of the closest city (cities with population of 1000+). Data from the GeoNames project.
Built using reverse-geocoder, an updated version of reverse_geocode.
Execute the microservice container with the following command :
docker run -ti -p 9908:80 msagency/msa-geocoder
$ curl "http://localhost:9908/geocoder?lat=45.5017&lon=-73.5673"
{
"admin1": "Quebec",
"admin2": "Montreal",
"cc": "CA",
"lat": "45.50884",
"lon": "-73.58781",
"name": "Montreal"
}
With a geojson Point :
$ curl -X POST -H "Content-Type: application/json" "http://localhost:9908/geocoder" -d '{
"coordinates": [
15.087,
37.503
],
"type": "Point"
}'
{
"admin1": "Sicily",
"admin2": "Catania",
"cc": "IT",
"lat": "37.49223",
"lon": "15.07041",
"name": "Catania"
}
- GET /geocoder?lat=XX.XX&lon=XX.XX : returns the location data for the given lat, lon
- POST /geocoder : returns the location data for the given geojson Point
- GET /ms/version : returns the version number
- GET /ms/name : returns the name
- GET /ms/readme.md : returns the readme (this file)
- GET /ms/readme.html : returns the readme as html
- GET /swagger/swagger.json : returns the swagger api documentation
- GET /swagger/#/ : returns swagger-ui displaying the api documentation
- GET /nginx/stats.json : returns stats about Nginx
- GET /nginx/stats.html : returns a dashboard displaying the stats from Nginx
A project by the Microservices Agency.