Skip to content

TheMicroservicesAgency/msa-geocoder

Repository files navigation

msa-geocoder

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.

Quick start

Execute the microservice container with the following command :

docker run -ti -p 9908:80 msagency/msa-geocoder

Example(s)

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

Endpoints

Standard endpoints

About

A project by the Microservices Agency.

About

Reverse geocoding as a simple offline service

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published