[GRASS-SVN] r46713 - grass-addons/raster/r.colors.out_vtk

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jun 15 05:41:48 EDT 2011


Author: hamish
Date: 2011-06-15 02:41:48 -0700 (Wed, 15 Jun 2011)
New Revision: 46713

Modified:
   grass-addons/raster/r.colors.out_vtk/r.colors.out_vtk
Log:
bugfixes

Modified: grass-addons/raster/r.colors.out_vtk/r.colors.out_vtk
===================================================================
--- grass-addons/raster/r.colors.out_vtk/r.colors.out_vtk	2011-06-15 09:34:25 UTC (rev 46712)
+++ grass-addons/raster/r.colors.out_vtk/r.colors.out_vtk	2011-06-15 09:41:48 UTC (rev 46713)
@@ -99,20 +99,20 @@
 
 if [ $GIS_FLAG_N -eq 1 ] ; then
 
-   eval `r.info -r "$GIS_OPT_INPUT"`
+   eval `r.info -r "$GIS_OPT_MAP"`
 
-   r.colors.out -p map="$GIS_OPT_INPUT" rules=- | \
-      tr ':' ' ' | awk -v MIN="$min" -v MAX="$max" \
+   r.colors.out -p map="$GIS_OPT_MAP" rules=- | grep '^[0-9]' | tr ':' ' ' | \
+      awk -v MIN="$min" -v MAX="$max" \
        '{ VALUE = ($1 - MIN)/(MAX - MIN)
-           printf("<Point x=\"%g\" o=\"%g\" r=\"%.3f\" g=\"%.3f\" b=\"%.3f\"/>\n", \
+           printf("  <Point x=\"%g\" o=\"%g\" r=\"%.3f\" g=\"%.3f\" b=\"%.3f\"/>\n", \
                   VALUE, VALUE, $2/255., $3/255., $4/255.)}' \
       >> "$GIS_OPT_OUTPUT"
 
    RCO_EXITCODE=$?
 else
-   r.colors.out map="$GIS_OPT_INPUT" rules=- | \
-      tr ':' ' ' | awk '{printf("<Point x=\"%g\" o=\"1\" r=\"%.3f\" g=\"%.3f\" b=\"%.3f\"/>\n", \
-          $1, $2/255., $3/255., $4/255.)}' >> "$GIS_OPT_OUTPUT"
+   r.colors.out map="$GIS_OPT_MAP" rules=- | grep '^[0-9]' | tr ':' ' ' | \
+      awk '{printf("  <Point x=\"%g\" o=\"1\" r=\"%.3f\" g=\"%.3f\" b=\"%.3f\"/>\n", \
+                   $1, $2/255., $3/255., $4/255.)}' >> "$GIS_OPT_OUTPUT"
 
    RCO_EXITCODE=$?
 fi



More information about the grass-commit mailing list