Skip to content

add bbox support for CSV and GeoJSON feature providers #2058

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 3 commits into from
Jul 7, 2025

Conversation

tomkralidis
Copy link
Member

Overview

This PR adds bbox support for CSV and GeoJSON providers using Shapely (which is already part of the core dependency chain).

Related Issue / discussion

Somewhat related to #2000

Additional information

None

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 Jul 4, 2025
@tomkralidis tomkralidis added enhancement New feature or request OGC API - Features OGC API - Features labels Jul 4, 2025
@tomkralidis tomkralidis changed the title Csv geojson provider bbox add bbox support for CSV and GeoJSON feature providers Jul 4, 2025
Copy link
Contributor

@doublebyte1 doublebyte1 left a comment

Choose a reason for hiding this comment

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

+1 for these improvements! 👍🏽

Please check some minor comments.

assert len(features['features']) == 1

links = features['links']
assert len(links) == 6
assert '/collections/obs/items?f=json&limit=1&bbox=-180,90,180,90' in \
assert '/collections/obs/items?f=json&limit=1' in \
Copy link
Contributor

Choose a reason for hiding this comment

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

If the bbox tests are removed from here, does it mean we are going to create separate tests for each features (and records) provider?

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed this test because of previous behaviour of WxS (if property is null, it doesn't evaluate to true n a query/match). Looking at OAFeat Req 24C, I've updated this to true, hence restorng the existing behaviour in tests/api/test_itemtypes.py (the remaining changes being updating the miny value in the request and the resulting links).

@tomkralidis tomkralidis requested a review from doublebyte1 July 6, 2025 12:52
@doublebyte1 doublebyte1 merged commit e84a56c into master Jul 7, 2025
7 checks passed
@tomkralidis tomkralidis deleted the csv-geojson-provider-bbox branch July 7, 2025 09:22
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 - Features OGC API - Features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants