Python OGC SensorThings API Examples
Some examples of using the HTTP REST API for OGC SensorThings API to query data.
Note that these examples are using the secondary URL for the Arctic Connect SensorThings API Service. A new URL will become the main URL in late 2020.
Disclaimer: I do not know Python; hopefully the REST API usage instructions come through the examples.
Requirements
I tested this with Python 3.6.6 on MacOS 10.13.
ArcticConnect is using FROST Server for serving OGC SensorThings API. The code may work when pointed to another OGC SensorThings API service, with slightly different results.
Examples
For retrieving a list of sensor stations and their locations for mapping, try these:
Sometimes you know when a Datastream of data has already been created in STA, and you need the simplest way to retrieve the observation data.
- Retrieve the Observation data for Datastream time series
- Includes handling paging, sorting
- Filter the Observation data by time interval
- Include the "Feature of Interest" entity for moving Observation data
- Use the "select" query to minimize the response body size
- Compare
250 KB
vs42 KB
vs18 KB
in different methods
- Compare
If you have a geographic region of interest (bounding box or polygon), you can do some filtering based on that.
- Use a bounding box for finding stations
- Use a polygon to filter all Datastreams for "Air Temperature" in a desired region
- For a moving sensor, get only observations that occurred in a polygon
License
MIT License