[Proposal] Allow to filter for xarray coordinates in EDR data sets #2006
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Hello,
xarray's data structure consists of
Dimensions
,Coordinates
andData variables
, so far we can selectData variables
using theparameter-value
in the position/ cube request for EDR data. However there also can be multipleCoordinates
(apart from time, lat/lon which we also need for a valid collection definition in theconfig.yaml
eg intime_fields
). In said case we would get a flattened list. Yet we neither have all information about how many coordinate dimensions have been used before flattening the list, nor their length to reshape the flattened list into its corresponding (multi dimensional) array.To address this we could implement another query parameter called
dims
that uses key:value - pairs to specifically select xarray'sCoordinates
:dims=coord1:value1,coord2:value2,...,coordN:valueN
allowing only onevalue
for eachcoord
and acoord
beeing selected only once.In this PR I implemented:
dims
coordinates
filter_dims
object to the response of GET/collections/{collection_name}
- metadataTopics TBD:
dims
query parameterRelated Issue / discussion
Additional information
For testing you can create a
.nc
file like so:and add the following entry to your
config.yaml
after mounting/ copydim.nc
into the correct dir:A request would then look like this:
Dependency policy (RFC2)
Updates to public demo
Contributions and licensing
(as per https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md#contributions-and-licensing)