[GRASS-SVN] r30137 - grass/trunk/scripts/r.in.srtm

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Feb 14 00:09:56 EST 2008


Author: hamish
Date: 2008-02-14 00:09:56 -0500 (Thu, 14 Feb 2008)
New Revision: 30137

Modified:
   grass/trunk/scripts/r.in.srtm/r.in.srtm
Log:
exit cleanly if r.in.gdal failed

Modified: grass/trunk/scripts/r.in.srtm/r.in.srtm
===================================================================
--- grass/trunk/scripts/r.in.srtm/r.in.srtm	2008-02-14 02:29:00 UTC (rev 30136)
+++ grass/trunk/scripts/r.in.srtm/r.in.srtm	2008-02-14 05:09:56 UTC (rev 30137)
@@ -183,7 +183,7 @@
 fi
 
 g.message "Converting input file to BIL..."
-mv $TILE.hgt "$TMPDIR"/"$TILE.bil"
+mv "$TILE.hgt" "${TMPDIR}/$TILE.bil"
 
 LL_LATITUDE=`echo $TILE  | cut -b2-3`
 LL_LONGITUDE=`echo $TILE | cut -b5-7`
@@ -245,11 +245,18 @@
 echo "GEOGCS["wgs84",DATUM["WGS_1984",SPHEROID["wgs84",6378137,298.257223563],TOWGS84[0.000000,0.000000,0.000000]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]" > $TILE.prj
 
 r.in.gdal in="$TILE.bil" out="$TILEOUT"
+EXITCODE=$?
 
 \rm -f "$TILE.bil" "$TILE.hdr" "$TILE.prj" "$TILE.hgt.zip"
 cd ..
 rmdir "$TMPDIR"
 
+if [ "$EXITCODE" -ne 0 ] ; then
+   g.message -e "Unable to import data"
+   exit 1
+fi
+
+
 #nice color table #and zoom to tile
 r.colors color=srtm map="$TILEOUT"
 #g.region rast=$TILEOUT



More information about the grass-commit mailing list