[GRASS-SVN] r73639 - grass/branches/releasebranch_7_4/raster/r.external

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 2 01:39:23 PDT 2018


Author: mmetz
Date: 2018-11-02 01:39:23 -0700 (Fri, 02 Nov 2018)
New Revision: 73639

Modified:
   grass/branches/releasebranch_7_4/raster/r.external/link.c
Log:
r.external: do not rely on statistics stored in metadata, they can be approximations (fixes #3690)

Modified: grass/branches/releasebranch_7_4/raster/r.external/link.c
===================================================================
--- grass/branches/releasebranch_7_4/raster/r.external/link.c	2018-11-01 17:54:02 UTC (rev 73638)
+++ grass/branches/releasebranch_7_4/raster/r.external/link.c	2018-11-02 08:39:23 UTC (rev 73639)
@@ -8,8 +8,6 @@
 void query_band(GDALRasterBandH hBand, const char *output,
 		struct Cell_head *cellhd, struct band_info *info)
 {
-    int bGotMin, bGotMax;
-
     info->gdal_type = GDALGetRasterDataType(hBand);
 
     info->null_val = GDALGetRasterNoDataValue(hBand, &info->has_null);
@@ -49,10 +47,7 @@
 	break;
     }
 
-    info->range[0] = GDALGetRasterMinimum(hBand, &bGotMin);
-    info->range[1] = GDALGetRasterMaximum(hBand, &bGotMax);
-    if(!(bGotMin && bGotMax))
-	GDALComputeRasterMinMax(hBand, 0, info->range);
+    GDALComputeRasterMinMax(hBand, 0, info->range);
 
     Rast_init_colors(&info->colors);
 



More information about the grass-commit mailing list