-
-
Notifications
You must be signed in to change notification settings - Fork 363
r.out.gdal: Skip nodata and range checks if export is forced #6170
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
I see that r.out.gdal lacks a test. Will add one. [Done.] |
createopt="COMPRESS=LZW", | ||
) | ||
assert output_file.exists(), f"{mapname} not exportd to {output_file}" | ||
# Here I would like to assert "Checking GDAL data type and nodata value" not in std_err |
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 cannot figure out how to capture the std_err with Tools
... Setting the capture_stderr parameter in Tools to True does not seem to be enough... Any hints are moste welcome...
|
||
|
||
@pytest.mark.parametrize("file_format", list(FORMAT_DICT.keys())) | ||
def test_basic_cog_export(simple_raster_map, file_format): |
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.
This test fails for COG, although the export is successful as r.out.gdal gives returncode -11. I assume the warning about the MEM driver is the reason? How can I circumvent that false negative testresult?
This PR follows up a post on Discourse:
https://discourse.osgeo.org/t/r-out-gdal-performance-with-known-data-type-and-range/148619
The code changes make r.out.gdal skip data range and nodata checks if the f-flag (force export) as well as the nodata, and data type option are given by the user. In that case the assumption is the user has made a deliberate choice about this parameters. Skipping checks alomst cuts export time by half...
In a worflow I have to regularly export data to multi-band GeoTiff (COG actually) where I know the data range and the suitable GDAL data type across all bands to export in advance. Even though I use the -f flag and set the nodata option, a full data type and nodata check is performed on every band. To me that feels like unnecessary processing and seems inconsistent with the documentation of the -f flag.
Any feedback is welcome...