Commit 328fa37
feat(geospatial): add unified GeospatialIndex for VertexGrid and UnstructuredGrid
Add KD-tree based spatial indexing with ConvexHull containment for fast
point-to-cell queries on unstructured grids.
Key features:
- KD-tree spatial indexing using cell centroids and vertices
- ConvexHull containment test for accurate point-in-cell detection
- Full 3D support with layer-aware queries using z-coordinate
- Consistent tie-breaking: lowest cell ID wins for boundary points
- 1:1 point-to-cell mapping (same number of outputs as inputs)
- Consistent return types: nan for outside, int/int64 for inside
Changes:
- Remove StructuredGrid support (uses its own optimized searchsorted)
- StructuredGrid.intersect now returns (nan, nan, nan) for outside with z
- query_point returns np.nan for outside (not None)
- query_points returns int64 when all inside, float64 when nan present
- Comprehensive test coverage for return type consistency
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 2f24768 commit 328fa37
File tree
6 files changed
+1389
-171
lines changed- autotest
- flopy
- discretization
- utils
6 files changed
+1389
-171
lines changed
0 commit comments