OGC API - Coverages provides geospatial data access functionality to raster data.
To add raster data to pygeoapi, you can use the dataset example in :ref:`configuration` as a baseline and modify accordingly.
pygeoapi core feature providers are listed below, along with a matrix of supported query parameters.
| Provider | properties | subset | bbox | datetime |
|---|---|---|---|---|
| :ref:`Rasterio<rasterio-provider>` | ✅ | ✅ | ✅ | ✅ |
| :ref:`Xarray<xarray-provider>` | ✅ | ✅ | ✅ | ✅ |
Below are specific connection examples based on supported providers.
Note
Requires Python package Rasterio
The Rasterio provider plugin reads and extracts any data that Rasterio is capable of handling.
providers:
- type: coverage
name: rasterio
data: tests/data/CMC_glb_TMP_TGL_2_latlon.15x.15_2020081000_P000.grib2
options: # optional creation options
DATA_ENCODING: COMPLEX_PACKING
format:
name: GRIB
mimetype: application/x-grib2Note
The Rasterio provider format.name directive requires a valid
GDAL raster driver short name.
Note
Requires Python package Xarray
The Xarray provider plugin reads and extracts NetCDF and Zarr data.
providers:
- type: coverage
name: xarray
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
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: coverage
name: xarray
data: tests/data/analysed_sst.zarr
format:
name: zarr
mimetype: application/zip
options:
zarr:
consolidated: true
squeeze: trueNote
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 NetCDF or Zarr 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.
Note
When providing a storage_crs value in the xarray configuration, specify the coordinate reference system using any valid input for pyproj.CRS.from_user_input.
- list all collections
- overview of dataset
- schema of dataset
- coverage access via CoverageJSON (default)
- coverage access via native format (as defined in
provider.format.name) - coverage access with comma-separated properties
- coverage access with subsetting
- coverage with bbox
- coverage with bbox and bbox CRS
Note
.../coverage queries which return an alternative representation to CoverageJSON (which prompt a download)
will have the response filename matching the collection name and appropriate file extension (e.g. my-dataset.nc)