Geocoding¶
- GET /api/geocode/search¶
Renvoie les coordonnées à partir de la localisation (ville) en utilisant l'API Nominatim
Scope :
geocode:read
Exemple de requêtes :
GET /api/geocode/search?city=Paris HTTP/1.1
Exemple de réponses :
renvoyant au moins une localisation :
HTTP/1.1 200 OK Content-Type: application/json { "data": { "locations": [ { "addresstype": "suburb", "coordinates": "48.8588897,2.3200410", "display_name": "Paris, Île-de-France, France métropolitaine", "name": "Paris", "osm_id": "r7444", } ] }, "status": "success" }
renvoyant aucune localisation
HTTP/1.1 200 OK Content-Type: application/json { "data": { "locations": [] }, "status": "success" }
- Paramètres de requête:
city (string) -- localisation
language (string) -- preferred language for Nominatim results
- En-têtes de requête:
Authorization -- Jeton 'OAuth 2.0 Bearer'
- Codes d'état:
200 OK --
success
provide a valid auth token
signature expired, please log in again
invalid token, please log in again
you do not have permissions
you do not have permissions, your account is suspended
error when getting coordinates from location
- GET /api/geocode/lookup¶
Renvoie la localisation à partir de l'identifiant OSM en utilisant l'API Nominatim
Scope :
geocode:read
Exemple de requêtes :
GET /api/geocode/lookup?osm_id=r71525 HTTP/1.1
Exemple de réponses :
renvoyant une localisation
HTTP/1.1 200 OK Content-Type: application/json { "data": { "location": { "addresstype": "suburb", "coordinates": "48.8588897,2.3200410", "display_name": "Paris, Île-de-France, France métropolitaine", "name": "Paris", "osm_id": "r7444", } }, "status": "success" }
renvoyant aucune localisation
HTTP/1.1 200 OK Content-Type: application/json { "data": { "location": {} }, "status": "success" }
- Paramètres de requête:
osm_id (string) -- identifiant OSM préfixé par le type de localisation
language (string) -- preferred language for Nominatim results
- En-têtes de requête:
Authorization -- Jeton 'OAuth 2.0 Bearer'
- Codes d'état:
200 OK --
success
provide a valid auth token
signature expired, please log in again
invalid token, please log in again
you do not have permissions
you do not have permissions, your account is suspended
error when getting location from OSM id