Open nuest opened 11 years ago
Number of tracks is available through calling https://envirocar.org/api/stable/tracks?limit=1
The HTTP Response Header Link
provides links to next and last. The page
of the last corresponds to the total number of tracks:
Link: <https://envirocar.org/api/stable/tracks?limit=1&page=384>;rel=last;type=application/json, <https://envirocar.org/api/stable/tracks?limit=1&page=2>;rel=next;type=application/json
Great - I would collect that information in a API though an not use headers. But the code should show how the information can be retrieved server side, which is good.
API sketch (comments welcome @matthesrieke), should probably move this issue to the server.
/rest/statistics/
rest/statistics/phenomenon/:phenomenonid
/rest/statistics/project
/rest/statistics/project?fields={:id}
/rest/statistics/project/:year/:month/:week?fields={:id}
/rest/statistics/project/
/rest/statistics/project/2013/8/23
/rest/statistics/project/2013/8?fields={emission:co2,tracklength}
{
"source":"www.envirocar.org",
"statistics":[
{
"value":12345.6,
"id":"tracklength",
"description":"The accumulated number of the kilometers of all tracks on the enviroCar server.",
"unit":"km"
}
]
}
I would collect that information in a API though an not use headers
headers can be part of the API. We currently only support HTTP anyhow. But providing nice JSON is also fine with me.
This is a rough sketch of how we could show some statistics on the landing page. Of course a little fancier ;)
Am 15.11.2013 12:58, schrieb MartinDueren:
screenshot from 2013-11-15 12 57 16 https://f.cloud.github.com/assets/2618987/1549695/28de7d10-4ded-11e3-9776-8586f05c8561.png
This is a rough sketch of how we could show some statistics on the landing page. Of course a little fancier ;)
— Reply to this email directly or view it on GitHub https://github.com/enviroCar/enviroCar-www/issues/109#issuecomment-28564241.
As long as it is clear what the numbers represent: number of active envirCar participants, number of tracks... What do we want to show?
Ann Hitchcock 52°North Initiative for Geospatial Open Source Software GmbH Martin-Luther-King-Weg 24 48155 Muenster, Germany
tel. +49 (0)251 396371 -21 fax: +49 (0)251 396371 -11
a.hitchcock@52north.org http://52north.org
General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk Local Court Muenster HRB 10849
Discussion of API layout continued in server issue https://github.com/enviroCar/enviroCar-server/issues/170
Create statstics for complete database ("the current state"):
Think about the temporal resolution of the statistics (archive), potentially cached.
Regarding the website presentation, the page should show the statistics starting with the overall statistics of "just now" and two graphs of three graphs that are interesting to observe over time (no user interaction, just preconfigured graphs)
Other statistics, such as number of cars, users, contributors should be prepared on the server side but not added to the website.