Skip to content

update CoverageJSON compliance #2012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 13, 2025

Conversation

tomkralidis
Copy link
Member

Overview

This PR updates CoverageJSON output in support of compliance.

Related Issue / discussion

None

Additional information

Supercedes #2005 (thanks @adanb13)

Dependency policy (RFC2)

  • I have ensured that this PR meets RFC2 requirements

Updates to public demo

Contributions and licensing

(as per https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md#contributions-and-licensing)

  • I'd like to contribute [feature X|bugfix Y|docs|something else] to pygeoapi. I confirm that my contributions to pygeoapi will be compatible with the pygeoapi license guidelines at the time of contribution
  • I have already previously agreed to the pygeoapi Contributions and Licensing Guidelines

@tomkralidis tomkralidis added this to the 0.21.0 milestone May 12, 2025
@tomkralidis tomkralidis added bug Something isn't working OGC API - Environmental Data Retrieval OGC API - Environmental Data Retrieval OGC API - Coverages OGC API - Coverages labels May 12, 2025
@tomkralidis tomkralidis mentioned this pull request May 12, 2025
5 tasks
@tomkralidis tomkralidis requested a review from a team May 12, 2025 23:22
Comment on lines +339 to +348
'values': [float(data.coords[self.x_field].values)]
}
cj['domain']['axes']['y'] = {
'values': [float(data.coords[self.y_field].values)]
}
cj['domain']['domainType'] = 'PointSeries'

if self.time_field is not None:
mint, maxt = metadata['time']
cj['domain']['axes'][self.time_field] = {
'start': mint,
'stop': maxt,
'num': metadata['time_steps'],
cj['domain']['axes']['t'] = {
'values': [str(v) for v in data[self.time_field].values]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using vectorized type casting

@@ -1425,6 +1425,8 @@ def get_collection_schema(api: API, request: Union[APIRequest, Any],

for k, v in p.fields.items():
schema['properties'][k] = v
if v['type'] == 'float':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a comment on why we are setting the schema different than the value returned from the provider.

@tomkralidis tomkralidis requested a review from webb-ben May 13, 2025 13:02
@tomkralidis tomkralidis merged commit 1eb24cb into geopython:master May 13, 2025
3 checks passed
@tomkralidis tomkralidis deleted the covjson-updates branch May 13, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working OGC API - Coverages OGC API - Coverages OGC API - Environmental Data Retrieval OGC API - Environmental Data Retrieval
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants