[GRASS-SVN] r73302 - grass/branches/releasebranch_7_4/imagery/i.segment
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Sep 9 01:24:56 PDT 2018
Author: mmetz
Date: 2018-09-09 01:24:56 -0700 (Sun, 09 Sep 2018)
New Revision: 73302
Modified:
grass/branches/releasebranch_7_4/imagery/i.segment/open_files.c
Log:
i.segment: input bands must not be NULL or constant (backport trunk r73300)
Modified: grass/branches/releasebranch_7_4/imagery/i.segment/open_files.c
===================================================================
--- grass/branches/releasebranch_7_4/imagery/i.segment/open_files.c 2018-09-09 08:24:40 UTC (rev 73301)
+++ grass/branches/releasebranch_7_4/imagery/i.segment/open_files.c 2018-09-09 08:24:56 UTC (rev 73302)
@@ -71,6 +71,14 @@
G_fatal_error(_("No min/max found in raster map <%s>"),
globals->Ref.file[n].name);
Rast_get_fp_range_min_max(&(fp_range[n]), &min[n], &max[n]);
+ if (Rast_is_d_null_value(&min[n])) {
+ G_fatal_error(_("Input map <%s> is all NULL"),
+ globals->Ref.file[n].name);
+ }
+ if (min[n] == max[n]) {
+ G_fatal_error(_("Input map <%s> is a constant of value %g"),
+ globals->Ref.file[n].name, min[n]);
+ }
G_debug(1, "Range for layer %d: min = %f, max = %f",
n, min[n], max[n]);
More information about the grass-commit
mailing list