-
Notifications
You must be signed in to change notification settings - Fork 11
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
jgrss/warp cleanup #306
jgrss/warp cleanup #306
Conversation
@mmann1123 if you have time, could you test this branch out with some of your data? |
Sure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Working on my end. I also added bigtiff to .save() please take a look. I added comments in the places you should look.
@@ -96,63 +96,82 @@ def test_to_raster_multi(self): | |||
# except FileExistsError: | |||
# self.assertTrue(False) | |||
|
|||
def test_bigtiff(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jgrss new test
src/geowombat/core/io.py
Outdated
@@ -786,7 +792,12 @@ def save( | |||
compress=compress, | |||
tiled=True if max(blockxsize, blockysize) >= 16 else False, | |||
sharing=False, | |||
bigtiff="IF_SAFER", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jgrss piling on here. I need to have bigtiff available for save
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an issue here trying it out on my files and I'm seeing empty rasters after mosaicing. Unfortunately I need to sign off and can't dig into why
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the issues i was having had to do with hitting memory limits, mosaicing huge 18 band images must have been bonking it. I've tried to recreate the issues on reasonably large datasets and haven't had the same issue. I think this is working well for almost all purposes.
resolves #309
resolves #309 |
] | ||
|
||
# Apply the reduction | ||
darray = functools.reduce( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmann1123 this is the main change for mosaicking.
self.assertTrue(data.equals(tmp_src)) | ||
# Compare attributes | ||
self.assertTrue( | ||
data.gw.nodataval == tmp_src.gw.nodataval == NODATA |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmann1123 new test to check that the nodata
value was properly saved and read.
data.gw.nodata, float | ||
): | ||
kwargs['nodata'] = data.gw.nodata | ||
if kwargs.get("nodata") is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmann1123 this is the fix for ensuring the nodata
value gets saved. Everything else in this file is auto-formatting.
@mmann1123 I added a few more tests, which exposed a bug in |
@@ -739,6 +739,7 @@ def save( | |||
num_workers: T.Optional[int] = 1, | |||
log_progress: T.Optional[bool] = True, | |||
tqdm_kwargs: T.Optional[dict] = None, | |||
bigtiff: T.Optional[str] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmann1123 Does this work for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
@mmann1123 I made |
That works. |
Were you referring to this?
|
We can postpone this merge if you want to diagnose the large raster mosaicking. Is the file too large to upload and share? |
I think we merge this, but we can open a large mosaic issue. |
What is this PR changing?
mosaic()
method and ensures support for multi-band mosaicsto_raster()
, wherenodata
values were not being written to filebigtiff
keyword argument tosave()
method