Guidance on Correctly Serving Zarr Datasets Through pygeoapi

Hello everyone. I’m trying to serve my data using pygeoapi, but I’m not able to get it working properly. I keep running into errors even after following the documentation closely.

I tried loading the example Zarr file using the EDR API, and I also tried subsetting data using Coverages, but neither seems to work correctly.

Below is my dataset information. The grid size is 101 × 101, with bounds [-28.0, 40.0, -27.0, 41.0]:

xarray.Dataset
Dimensions:
time: 32
lat: 101
lon: 101

Coordinates:
lat (lat) float32 40.0 40.01 … 40.99 41.0
lon (lon) float32 -28.0 -27.99 … -27.01 -27.0
time (time) datetime64[ns] 2005-12-01T09:00:00 … 2006-01-…

Data variables:
analysed_sst (time, lat, lon) float64 dask.array<…>
analysis_error (time, lat, lon) float64 dask.array<…>
mask (time, lat, lon) float32 dask.array<…>
sea_ice_fraction (time, lat, lon) float64 dask.array<…>

Attributes: (47)

and my config file looks like this for edr

sstzarr:
type: collection
title: Wind and Temperature
description: SST, Airtemp
keywords:

  • trying ogc coverage
    links:
  • type: text/html
    rel: canonical
    title: information
    href:
    hrelang: en-US
    extents:
    spatial:
    bbox: [-28.0, 40.0, -27.0, 41.0]
    crs: //wwwopengisnet/def/crs/OGC/1.3/CRS84
    temporal:
    begin:
    end: null

providers:

  • type: edr
    name: xarray-edr
    data: /home/itgo/Desktop/pygeoapi/pygeoapi/tests/data/analysed_sst.zarr
    format:
    name: zarr
    mimetype: application/zip

and my config for coverage looks like this

windt:
type: collection
title: Wind and Temperature
description: SST, Airtemp
keywords:

  • trying ogc coverage
    links:
  • type: text/html
    rel: canonical
    title: information
    href:
    hrelang: en-US
    extents:
    spatial:
    bbox: [-28.0, 40.0, -27.0, 41.0]
    crs: ://www.opengis.net/def/crs/OGC/1.3/CRS84
    temporal:
    begin:
    end: null
providers:
     - type: coverage
       name: xarray
       data: /home/itgo/Desktop/pygeoapi/pygeoapi/tests/data/analysed_sst.zarr
       format:
           name: zarr
           mimetype: application/zip

My Coverage Query

I tried this coverage query:

localhost:5000/collections/windt/coverage?
subset=lat(40.2:40.5)&
subset=lon(-27.8:-27.4)&
subset=time(“2005-12-10”:“2005-12-15”)&
f=json

It did subset the data but it was not proper

xarray.Dataset

Dimensions:
time: 32
lat: 31
lon: 101

Coordinates:
lat (lat) float32 40.2 40.21 40.22 … 40.49 40.5
lon (lon) float32 -28.0 -27.99 … -27.01 -27.0
time (time) datetime64[ns] 2005-12-01T09:00:00 … 2006-01-…

Data variables:
analysed_sst (time, lat, lon) float64 dask.array<chunksize=(32, 31, 101), meta=np.ndarray>
analysis_error (time, lat, lon) float64 dask.array<chunksize=(32, 31, 101), meta=np.ndarray>
mask (time, lat, lon) float32 dask.array<chunksize=(32, 31, 101), meta=np.ndarray>
sea_ice_fraction (time, lat, lon) float64 dask.array<chunksize=(32, 31, 101), meta=np.ndarray>

Indexes: (3)

Attributes: (47)

as you can see lon dim is intact even after subsetting.

Then I tried edr query and query is like this

localhost:5000/collections/sstzarr/cube?
bbox=-28.0,40.0,-27.5,40.5&
parameter-name=analysed_sst

And it was showing like this

which is incorrect ,It should be something like this instead

actual

The location of the subset is correct in this case, but it looks like pygeoapi is tiling multiple files and placing them side-by-side within that area.

Is there anything I can follow, such as a full tutorial, reference implementation, or working example to understand how to configure pygeoapi correctly for Zarr, Coverage, and EDR? I’ve already read the documentation, but it still feels incomplete, and I’m not sure what else I can do to make this work.

If there are recommended resources, best practices, or known limitations when using xarray/Zarr with pygeoapi, I’d really appreciate some guidance.

Thank You and sorry for such a long post.