[GRASS-SVN] r61852 - in grass/trunk/lib/gis: . colors

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Sep 10 12:29:17 PDT 2014


Author: mmetz
Date: 2014-09-10 12:29:17 -0700 (Wed, 10 Sep 2014)
New Revision: 61852

Modified:
   grass/trunk/lib/gis/colors/ndvi
   grass/trunk/lib/gis/flate.c
   grass/trunk/lib/gis/getl.c
   grass/trunk/lib/gis/gisinit.c
   grass/trunk/lib/gis/ll_scan.c
   grass/trunk/lib/gis/wind_format.c
Log:
libgis: partially revert r61851

Modified: grass/trunk/lib/gis/colors/ndvi
===================================================================
--- grass/trunk/lib/gis/colors/ndvi	2014-09-10 19:14:55 UTC (rev 61851)
+++ grass/trunk/lib/gis/colors/ndvi	2014-09-10 19:29:17 UTC (rev 61852)
@@ -1,12 +1,21 @@
--200 white
--1.0000 white
--0.3000 0:0:100 
--0.2000 205:193:173
- 0.0000 150:150:150
- 0.1000 120:100:51
- 0.3000 120:200:100
- 0.4000 28:144:3
- 0.6000 6:55:0
- 0.8000 10:30:25
- 1.0000 100:0:60
- 200 100:0:60
+-1.000   5  24  82
+-0.300   5  24  82
+-0.180 255 255 255
+ 0.000 255 255 255
+ 0.025 206 197 180
+ 0.075 191 163 124
+ 0.125 179 174  96
+ 0.150 163 181  80
+ 0.175 144 170  60
+ 0.233 166 195  29
+ 0.266 135 183   3
+ 0.333 121 175   1
+ 0.366 101 163   0
+ 0.433  78 151   0
+ 0.466  43 132   4
+ 0.550   0 114   0
+ 0.650   0  90   1
+ 0.750   0  73   0
+ 0.850   0  56   0
+ 0.950   0  31   0
+ 1.000   0   0   0

Modified: grass/trunk/lib/gis/flate.c
===================================================================
--- grass/trunk/lib/gis/flate.c	2014-09-10 19:14:55 UTC (rev 61851)
+++ grass/trunk/lib/gis/flate.c	2014-09-10 19:29:17 UTC (rev 61852)
@@ -333,7 +333,7 @@
     /* zlib default: Z_DEFAULT_COMPRESSION = -1, equivalent to 6 
      * as used here, 1 gives the best compromise between speed and compression */
     err = deflateInit(&c_stream,
-                      (G__.compression_level < -1 || G__.compression_level > 9)
+                      (G__.compression_level < -1 || G__.compression_level > 9) 
 		      ? 1 : G__.compression_level);
 
     /* If there was an error initializing, return -1 */

Modified: grass/trunk/lib/gis/getl.c
===================================================================
--- grass/trunk/lib/gis/getl.c	2014-09-10 19:14:55 UTC (rev 61851)
+++ grass/trunk/lib/gis/getl.c	2014-09-10 19:29:17 UTC (rev 61852)
@@ -55,7 +55,7 @@
  * must be allocated for the string buffer.
  *
  * \param buf: string buffer to receive read data, at least <i>n</i> must be allocated
- * \param n: number of bytes allocated for buf, at most <i>n - 1</i> are read
+ * \param n: maximum number of bytes to read
  * \param fd: file descriptor structure
  *
  * \return 1 on success
@@ -67,7 +67,7 @@
     int c;
     int ret = 1;
 
-    while (i < n) {
+    while (i < n - 1) {
 	c = fgetc(fd);
 
 	if (c == EOF) {
@@ -88,20 +88,12 @@
 	    }
 	    break;
 	}
-	
-	if (i < n - 1) {
-	    buf[i] = c;
-	}
 
+	buf[i] = c;
+
 	i++;
     }
+    buf[i] = '\0';
 
-    if (i < n)
-	buf[i] = '\0';
-    else {
-	buf[n - 1] = '\0';
-	ret = -1;
-    }
-
     return ret;
 }

Modified: grass/trunk/lib/gis/gisinit.c
===================================================================
--- grass/trunk/lib/gis/gisinit.c	2014-09-10 19:14:55 UTC (rev 61851)
+++ grass/trunk/lib/gis/gisinit.c	2014-09-10 19:29:17 UTC (rev 61852)
@@ -117,13 +117,8 @@
     /* byte order */
     G__.little_endian = G_is_little_endian();
 
-    /* zlib compression level for raster maps */
     zlib = getenv("GRASS_ZLIB_LEVEL");
-    G__.compression_level = (zlib && *zlib) ? atoi(zlib) : 1;
-    if (zlib && G__.compression_level == 0) {
-	G_warning(_("Raster compression disabled with %s=%s"), 
-		"GRASS_ZLIB_LEVEL", zlib);
-    }
+    G__.compression_level = (zlib && *zlib && isdigit(*zlib)) ? atoi(zlib) : -2;
 
     initialized = 1;
 

Modified: grass/trunk/lib/gis/ll_scan.c
===================================================================
--- grass/trunk/lib/gis/ll_scan.c	2014-09-10 19:14:55 UTC (rev 61851)
+++ grass/trunk/lib/gis/ll_scan.c	2014-09-10 19:29:17 UTC (rev 61852)
@@ -48,7 +48,7 @@
 
 int G_lon_scan(const char *buf, double *lon)
 {
-    return scan_ll(buf, "we", lon, 360);
+    return scan_ll(buf, "we", lon, 180);
 }
 
 int G_llres_scan(const char *buf, double *res)

Modified: grass/trunk/lib/gis/wind_format.c
===================================================================
--- grass/trunk/lib/gis/wind_format.c	2014-09-10 19:14:55 UTC (rev 61851)
+++ grass/trunk/lib/gis/wind_format.c	2014-09-10 19:29:17 UTC (rev 61852)
@@ -87,7 +87,7 @@
     if (full_prec)
 	sprintf(buf, "%.15g", value);
     else
-	sprintf(buf, "%.8g", value);
+	sprintf(buf, "%.8f", value);
 
     G_trim_decimal(buf);
 }



More information about the grass-commit mailing list