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 OGRLayer::GetExtent3D() #8570

Closed
5 tasks done
rouault opened this issue Oct 16, 2023 · 4 comments · Fixed by #8806
Closed
5 tasks done

Add OGRLayer::GetExtent3D() #8570

rouault opened this issue Oct 16, 2023 · 4 comments · Fixed by #8806
Assignees

Comments

@rouault
Copy link
Member

rouault commented Oct 16, 2023

Motivation: qgis/QGIS#54941 (review)

  • Add generic implementation that iterates over features (like for the 2D version)
  • Add specialized implementation for shapefile where this can be quick as this in the .shp header
  • Add semi-rapid implementation for GeoPackage using a custom aggregate SQL function that just parses the GPKG geometry header of features to compute the 3D extent (cf OGRGeoPackageTableLayer::GetGeometryTypes() for an exemple). We might also consider (as a follow-up) to extent the gpkg_contents table with a zmin and zmax columns, but probably not by default as this could affect compatibility with other readers
  • GeoJSON could also have it for free as it scans the whole file at opening.
  • Add a OLCFastGetExtent3D layer capability
@rouault
Copy link
Member Author

rouault commented Nov 17, 2023

Implementation in the QGIS OGR provider where that could be plugged in: qgis/QGIS#55320

@elpaso elpaso self-assigned this Nov 23, 2023
@rouault
Copy link
Member Author

rouault commented Nov 23, 2023

Code and tests should deal with layers that have a mix of 2D and 3D geometries. Currently OGRGeometry::getEnvelope() returns zmin=zmax=0 for 2D geometries. Perhaps we should change that to return NaN ?

elpaso added a commit to elpaso/gdal that referenced this issue Nov 24, 2023
elpaso added a commit to elpaso/gdal that referenced this issue Nov 30, 2023
rouault pushed a commit that referenced this issue Nov 30, 2023
* OGR: Add OGRLayer::GetExtent3D()
* Specialized implementation in Shapefile driver
* Add OLCFastGetExtent3D

Refs #8570
@rouault
Copy link
Member Author

rouault commented Nov 30, 2023

Keeping it open as we'd want to add GeoPackage and PostGIS implementations

@rouault rouault reopened this Nov 30, 2023
elpaso added a commit to elpaso/gdal that referenced this issue Dec 4, 2023
@rouault
Copy link
Member Author

rouault commented Feb 19, 2024

done

@rouault rouault closed this as completed Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants