Skip to content

RFC5: apply distance limiting#2229

Open
tomkralidis wants to merge 1 commit into
masterfrom
limits-distance
Open

RFC5: apply distance limiting#2229
tomkralidis wants to merge 1 commit into
masterfrom
limits-distance

Conversation

@tomkralidis
Copy link
Copy Markdown
Member

Overview

This PR applies distance limiting per RFC5 for items and coverages.

Related Issue / discussion

https://pygeoapi.io/development/rfc/5

Additional information

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.23.0 milestone Feb 1, 2026
@tomkralidis tomkralidis added enhancement New feature or request OGC API - Features OGC API - Features OGC API - Records OGC API - Records OGC API - Environmental Data Retrieval OGC API - Environmental Data Retrieval OGC API - Coverages OGC API - Coverages labels Feb 1, 2026
@tomkralidis tomkralidis modified the milestones: 0.23.0, 0.24.0 Mar 2, 2026
@tomkralidis tomkralidis marked this pull request as ready for review May 11, 2026 01:13
@tomkralidis tomkralidis changed the title [WIP] RFC5: apply distance limiting RFC5: apply distance limiting May 11, 2026
@tomkralidis tomkralidis requested a review from a team May 11, 2026 01:13
Comment thread pygeoapi/api/__init__.py
return True

if max_distance_x is not None:
requested_distance_x = abs(request_bbox[2] - request_bbox[0])
Copy link
Copy Markdown
Member

@webb-ben webb-ben Jun 1, 2026

Choose a reason for hiding this comment

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

It might be worth establishing the unit for distance. This as a simple comparison makes some sense when max_distance_units are degrees and the bbox is in OGC:CRS84. However if the bbox is in EPSG:3857, the effective limit would be much smaller.

Comment thread pygeoapi/api/coverages.py
server_limits = api.config['server'].get('limits', {})
collection_limits = api.config['resources'][dataset].get('limits', {}) # noqa

_ = evaluate_limit_distance(request.params.get('bbox', []),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Related to previous comment, might be worth transforming the bbox to WGS84 here until the unit is applied?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request OGC API - Coverages OGC API - Coverages OGC API - Environmental Data Retrieval OGC API - Environmental Data Retrieval OGC API - Features OGC API - Features OGC API - Records OGC API - Records

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants