geopython / pygeoapi

pygeoapi is a Python server implementation of the OGC API suite of standards. The project emerged as part of the next generation OGC API efforts in 2018 and provides the capability for organizations to deploy a RESTful OGC API endpoint using OpenAPI, GeoJSON, and HTML. pygeoapi is open source and released under an MIT license.
https://pygeoapi.io
MIT License
483 stars 259 forks source link

CRS Support for OGC API EDR pygeoapi Provider #1244

Closed sjordan29 closed 5 months ago

sjordan29 commented 1 year ago

Is your feature request related to a problem? Please describe. I am working with @dblodgett-usgs to configure the pygeoapi EDR provider to work with zarr files with projected coordinate systems. The current implementation appears to require lat/lon coordinates. You can kind of work around this limitation by defining x_field and y_field as the projected coordinates in the config file instead. You can then query the data with projected coordinates. However, this does not seem user-friendly or in line with the OGC API EDR standard.

An example dataset to serve with EDR provider and projected coordinates:

import xarray as xr
import s3fs

def s3open(path, storage_options):    
    fs = s3fs.S3FileSystem(**storage_options)
    return s3fs.S3Map(path, s3=fs)

storage_options = {'anon': True, 'requester_pays': False, 'client_kwargs': {'endpoint_url': 'https://renc.osn.xsede.org'}}
ds = xr.open_zarr(s3open('s3://rsignellbucket2/hytest/conus404/conus404_hourly_202302.zarr', storage_options))

This dataset has lat & lon values, but the xarray .sel() method only works on x and y coordinates.

Describe the solution you'd like For data with projected coordinate systems, I would like users to query with coords in WGS84 and have the EDR provider transform the coordinates in that query to the appropriate CRS. I anticipate this could leverage some of the work done in PR #1174 for feature providers, with storageCRS in the configuration file, or work done for coverages (e.g., rasterio_ provider).

dblodgett-usgs commented 1 year ago

Is this done to some degree in the Coverages provider?

e.g. https://github.com/geopython/pygeoapi/blob/master/pygeoapi/provider/rasterio_.py#L202 ??

Would the pattern there be something to follow in the xarray provider?

github-actions[bot] commented 6 months ago

As per RFC4, this Issue has been inactive for 90 days. In order to manage maintenance burden, it will be automatically closed in 7 days.

github-actions[bot] commented 5 months ago

As per RFC4, this Issue has been closed due to there being no activity for more than 90 days.