Skip to content
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

Add total_bounds of layer to read_info #281

Merged

Conversation

theroggy
Copy link
Member

@theroggy theroggy commented Sep 4, 2023

I made force_feature_count default to False, which is a breaking change for eg. geojson: will return -1 for read_info()["features"] now by default because determining number features is not fast for this file type.
Not sure if this is OK? If OK, I'll add it as a breaking change in the changelog.

closes #274

@theroggy theroggy changed the title Get layer bounds via pyogrio.read_info Add layer total_bounds to pyogrio.read_info result Sep 4, 2023
@theroggy theroggy changed the title Add layer total_bounds to pyogrio.read_info result Add total_bounds of layer to read_info Sep 4, 2023
@theroggy theroggy marked this pull request as ready for review September 4, 2023 21:17
Copy link
Member

@brendan-ward brendan-ward left a comment

Choose a reason for hiding this comment

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

Thanks @theroggy !

What do you think about exposing a couple items to the capabilities list as well as suggested in 274:

  • fast_total_bounds: OGR_L_TestCapability(ogr_layer, OLCFastGetExtent)
  • fast_feature_count: OGR_L_TestCapability(ogr_layer, OLCFastFeatureCount)

I'm OK with adding a breaking change for counts for GeoJSON data sources for read_info; this keeps us closer in parity to the underlying driver's capabilities.

pyogrio/_io.pyx Outdated Show resolved Hide resolved
pyogrio/_io.pyx Outdated Show resolved Hide resolved
pyogrio/core.py Outdated Show resolved Hide resolved
pyogrio/core.py Outdated Show resolved Hide resolved
pyogrio/tests/test_core.py Outdated Show resolved Hide resolved
pyogrio/core.py Outdated Show resolved Hide resolved
pyogrio/tests/test_core.py Show resolved Hide resolved
pyogrio/tests/test_core.py Outdated Show resolved Hide resolved
@theroggy
Copy link
Member Author

theroggy commented Sep 5, 2023

What do you think about exposing a couple items to the capabilities list as well as suggested in 274:

  • fast_total_bounds: OGR_L_TestCapability(ogr_layer, OLCFastGetExtent)
  • fast_feature_count: OGR_L_TestCapability(ogr_layer, OLCFastFeatureCount)

Oops, forgot that one... Added them. Apparently the existing capabilities there had value 0 or 1, which isn't ideal I think? So I changed them to boolean.

I'm OK with adding a breaking change for counts for GeoJSON data sources for read_info; this keeps us closer in parity to the underlying driver's capabilities.

Done. The capabilities weren't documented anywhere yet (now i mention them in the read_info doc), but to be clear I also added a breaking change to clarify that they are now booleans.

CHANGES.md Outdated Show resolved Hide resolved
pyogrio/_io.pyx Outdated Show resolved Hide resolved
pyogrio/_io.pyx Show resolved Hide resolved
Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@brendan-ward brendan-ward merged commit f39ddf8 into geopandas:main Sep 25, 2023
16 checks passed
@theroggy theroggy deleted the Get-layer-bounds-via-pyogrio.read_info branch September 25, 2023 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get dataset bounds via pyogrio.read_info
4 participants