Commit 3fa73b2
committed
Add rasterize accuracy test suite with invariant-based checks (#995)
41 tests exercising mathematical properties of correct rasterization:
- Watertight tiling: non-overlapping polygons counted exactly once
- Area conservation: rasterized area converges to analytic area
- Point-in-polygon cross-check: shapely.contains vs rasterized grid
- Annulus: polygon with hole matches pi*(R^2 - r^2)
- Symmetry: axis-aligned shapes perfectly symmetric, others bounded
- Merge mode identities: sum-with-ones equals count, etc.
- all_touched monotonicity: always a superset of normal fill
- rasterio reference: exact match for axis-aligned, <3% diff for slanted
- Edge cases: thin polygons, concave shapes, nearly-degenerate triangles1 parent d8d92e5 commit 3fa73b2
1 file changed
Lines changed: 724 additions & 0 deletions
0 commit comments