Skip to content

Commit

Permalink
r.buildvrt: check if all input maps are NULL-only (#2220)
Browse files Browse the repository at this point in the history
Do not continue if all input raster maps only contain no-data.

Fixes 2217
  • Loading branch information
neteler committed Mar 24, 2022
1 parent dc57aa3 commit 59d1c44
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion raster/r.buildvrt/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ int main(int argc, char *argv[])
}
num_inputs = j;
}
if (num_inputs == 0)
G_fatal_error(_("All input maps only contain NULL, cannot continue"));

qsort(inputs, num_inputs, sizeof(struct input), cmp_wnd);

Expand Down Expand Up @@ -261,7 +263,7 @@ int main(int argc, char *argv[])
if (strcmp(nsresstr, tnsresstr) != 0)
G_warning(_("Input ns resolutions are different"));
if (strcmp(ewresstr, tewresstr) != 0)
G_warning(_("Input ns resolutions are different"));
G_warning(_("Input ew resolutions are different"));

if (cellhd.north < p->cellhd.north)
cellhd.north = p->cellhd.north;
Expand Down

0 comments on commit 59d1c44

Please sign in to comment.