Commit 5ed404b2 authored by Bernard PRADINES's avatar Bernard PRADINES
Browse files

Gestion des exceptions avec message en JSON

parent 74ac1aac
......@@ -3,7 +3,7 @@
*Web API for data above the postgres database developped with Flask*
![](temps_telechargement.png)
![Pointcalls API - Results, and download time](temps_telechargement.png)
- [Installation](#installation)
......@@ -348,10 +348,21 @@ and by using explorex.portic.fr application (code alphaportic for visualisation)
## /sources?
Get statistics about the amount of pointcall data found in sources (couverture des sources de navigo), related to ports.
Get statistics about the amount of pointcall data found in sources (couverture des sources de navigo), related to ports of France only. Only observed ("O") pointcalls are taken in account.
In a given source (source_suite = G5 | Marseille | ...), lists the ports (uhgs_id) of France (state_1789_fr = 'France'), and for each port, counts :
- total : total number of observed ("O") pointcalls found for this port in this source, at a given date in time
Port data is grouped by : source, port, and year. This means that for a given source (source_suite = G5 | Marseille | ...), the API lists the ports (identified by a : toponym, ogc_fid or uhgs_id), and for each port, there is data for each year (pointcall_year = 1787 | 1789 | ...). So there may be more than one record for each port ! You can filter or sum yourself port data received, by source, and / or by year, to build your own map for instance.
Fields available :
- source_suite : the source (G5 | Marseille | ...) where the data comes from
- pointcall_year : the year ( 1787 | 1789 ) for which data is computed. A data line is returned for each year (if data is available)
Fields counting congés data from sources :
- nb_conges_inputdone : total number of observed ("O") pointcalls (congés) actually recorded in database for this port in this source, outgoing ships, computed for a given year
- nb_conges_cr : number of congés that are known to exist, according to national records (archives), and that are expected. For a given year
- nb_conges_sante : number of congés recorded in database, from register of the office of health of Marseille, incoming ships only. For a given year
- nb_petitcabotage : number of congés recorded in database, from register "Petit cabotage" of Marseille (mainly ships coming from Mediterranean areas), incoming ships only. For a given year
Other computed fields :
- nb_tonnage_filled : number of pointcalls where tonnage data (volume de marchandise en tonneaux ou quintaux) is given
- nb_homeport_filled : number of pointcalls where homeport (port d'attache du navire) is known
- nb_product_filled : number of pointcalls where commodity_purpose (nature de la marchandise transportée, ou objet du voyage) is given
......@@ -363,7 +374,7 @@ A join is made between pointcall and port data, to get nearly the same informati
- ogc_fid : id
- uhgs_id : geo_general text id of the port
- toponym : standardised name of the port, in the 'lang' language
- substate_1789 : belonging substate of the port in 1787 / 1789. In the 'lang' language
- substate : belonging substate of the port in 1787 / 1789. In the 'lang' language
- status : null | "oblique" | "siège amirauté", type of port
- geonameid : nearest geoname identifier for the port
- admiralty : name of the home admiralty (amirauté) for the port, in 1787
......@@ -375,12 +386,15 @@ Will be extracted from postgres, schema navigoviz, table pointcall (see navigoco
Parameters :
- srid : **900913** | 4326 | 3857, for geometry transformation of the coordinates of the point representing the port on a map
- date : **none** | 4 digits representing a year (1787 | 1789), to extract pointcall data from the source, for this given year only
- date : **none** | 4 digits representing a year (1787 | 1789), to extract pointcall data from the source, for this given pointcall_year only. Otherwise, when no date is given, the API returns one line per year of data (sums are done per year). Make sure to specify an 'order' if you wish to compute sums per port over the years.
- lang : **fr** | en, language for toponym(_standard), substate_1789
- params : **all** | coma-separated list of fields to be returned by the API
- order : **none** | coma-separated list of fields in desired order. Data lines will be sent in ascending order of first field values, and if equals then in order of second field listed, ...
Example : order=toponym,pointcall_year
Examples :
- http://localhost/api/sources/?srid=4326
- http://localhost/api/sources/?srid=4326&date=1789
- http://localhost/api/sources/?srid=4326&date=1789&lang=en
- http://localhost/api/sources/?srid=4326&params=uhgs_id,toponym,total,point
\ No newline at end of file
- http://localhost/api/sources/?srid=4326&params=uhgs_id,toponym,pointcall_year,nb_conges_inputdone,nb_conges_cr,point
- http://localhost/api/sources/?srid=4326&params=uhgs_id,toponym,pointcall_year,nb_conges_inputdone,nb_conges_cr,point&order=toponym,pointcall_year,source_suite
\ No newline at end of file
This diff is collapsed.
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