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

r.buildvrt: check if all input maps are NULL-only #2220

Merged
merged 2 commits into from
Feb 18, 2022
Merged

r.buildvrt: check if all input maps are NULL-only #2220

merged 2 commits into from
Feb 18, 2022

Conversation

neteler
Copy link
Member

@neteler neteler commented Feb 18, 2022

Do not continue if all input raster maps only contain no-data.
Feel free to suggest a better error message.

To Reproduce

r.mapcalc expression="a=null()"
r.mapcalc expression="b=null()"
r.buildvrt input=a,b output=c

Old behaviour:

GRASS nc_spm_08_grass7/user1:grass_main > r.buildvrt input=a,b output=c --verbose
Input map <a@user1> is all NULL, skipping
Input map <b@user1> is all NULL, skipping
WARNING: Illegal filename <���>. Character <�> not allowed.
ERROR: Raster map <���> not found in mapset <���>

New error message:

GRASS nc_spm_08_grass7/user1:grass_main > r.buildvrt input=a,b output=c --verbose
Input map <a@user1> is all NULL, skipping
Input map <b@user1> is all NULL, skipping
ERROR: All input maps only contain NULL, cannot continue

Fixes #2217

Do not continue if all input raster maps only contain no-data.

Fixes 2217
@neteler neteler added bug Something isn't working backport_needed labels Feb 18, 2022
@neteler neteler added this to the 8.0.2 milestone Feb 18, 2022
@neteler neteler requested review from ninsbl and metzm February 18, 2022 07:42
@neteler neteler self-assigned this Feb 18, 2022
Copy link
Member

@ninsbl ninsbl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Thanks for the quick fix!

Copy link
Contributor

@metzm metzm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@ninsbl
Copy link
Member

ninsbl commented Feb 18, 2022

While you are at it, you may probably also change the warning message here:

G_warning(_("Input ns resolutions are different"));

which should read:
"Input ew resolutions are different" (and not "Input ns resolutions are different", note the direction ew/ns).

@neteler
Copy link
Member Author

neteler commented Feb 18, 2022

While you are at it, you may probably also change the warning message here:

G_warning(_("Input ns resolutions are different"));

which should read:
"Input ew resolutions are different" (and not "Input ns resolutions are different", note the direction ew/ns).

Sure, done in e193fc2

@neteler neteler merged commit f540063 into OSGeo:main Feb 18, 2022
@neteler neteler deleted the r_buildvrt_catch_NULL_input branch February 18, 2022 15:17
@neteler
Copy link
Member Author

neteler commented Feb 18, 2022

(Backport once 8.0.1 is out)

neteler added a commit that referenced this pull request Mar 24, 2022
Do not continue if all input raster maps only contain no-data.

Fixes 2217
@neteler
Copy link
Member Author

neteler commented Mar 24, 2022

(Backport once 8.0.1 is out)

done

ninsbl pushed a commit to ninsbl/grass that referenced this pull request Oct 26, 2022
Do not continue if all input raster maps only contain no-data.

Fixes 2217
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
Do not continue if all input raster maps only contain no-data.

Fixes 2217
neteler added a commit to nilason/grass that referenced this pull request Nov 7, 2023
Do not continue if all input raster maps only contain no-data.

Fixes 2217
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] r.buildvrt: Missleading error message when tiles contain only NoData
3 participants