Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/meijirestored/location-finder

Simple flask app to return suburb/city/state/country from coordinates
https://github.com/meijirestored/location-finder

flask openstreetmap osm overpass overpass-api

Last synced: about 5 hours ago
JSON representation

Simple flask app to return suburb/city/state/country from coordinates

Awesome Lists containing this project

README

        

# Location Finder

A simple Flask app which returns the country/state/city/suburb name for given coordinates, using OpenStreetMap data.

## Endpoints
- `/lat/lon` : Get local names
- `/lang/lat/lon` : Get names for specified language. See https://wiki.openstreetmap.org/wiki/Names#Localization

## Example request

`/fr/50.843388/4.349016`
```json
{
"city": "Bruxelles",
"country": "Belgique",
"country_code": "BE",
"country_flag": "🇧🇪",
"state": "Bruxelles-Capitale",
"suburb": "Quartier Midi-Lemonnier"
}
```
- If no name was found (most often suburb), empty string is returned.
- Country code is ISO3166-1.

## Caching

This app uses Redis to cache data and thus reduce the amount of Overpass requests.
You can configure Redis or turn caching off in `config.py`.

## Credits
- Data from [OpenStreetMap](https://osm.org)
- Overpass instance used : [Private.coffee](https:///overpass.private.coffee)