Xpublish routers for the OGC EDR API.
URLs for the docs and code.
For conda
users you can
conda install --channel conda-forge xpublish_edr
or, if you are a pip
users
pip install xpublish_edr
import xarray as xr
import xpublish
from xpublish.routers import base_router, zarr_router
from xpublish_edr.cf_edr_router import cf_edr_router
ds = xr.open_dataset("dataset.nc")
rest = xpublish.Rest(
datasets,
routers=[
(base_router, {"tags": ["info"]}),
(cf_edr_router, {"tags": ["edr"], "prefix": "/edr"}),
(zarr_router, {"tags": ["zarr"], "prefix": "/zarr"}),
],
)
This package attempts to follow the spec where reasonable, adding functionality where the value is demonstrable.
collections and Resource Paths Support
xpublish-edr
does not currently support the /collections/{collectionId}/query
path template described in the spec. Instead the path resource appears as /{dataset_id}/edr/{query}
. This is because of the path structure of xpublish. In the future, if xpublish
supports DataTree
it could provide a path to supporting the spec compliant collections
resource path.
However, despite the collections resource not existing, this implementation supports collection metadata at the dataset level through the /{dataset_id}/edr/
resource.
Query | Compliant | Comments |
---|---|---|
coords |
✅ | |
z |
✅ | |
datetime |
✅ | |
parameter-name |
✅ | |
crs |
✅ | Requires a CF compliant grid mapping on the target dataset. Default is EPSG:4326 |
parameter-name |
✅ | |
f |
✅ | |
method |
➕ | Optional: controls data selection. Use "nearest" for nearest neighbor selection, or "linear" for interpolated selection. Uses nearest if not specified |
Any additional query parameters are assumed to be additional selections to make on the dimensions/coordinates. These queries will use the specified selections
method
.
Query | Compliant | Comments |
---|---|---|
coords |
✅ | Only POLYGON supported currently |
z |
✅ | |
datetime |
✅ | |
parameter-name |
✅ | |
crs |
✅ | Requires a CF compliant grid mapping on the target dataset. Default is EPSG:4326 |
parameter-name |
✅ | |
f |
✅ | |
method |
➕ | Optional: controls data selection. Use "nearest" for nearest neighbor selection, or "linear" for interpolated selection. Uses nearest if not specified |
method
is not applicable for the coordinates of area queries, only for selecting datetime, z, or additional dimensions.
For POLYGON
coordinates, points that are located within OR on the polygons boundary are included in the response.
Report bugs, suggest features or view the source code on GitHub.
xpublish-edr is licensed under BSD 3-Clause "New" or "Revised" License (BSD-3-Clause).
Development occurs on GitHub at https://github.com/gulfofmaine/xpublish-edr/issues.