Commit e642548e authored by Christine Plumejeaud's avatar Christine Plumejeaud
Browse files

Specified the API in readme.md.

parent b33b27f8
......@@ -5,12 +5,13 @@
- [1.1.2. Running with Apache](#112-running-with-apache)
- [1.1.3. Debug things](#113-debug-things)
- [1.2. List of possible requests](#12-list-of-possible-requests)
- [1.2.1. data.portic.fr/api/travels?](#121-dataporticfrapitravels)
- [1.2.2. data.portic.fr/api/pointcalls?](#122-dataporticfrapipointcalls)
- [1.2.3. data.portic.fr/api/details/departures?lon=lat=radius=](#123-dataporticfrapidetailsdepartureslonlatradius)
- [1.2.4. data.portic.fr/api/agg/destinations?lon=lat=radius=](#124-dataporticfrapiaggdestinationslonlatradius)
- [1.2.5. data.portic.fr/api/travels?link_to_port="UHGS_id du port"&both-to=true](#125-dataporticfrapitravelslinktoport%22uhgsid-du-port%22both-totrue)
- [1.2.6. data.portic.fr/api/travels?link_to_port="UHGS_id du port"&degree=0&both-to=true](#126-dataporticfrapitravelslinktoport%22uhgsid-du-port%22degree0both-totrue)
- [1.2.1. Principes](#121-principes)
- [1.2.3. /pointcalls?](#123-pointcalls)
- [1.2.2. /travels?](#122-travels)
- [1.2.3.1. /details/departures?lon=lat=radius=](#1231-detailsdepartureslonlatradius)
- [1.2.4.1. /travels?link_to_port="UHGS_id du port"&both-to=true](#1241-travelslinktoport%22uhgsid-du-port%22both-totrue)
- [1.2.4.2. /travels?link_to_port="UHGS_id du port"&degree=0&both-to=true](#1242-travelslinktoport%22uhgsid-du-port%22degree0both-totrue)
- [1.2.4. /agg/destinations?lon=lat=radius=](#124-aggdestinationslonlatradius)
......@@ -47,17 +48,40 @@ C:\Python37\lib\site-packages\flask\app.py:2446: DtypeWarning: Columns (31) have
## 1.2. List of possible requests
### 1.2.1. Principes
### 1.2.1. data.portic.fr/api/travels?
Une requête particulière : *fieldnames* récupère des métadonnées sur l'API, avec la liste des attributs, avec leur nom court et long, leur type et leur signification.
fieldnames : liste des attributs, avec leur nom court et leur nom long
Deux types de requête :
travels : les données de trajectoire calculées
pointcalls : les données d'observation à chaque escale des navires
Liste des paramètres communs à chaque requête et valeur par défaut en gras:
- params : **all** | tableau des noms longs des attributs de l'API à renvoyer
- format : csv | **json**
- zipped : true | **false**
- shortenfields : true | **false**
- both_to : true | **false**
Si le parametre n'est pas précisé, le serveur opte pour la valeur de paramètre par défaut (en gras).
URL : **http://data.portic.fr/api/**
### 1.2.3. /pointcalls?
-- TOUT en json
### 1.2.2. data.portic.fr/api/pointcalls?
### 1.2.2. /travels?
-- TOUT en json
### 1.2.3. data.portic.fr/api/details/departures?lon=lat=radius=
#### 1.2.3.1. /details/departures?lon=lat=radius=
Les travels seulement au départ dans un rayon de radium km autour du point long/lat
Les calculs spatiaux sont déportés dans le SGBD Postgres pour bénéficier des index spatiaux.
Exemple
`http://127.0.0.1:5004/api/agg/departures/?lat=46&lon=-1&radius=100`
......@@ -65,23 +89,30 @@ Exemple
[{"departure":"La Rochelle","count":2631},{"departure":"Marennes","count":1996},{"departure":"Rochefort","count":894},{"departure":"Aligre de Marans","count":705},{"departure":"Saint Martin de R\u00e9","count":673},{"departure":"Ol\u00e9ron","count":600},{"departure":"Rib\u00e9rou Saujon","count":595},{"departure":"Ars en R\u00e9","count":460},{"departure":"La Tremblade","count":320},{"departure":"La Flotte en R\u00e9","count":289},{"departure":"Moricq","count":230},{"departure":"Aligre","count":155},{"departure":"Le Chateau d' Ol\u00e9ron","count":131},{"departure":"La Perrotine","count":121},{"departure":"Oleron","count":115},{"departure":"Saint Denis d' Ol\u00e9ron","count":102},{"departure":"Saint Savinien","count":100},{"departure":"Chaillevette","count":92},{"departure":"Marans","count":82},{"departure":"Olleron","count":79},{"departure":"Saint Michel en l' Herm","count":77},{"departure":"Ile de R\u00e9","count":76},{"departure":"Soubise","count":66},{"departure":"Esnandes","count":62},{"departure":"La Tranche sur Mer","count":56},{"departure":"Seudre","count":54},{"departure":"\u00eele de R\u00e9","count":38},{"departure":"Royan","count":31},{"departure":"Talmont Talmont Saint Hilaire","count":31},{"departure":"\u00cele d' Ol\u00e9ron","count":26},{"departure":"Ile d' Ol\u00e9ron","count":26},{"departure":"Port d' Envaux","count":22},{"departure":"Brouage","count":22},{"departure":"\u00cele de R\u00e9","count":20},{"departure":"Mortagne","count":17},{"departure":"Le Plomb","count":16},{"departure":"Saint Martin de Rh\u00e9","count":12},{"departure":"Loix en R\u00e9","count":12},{"departure":"L' Houm\u00e9e","count":12},{"departure":"la Rochelle","count":11},{"departure":"Taillebourg","count":10},{"departure":"dans le Pertuis","count":10},{"departure":"Dercie","count":8},{"departure":"Seudres","count":8},{"departure":"Saintes","count":8},{"departure":"Martroux","count":8},{"departure":"Bourcefranc","count":6},{"departure":"La Tranche sur mer","count":6},{"departure":"Lu\u00e7on","count":6},{"departure":"La Pr\u00e9e","count":6},{"departure":"Champagn\u00e9 sur Marais","count":5},{"departure":"Fouras","count":4},{"departure":"d' Aligre","count":4},{"departure":"Saint Martin","count":4},{"departure":"La tremblade","count":4},{"departure":"La Perotine","count":4},{"departure":"La Flotte","count":4},{"departure":"Martrou","count":4},{"departure":"la Tremblade","count":4},{"departure":"Marenne","count":4},{"departure":"Courreaux d' Ol\u00e9ron","count":4},{"departure":"Ars En R\u00e9","count":3},{"departure":"la Perrotine","count":3},{"departure":"Ars","count":3},{"departure":"Auvaux Port d' Envaux","count":2},{"departure":"\u00cele d' Oleron","count":2},{"departure":"Saint Michel en Poitou Saint Michel en l' Herm","count":2},{"departure":"Courraux d' Ol\u00e9ron","count":2},{"departure":"R\u00e9","count":2},{"departure":"La Seudre","count":2},{"departure":"Saint Trojan en Ol\u00e9ron","count":2},{"departure":"Rib\u00e9rou","count":2},{"departure":"La B\u00e9chel La B\u00e9chade","count":2},{"departure":"La Tranche","count":2},{"departure":"Aiguillon","count":2},{"departure":"dans Le Pertuis","count":2},{"departure":"Oll\u00e9ron","count":2},{"departure":"Rade de La Pallice","count":2},{"departure":"Coureaux de R\u00e9","count":2},{"departure":"Daligre","count":2},{"departure":"Saint Martin en R\u00e9","count":2},{"departure":"Ile de Re","count":2},{"departure":"L' Aiguillon","count":2},{"departure":"Saint Denis \u00cele d' Ol\u00e9ron","count":2},{"departure":"Sudre","count":2},{"departure":"Le Pr\u00e9e","count":2},{"departure":"Amiraut\u00e9 de Marennes Ch\u00e2teau d' Ol\u00e9ron","count":2},{"departure":"Port d' Envaux","count":2},{"departure":"Charrou","count":2},{"departure":"Esnandres","count":2},{"departure":"Mornac","count":2},{"departure":"Saint Michel de Herm","count":2},{"departure":"Poitou Rib\u00e9rou Saujon","count":2},{"departure":"LA Rochelle","count":2},{"departure":"Riberoux de Saujon","count":2},{"departure":"R\u00e9 Ile de","count":2},{"departure":"Loix","count":2},{"departure":"Ile d' Oleron","count":2},{"departure":"la Flotte-en-R\u00e9","count":2},{"departure":"Port des Barques","count":2},{"departure":"Ars en r\u00e9","count":2},{"departure":"Riberon Riberou","count":2},{"departure":"Saint Morice Moricq","count":1},{"departure":"Mescher","count":1}]
```
### 1.2.4. data.portic.fr/api/agg/destinations?lon=lat=radius=
Les travels seulement à l'arrivée dans un rayon de radium km autour du point long/lat
### 1.2.5. data.portic.fr/api/travels?link_to_port="UHGS_id du port"&both-to=true
#### 1.2.4.1. /travels?link_to_port="UHGS_id du port"&both-to=true
Donnerait les trajets passant par le port en question, et toutes les escales.
sans doublons par défaut
avec doublons si both-to=true
### 1.2.6. data.portic.fr/api/travels?link_to_port="UHGS_id du port"&degree=0&both-to=true
- link_to_port : **null** | identifiant du port UHGS_id dans la base de données sur lequel on filtre les données si précisé
#### 1.2.4.2. /travels?link_to_port="UHGS_id du port"&degree=0&both-to=true
Donnerait les trajets entrants ou partants du port en question,
sans doublons, seulement les escales directement précédentes ou suivantes
sans doublons par défaut
avec doublons si both-to=true
- link_to_port : **null** | identifiant du port UHGS_id dans la base de données sur lequel on filtre les données si précisé
### 1.2.4. /agg/destinations?lon=lat=radius=
Les calculs spatiaux sont déportés dans le SGBD Postgres pour bénéficier des index spatiaux.
Les travels seulement à l'arrivée dans un rayon de radium km autour du point long/lat
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment