New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Possibility to retrieve All Most Recent Observations per Datastream (for given ObservedProperty)? #1107
Comments
Via "Give me EVERYTHING!' in https://fraunhoferiosb.github.io/FROST-Server/sensorthingsapi/requestingData/STA-Example-Queries.html, I got:
But that still has a lot of overhead... because always ALL Datastreams per Things are returned. We can get rid of Location and Sensor:
But my feeling is that retrieving Datastreams would be more efficient, but I'm not able to create a performing query with those... |
This returns the right amount of Datastreams (1864), added $top=2000 so I'd return all in one go), but I'm not convinced that these are the latest SO2 observations for every Datastream:
|
That last query should return the latest SO2 Observations. |
I've been fiddling around a lot now, starting with Datastreams, then Observations and then to Things.
But I fail to efficiently receive a list of "All Most Recent Observations per Datastream (for given ObservedProperty)"
My goal: on a map with locations: show the latest measurement/observation for a Datastream (eg the SO2 measurements).
I thought to have it with:
https://airquality-frost.k8s.ilt-dmz.iosb.fraunhofer.de/v1.1/Datastreams?$count=true&$top=1&$filter=ObservedProperty/name eq 'SO2'&$expand=ObservedProperty,Thing/Locations,Observations&$orderby=phenomenonTime desc
BUT that appeared to be the Dataset-phenomenonTime which is actually a period ...
Another try was to find All observation in All datastreams of last 24 hours and order them, but that also seems wrong:
https://airquality-frost.k8s.ilt-dmz.iosb.fraunhofer.de/v1.1/Datastreams/Observations?$count=true&$filter=Datastream/ObservedProperty/name eq 'SO2'and phenomenonTime gt now() sub duration'PT24H'&$orderby=phenomenonTime desc&$expand=Datastream
Anybody a hint?
(or is this a question I should not ask from Frost, because there are so many Observations and ordering those is a headache?)
The text was updated successfully, but these errors were encountered: