EOA-team / eodal

Earth Observation Data Analysis Library
https://eodal.readthedocs.io/en/latest/
GNU General Public License v3.0
93 stars 15 forks source link

Fix of nodata, fill value, mask and data type propagation in EOdal #78

Closed lukasValentin closed 1 year ago

lukasValentin commented 1 year ago

This PR addresses #77 that shed some light on masking issues in EOdal. In particular, the mask of the Sentinel-2 Scene Classification layer was not propagated correctly. While debugging this issue, I found some general problems with the propagation of data types, fill and nodata values caused by inconsistencies in the code and poor type checking.

The major fixes include:

In addition, a new feature was implemented allowing to create cloud-optimized GeoTiffs (COG) from RasterCollection objects. A new keyword-argument as_cog has been added to RasterCollection.to_rasterio. as_cog is False by default. If True, a COG will be generated.

codecov[bot] commented 1 year ago

Codecov Report

Merging #78 (63f9092) into master (239fa0d) will increase coverage by 0.12%. The diff coverage is 66.26%.

@@            Coverage Diff             @@
##           master      #78      +/-   ##
==========================================
+ Coverage   56.81%   56.94%   +0.12%     
==========================================
  Files          67       68       +1     
  Lines        5220     5265      +45     
  Branches     1047     1059      +12     
==========================================
+ Hits         2966     2998      +32     
- Misses       1957     1960       +3     
- Partials      297      307      +10     
Flag Coverage Δ
unittests 56.94% <66.26%> (+0.12%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
eodal/__meta__.py 100.00% <100.00%> (ø)
eodal/core/algorithms.py 67.07% <100.00%> (+1.68%) :arrow_up:
eodal/core/band.py 75.62% <100.00%> (+0.89%) :arrow_up:
eodal/core/sensors/sentinel2.py 61.72% <85.71%> (-0.26%) :arrow_down:
eodal/mapper/mapper.py 75.24% <50.00%> (-0.25%) :arrow_down:
eodal/core/utils/__init__.py 77.77% <77.77%> (ø)
eodal/utils/geometry.py 79.31% <0.00%> (-2.84%) :arrow_down:
eodal/core/raster.py 73.16% <38.88%> (-2.20%) :arrow_down:

... and 1 file with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more