[GRASS-SVN] r41392 - in grass-addons/raster: r.out.gmt r.out.gmt2

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Mar 12 07:50:48 EST 2010


Author: hamish
Date: 2010-03-12 07:50:47 -0500 (Fri, 12 Mar 2010)
New Revision: 41392

Modified:
   grass-addons/raster/r.out.gmt/r.out.gmt
   grass-addons/raster/r.out.gmt2/r.out.gmt2
Log:
rm dupe code, add old-style colr file warning

Modified: grass-addons/raster/r.out.gmt/r.out.gmt
===================================================================
--- grass-addons/raster/r.out.gmt/r.out.gmt	2010-03-12 12:28:10 UTC (rev 41391)
+++ grass-addons/raster/r.out.gmt/r.out.gmt	2010-03-12 12:50:47 UTC (rev 41392)
@@ -198,14 +198,16 @@
    echo "# created by ${USER}@${HOSTNAME} at `date`" >> "$OUTPUT_CPT"
    echo "#" >> "$OUTPUT_CPT"
    echo "# COLOR_MODEL = RGB" >> "$OUTPUT_CPT"
-   
+
+   if [ `grep -c ':' "$COLR_FILE"` -eq 0 ] then
+      g.message -w "Old-style colr files not yet supported. CPT file will be bogus."
+      # e.g. streams at spearfish
+   fi
+
    for line in `cat "$COLR_FILE" | tail -n+2 | grep -v "^nv" | tr ' ' '|'` ; do
        C_BEGIN="`echo "$line" | cut -f1 -d'|'`"
        C_END="`echo "$line" | cut -f2 -d'|'`"
    
-       C_BEGIN="`echo "$line" | cut -f1 -d'|'`"
-       C_END="`echo "$line" | cut -f2 -d'|'`"
-   
        # translate 1 color value into 3
        if [ "`echo "$C_BEGIN" | tr ':' '\n' | wc -l`" -eq 2 ] ; then
    	RULE_CAT="`echo "$C_BEGIN" | cut -f1 -d:`"

Modified: grass-addons/raster/r.out.gmt2/r.out.gmt2
===================================================================
--- grass-addons/raster/r.out.gmt2/r.out.gmt2	2010-03-12 12:28:10 UTC (rev 41391)
+++ grass-addons/raster/r.out.gmt2/r.out.gmt2	2010-03-12 12:50:47 UTC (rev 41392)
@@ -235,14 +235,16 @@
 #
 # COLOR_MODEL = RGB
 EOT
-   
+
+   if [ `grep -c ':' "$colr_file"` -eq 0 ] then
+      g.message -w "Old-style colr files not yet supported. CPT file will be bogus."
+      # e.g. streams at spearfish
+   fi
+
    for line in `cat "$colr_file" | tail -n+2 | grep -v "^nv" | tr ' ' '|'`; do
        c_begin="`echo "$line" | cut -f1 -d'|'`"
        c_end="`echo "$line" | cut -f2 -d'|'`"
    
-       c_begin="`echo "$line" | cut -f1 -d'|'`"
-       c_end="`echo "$line" | cut -f2 -d'|'`"
-   
        # translate 1 color value into 3
        if [ "`echo "$c_begin" | tr ':' '\n' | wc -l`" -eq 2 ]; then
    	rule_cat="`echo "$c_begin" | cut -f1 -d:`"



More information about the grass-commit mailing list