[GRASS-SVN] r73300 - grass/trunk/imagery/i.segment
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Sep 9 01:23:55 PDT 2018
Author: mmetz
Date: 2018-09-09 01:23:55 -0700 (Sun, 09 Sep 2018)
New Revision: 73300
Modified:
grass/trunk/imagery/i.segment/open_files.c
Log:
i.segment: input bands must not be NULL or constant
Modified: grass/trunk/imagery/i.segment/open_files.c
===================================================================
--- grass/trunk/imagery/i.segment/open_files.c 2018-09-08 12:55:52 UTC (rev 73299)
+++ grass/trunk/imagery/i.segment/open_files.c 2018-09-09 08:23:55 UTC (rev 73300)
@@ -57,6 +57,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