Steps to Reproduce
Attempt to get the latest observation from a datastream:
https://hydroserver.waterrights.utah.gov/api/sensorthings/v1.1/Datastreams?$select=id,name,properties&$expand=Thing($select=id,name,properties),Observations($select=result,phenomenonTime;$orderby=phenomenonTime%20desc;$top=1)&$top=1000
Expected Behavior
This should get the latest observation from the datastream.
Actual Behavior
Instead the first observation is returned.
Any additional comments?
I was able to get the latest observation by also including Datastream/id, but the first request with only the phenomenonTime ordering should work. It seems that HydroServer requires both before it honors phenomenonTime.
https://hydroserver.waterrights.utah.gov/api/sensorthings/v1.1/Datastreams?$select=id,name,properties&$expand=Thing($select=id,name,properties),Observations($select=result,phenomenonTime;$orderby=Datastream/id%20asc,phenomenonTime%20desc;$top=1)&$top=1000
Steps to Reproduce
Attempt to get the latest observation from a datastream:
https://hydroserver.waterrights.utah.gov/api/sensorthings/v1.1/Datastreams?$select=id,name,properties&$expand=Thing($select=id,name,properties),Observations($select=result,phenomenonTime;$orderby=phenomenonTime%20desc;$top=1)&$top=1000
Expected Behavior
This should get the latest observation from the datastream.
Actual Behavior
Instead the first observation is returned.
Any additional comments?
I was able to get the latest observation by also including Datastream/id, but the first request with only the phenomenonTime ordering should work. It seems that HydroServer requires both before it honors phenomenonTime.
https://hydroserver.waterrights.utah.gov/api/sensorthings/v1.1/Datastreams?$select=id,name,properties&$expand=Thing($select=id,name,properties),Observations($select=result,phenomenonTime;$orderby=Datastream/id%20asc,phenomenonTime%20desc;$top=1)&$top=1000