Commit 949675f
fix(geospatial): add epsilon tolerance for boundary points
Add configurable epsilon parameter to GeospatialIndex to handle points
on or near cell boundaries. The epsilon is used for:
- Expanding bounding box tests (bbox ± epsilon)
- ConvexHull hyperplane distance tests (distance <= epsilon)
Default epsilon=1e-6 works well for grids with coordinates up to ~10,000 units.
This fixes errors where valid points near boundaries were incorrectly
rejected as outside the model area, such as:
- point (0.1, 8999.9, -16.67) in DISU grids
- point (0.1, 10499.9, 310.0) in larger grids
The old matplotlib Path.contains_point() approach used radius=1e-9 to
include edge points. The new ConvexHull approach uses epsilon=1e-6 which
provides similar edge inclusion while being more robust for larger grids.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 26281ab commit 949675f
1 file changed
+18
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
| 38 | + | |
| 39 | + | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
| |||
55 | 61 | | |
56 | 62 | | |
57 | 63 | | |
58 | | - | |
| 64 | + | |
59 | 65 | | |
60 | 66 | | |
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
65 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
66 | 75 | | |
67 | 76 | | |
| 77 | + | |
68 | 78 | | |
69 | 79 | | |
70 | 80 | | |
| |||
357 | 367 | | |
358 | 368 | | |
359 | 369 | | |
360 | | - | |
| 370 | + | |
| 371 | + | |
361 | 372 | | |
362 | | - | |
| 373 | + | |
| 374 | + | |
363 | 375 | | |
364 | 376 | | |
365 | 377 | | |
366 | 378 | | |
367 | 379 | | |
368 | | - | |
| 380 | + | |
| 381 | + | |
369 | 382 | | |
370 | | - | |
| 383 | + | |
371 | 384 | | |
372 | 385 | | |
373 | 386 | | |
| |||
0 commit comments