Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dataset/crop/bugfix/up-updated-extent-for-cropped-raster #75

Merged

Conversation

MAfarrag
Copy link
Member

@MAfarrag MAfarrag commented Dec 29, 2023

gdal.Wrap Error

correct the error when using the cutline in the gdal.wrap function to crop raster with a polygon, the error make the cropped raster has an array the same size as the old raster array (before cropping), this leads to a bug in calculating statistics and plotting.

The error is described in details in issue #74

Type of change

Check relevant points.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Please describe the tests that you ran to verify your changes.
    The test crops amulti-band raster with a polygon and trigger the gdal.wrap function with a False cutline parameter which result in the original array staying the same (only the values inside are cropped) and the array is full of the no_data_value, then the _crop_with_polygon_warp fuction triggers the correction function correct_wrap_cutline_error.

  • test_dataset::TestCropWithPolygon::test_by_warp_touch_multi_band

Checklist:

  • updated version number in setup.py/pyproject.toml.
  • updated environment.yml and the lock file.
  • added changes to History.rst.
  • updated the latest version in README file.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • documentation are updated.

Copy link

codecov bot commented Dec 29, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (d645dd6) 83.75% compared to head (ac8d361) 84.50%.

Files Patch % Lines
pyramids/dataset.py 89.47% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #75      +/-   ##
==========================================
+ Coverage   83.75%   84.50%   +0.74%     
==========================================
  Files           7        7              
  Lines        2118     2143      +25     
==========================================
+ Hits         1774     1811      +37     
+ Misses        344      332      -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MAfarrag MAfarrag merged commit b540ab2 into main Dec 31, 2023
10 checks passed
@MAfarrag MAfarrag deleted the dataset/crop/bugfix/up-updated-extent-for-cropped-raster branch December 31, 2023 04:12
@MAfarrag MAfarrag restored the dataset/crop/bugfix/up-updated-extent-for-cropped-raster branch December 31, 2023 04:25
@MAfarrag MAfarrag deleted the dataset/crop/bugfix/up-updated-extent-for-cropped-raster branch December 31, 2023 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant