Publishing data to OGC API - Environmental Data Retrieval
The OGC Environmental Data Retrieval (EDR) (API) provides a family of lightweight query interfaces to access spatio-temporal data resources.
To add spatio-temporal data to pygeoapi for EDR query interfaces, you can use the dataset example in Configuration as a baseline and modify accordingly.
Providers
pygeoapi core EDR providers are listed below, along with a matrix of supported query types and query arguments.
Provider |
Position |
Radius |
Area |
Cube |
Trajectory |
Corridor |
Items |
Locations |
Instances |
|---|---|---|---|---|---|---|---|---|---|
✅ |
❌ |
❌ |
✅ |
❌ |
❌ |
❌ |
❌ |
❌ |
|
❌ |
❌ |
✅ |
✅ |
❌ |
❌ |
✅ |
✅ |
❌ |
Provider |
coords |
parameter-name |
datetime |
|---|---|---|---|
✅ |
✅ |
✅ |
|
✅ |
✅ |
✅ |
Below are specific connection examples based on supported providers.
Connection examples
xarray-edr
Note
Requires Python package xarray
The xarray-edr provider plugin reads and extracts NetCDF and Zarr data via xarray.
providers:
- type: edr
name: xarray-edr
data: tests/data/coads_sst.nc
# optionally specify x/y/time fields, else provider will attempt
# to derive automagically
x_field: lon
y_field: lat
z_field: z
time_field: time
# optionally specify the coordinate reference system of your dataset
# else pygeoapi assumes it is WGS84 (EPSG:4326).
storage_crs: http://www.opengis.net/def/crs/OGC/1.3/CRS84
format:
name: netcdf
mimetype: application/x-netcdf
providers:
- type: edr
name: xarray-edr
data: tests/data/analysed_sst.zarr
format:
name: zarr
mimetype: application/zip
providers:
- type: edr
name: xarray-edr
data: s3://power-analysis-ready-datastore/power_901_annual_meteorology_utc.zarr
format:
name: zarr
mimetype: application/zip
options:
s3:
anon: true
requester_pays: false
Note
Zarr files are directories with files and subdirectories. Therefore a zip file is returned upon request for said format.
Note
options.zarr is a custom property that can be used to set Zarr-specific open options.
Note
When referencing data stored in an S3 bucket, be sure to provide the full S3 URL. Any parameters required to open the dataset using fsspec can be added to the config file under options and s3, as shown above.
SensorThingsEDR
The SensorThings API EDR Provider for pygeaopi extends the feature provider to produce CoverageJSON representations from SensorThings responses. This provider relies on using the ObservedProperty Entity to create the parameter-name set.
providers:
- type: edr
name: SensorThingsEDR
data: https://emotional.byteroad.net/FROST-Server/v1.1/
- type: feature
name: SensorThings
data: https://emotional.byteroad.net/FROST-Server/v1.1/Things
title_field: name
Note
The feature provider must also be configured to service the …/items EDR query type.
Formatters
CoverageJSON is the default format provided by edr providers. Additional formats can be added to configuration using one of the pygeoapi core formatters or by building a custom formatter plugin.
Note
See the plugin documentation for more information on custom formatter plugins.
Formatter |
format parameter value |
|---|---|
|
CSV
formatters:
- name: CSV # propagated by .../items?f=csv
geom: False # whether to include geometry (default=False)
attachment: True # whether to provide as an attachment (default=False)
Data access examples
list all collections
overview of dataset
dataset position query
dataset position query for a specific parameter
dataset position query for a specific parameter and time step