nodata bug fix#277
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates reVRt’s GeoTIFF ingestion/processing pipeline to treat GeoTIFF nodata as missing values (NaNs via masked reads) instead of assuming users pre-clean rasters, and introduces configurable NA filling during layer construction.
Changes:
- Update
load_data_using_layer_file_profile()to open GeoTIFFs withmasked=True, optionally reproject to the LayeredFile profile, and optionally fill NA cells. - Introduce
LayerBuildConfig.na_filland apply NA filling in raster pass-through processing and vector rasterization background fill. - Expand unit/integration coverage for nodata-as-NaN behavior and NA filling; bump package version to
0.7.1.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/python/unit/utilities/test_utilities_handlers.py | Adds a unit test verifying nodata becomes NaN and optional fillna behavior. |
| tests/python/unit/costs/test_costs_layer_creator.py | Adds tests for NA fill behavior in raster processing (including large negative nodata) and vector rasterization background fill. |
| tests/python/integration/test_utilties_handlers.py | Updates integration assertions to use masked reads and equal_nan=True comparisons. |
| revrt/utilities/handlers.py | Routes GeoTIFF ingestion through load_data_using_layer_file_profile() to preserve nodata as NaN. |
| revrt/utilities/base.py | Implements masked GeoTIFF loading + optional reprojection and NA fill behavior. |
| revrt/models/cost_layers.py | Adds na_fill to LayerBuildConfig and removes Rasterize.fill. |
| revrt/costs/layer_creator.py | Applies na_fill after raster processing and uses it as the vector rasterization background fill. |
| revrt/costs/cli.py | Returns the created routing layer file path from build_routing_layer_file(). |
| pyproject.toml | Bumps version to 0.7.1. |
| pixi.lock | Updates lock metadata for the version bump. |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (91.66%) is below the target coverage (93.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #277 +/- ##
==========================================
- Coverage 96.66% 96.63% -0.03%
==========================================
Files 27 27
Lines 3234 3237 +3
Branches 391 391
==========================================
+ Hits 3126 3128 +2
Misses 61 61
- Partials 47 48 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Code was assuming user has pre-processed nodata values out of rasters. Now, we no longer make that assumption but instead read the tiff file with the nodata as NaNs and allow the user to fill the NaNs.