Skip to main content

No project description provided

Project description

xpublish-edr

PyPI Conda Version

Tests codecov pre-commit.ci status

Xpublish routers for the OGC EDR API.

Documentation and code

URLs for the docs and code.

Installation

For conda users you can

conda install --channel conda-forge xpublish_edr

or, if you are a pip users

pip install xpublish_edr

Example

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"}),
    ],
)

OGC EDR Spec Compliance

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.

Supported Queries

8.2.1 Position query

Query Compliant Comments
coords
z
datetime
parameter-name
crs Requires a CF compliant grid mapping on the target dataset. Default is EPSG:4326
f Supports cf_covjson, csv, geojson netcdf, parquet
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.

8.2.3 Area query

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
f Supports cf_covjson, csv, geojson netcdf, parquet
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.

8.2.4 Cube query

Query Compliant Comments
bbox Bounding box in minx,miny,maxx,maxy format
z
datetime
parameter-name
crs Requires a CF compliant grid mapping on the target dataset. Default is EPSG:4326
f Supports cf_covjson, csv, geojson netcdf, parquet, geotiff
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 cube queries, only for selecting datetime, z, or additional dimensions.

Cube queries are not flattened like area queries, so the response is returned as sliced by xarray. This is particularly useful for subsetting regular grids.

Get in touch

Report bugs, suggest features or view the source code on GitHub.

License and copyright

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xpublish_edr-0.7.3.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xpublish_edr-0.7.3-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file xpublish_edr-0.7.3.tar.gz.

File metadata

  • Download URL: xpublish_edr-0.7.3.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for xpublish_edr-0.7.3.tar.gz
Algorithm Hash digest
SHA256 e294a000f0878703f4f2bf2e11b53001a7804faaace2f86810b96373c830f3b0
MD5 18558db5c6d97d8cca7fa87c228f58c8
BLAKE2b-256 6b1757373dc7f07f3f678aeeb8e5ce08327830386cb6dd3c8d2b208d7958011d

See more details on using hashes here.

Provenance

The following attestation bundles were made for xpublish_edr-0.7.3.tar.gz:

Publisher: publish-to-pypi.yml on xpublish-community/xpublish-edr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file xpublish_edr-0.7.3-py3-none-any.whl.

File metadata

  • Download URL: xpublish_edr-0.7.3-py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for xpublish_edr-0.7.3-py3-none-any.whl
Algorithm Hash digest
SHA256 bcf6255b4129f59399c757758dcdfbdeb63eb41d81c3776bde027eb9c739be58
MD5 d7b86139e1a15cd779cbb666ed8e7f1e
BLAKE2b-256 9669c60d63bf08f2bfdea6a80320908892b52237a38deabfcd28a0d935b5a823

See more details on using hashes here.

Provenance

The following attestation bundles were made for xpublish_edr-0.7.3-py3-none-any.whl:

Publisher: publish-to-pypi.yml on xpublish-community/xpublish-edr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page