[GRASS-SVN] r54946 - grass-addons/grass6/raster/r.in.onearth

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Feb 5 19:14:39 PST 2013


Author: hamish
Date: 2013-02-05 19:14:39 -0800 (Tue, 05 Feb 2013)
New Revision: 54946

Modified:
   grass-addons/grass6/raster/r.in.onearth/r.in.onearth
Log:
bugfix: if loc'n was LL, there was no convergence angle skew, so no alpha channel, so the crop failed and the final output maps were not created

Modified: grass-addons/grass6/raster/r.in.onearth/r.in.onearth
===================================================================
--- grass-addons/grass6/raster/r.in.onearth/r.in.onearth	2013-02-05 20:05:16 UTC (rev 54945)
+++ grass-addons/grass6/raster/r.in.onearth/r.in.onearth	2013-02-06 03:14:39 UTC (rev 54946)
@@ -357,13 +357,23 @@
 	r.in.gdal input="$IMAGEFILE" output="$OUTNAME.tmp_$$" --quiet
 
 	# crop away no data introduced by differing convergence angle
-	g.region "rast=$OUTNAME.tmp_$$.alpha"
-	for COLOR in red green blue ; do
-	    r.mapcalc "$OUTNAME.$COLOR = \
-	      if($OUTNAME.tmp_$$.alpha == 0, null(), $OUTNAME.tmp_$$.$COLOR)" &
-	done
-	wait
+	eval `g.findfile element=cell mapset=. file="$OUTNAME.tmp_$$.alpha"`
+	if [ -n "$file" ] ; then
+	    g.region "rast=$OUTNAME.tmp_$$.alpha"
 
+	    for COLOR in red green blue ; do
+		r.mapcalc "$OUTNAME.$COLOR = \
+		  if($OUTNAME.tmp_$$.alpha == 0, null(), $OUTNAME.tmp_$$.$COLOR)" &
+	    done
+	    wait
+
+	else
+	    g.region "rast=$OUTNAME.tmp_$$.red"
+	    for COLOR in red green blue ; do
+		g.rename "$OUTNAME.tmp_$$.$COLOR,$OUTNAME.$COLOR" --quiet
+	    done
+	fi
+
 	for COLOR in red green blue ; do
 	    r.colors "$OUTNAME.$COLOR" color=grey255 --quiet
 	    r.support "$OUTNAME.$COLOR" \



More information about the grass-commit mailing list