-
Notifications
You must be signed in to change notification settings - Fork 22
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
Get dataset bounds via pyogrio.read_info
#274
Comments
This is the function in gdal to get that info: OGR_L_GetExtent Something to think about is what to do with the |
Possibly the better approach is to have It would be nice to have some way to say "get me the dataset bounds but only if it isn't expensive". Maybe |
That's exactly what OGR_L_GetExtent does. If I doublechecked in the FlatGeoBuf driver code and it looks OK at first sight. |
I did a small test, and using the gdal python bindings that use the same function under the hood it takes 3.5 seconds.
|
We may also want to set this property in the layer's capabilities returned by It looks like GPKG, FGB, SHP, and even OSM support fast getting of bounds. GeoJSON does not. I wonder if we want to make the two potentially computationally expensive values opt-in to forcing them by default for |
Note that But +1 to Brendan's last comment as well |
No indeed, everything I wrote only applies to getting the "total_bounds" of the layer to use geopandas terminology. To get all bounds for each feature individually at least a lot more data needs to be read and the |
Yes, you're right. I had forgotten that. For this issue I'm concerned about total bounds in order to provide sensible |
Is it possible to access a dataset's spatial extent for supported drivers without fetch all the features with
read_bounds
? Some drivers like FlatGeobuf know this in advance. E.g. if I runthen I see
without waiting for the 6.5GB file to download. Can we expose that information through
pyogrio.read_info
?The text was updated successfully, but these errors were encountered: