[GRASS-SVN] r45479 - in grass-addons/raster: . r.unpack r.unpack.mat

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Feb 27 12:32:24 EST 2011


Author: neteler
Date: 2011-02-27 09:32:24 -0800 (Sun, 27 Feb 2011)
New Revision: 45479

Added:
   grass-addons/raster/r.unpack.mat/
   grass-addons/raster/r.unpack.mat/Makefile
   grass-addons/raster/r.unpack.mat/description.html
   grass-addons/raster/r.unpack.mat/r.unpack.mat
Removed:
   grass-addons/raster/r.unpack/r.unpack.mat
Log:
moved out r.unpack.mat into own dir; doc added

Deleted: grass-addons/raster/r.unpack/r.unpack.mat
===================================================================
--- grass-addons/raster/r.unpack/r.unpack.mat	2011-02-27 17:29:19 UTC (rev 45478)
+++ grass-addons/raster/r.unpack/r.unpack.mat	2011-02-27 17:32:24 UTC (rev 45479)
@@ -1,116 +0,0 @@
-#!/bin/sh
-#  r.unpack   --  unpack up a raster map packed with r.pack:
-#     tar+gzip => r.in.mat + support files
-#
-#   (c) 2004 GRASS Development Team
-#   AUTHOR: Hamish Bowman, Otago University, New Zealand
-#
-#   This program is free software under the GNU General Public
-#   License (>=v2). Read the file COPYING that comes with GRASS
-#   for details.
-#
-
-#%Module
-#%  description: UnPacks a raster map packed with r.pack
-#%End
-#%option
-#% key: input
-#% type: string
-#% gisprompt: file,file,file
-#% description: Name of an existing pack file
-#% required : yes
-#%end
-#%flag
-#%  key: o
-#%  description: Override projection (use location's projection)
-#%end
-
-
-if [ -z "$GISBASE" ] ; then
-   echo "You must be in GRASS GIS to run this program." >&2
-   exit 1
-fi   
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-   exec g.parser "$0" "$@"
-fi
-
-# check for tar  (is there a better way?)
-if [ -z "`which tar`" ] ; then
-   echo "ERROR: tar must be installed to use this program."
-   exit 1
-fi
-# check for gzip
-if [ -z "`which gzip`" ] ; then
-   echo "ERROR: gzip must be installed to use this program."
-   exit 1
-fi
-
-
-eval `g.gisenv`
-MSET_DIR="$GISDBASE/$LOCATION_NAME/$MAPSET"
-
-
-if [ ! -e "$GIS_OPT_INPUT" ] ; then
-   echo "ERROR: file not found [$GIS_OPT_INPUT]"
-   exit 1
-fi
-
-# remove .pack and path from $GIS_OPT_INPUT
-MAP_NAME="`basename "$GIS_OPT_INPUT" | sed -e 's/\.pack$//'`"
-echo "The imported map will be named [$MAP_NAME]."
-
-eval `g.findfile element=cell file="$MAP_NAME"`
-if [ ! -z "$file" ] ; then
-   echo "ERROR: '$MAP_NAME' already exists."
-   exit 1
-fi
-
-
-# create temporary directory to hold bits
-TMP_DIR="`g.tempfile pid=$$`"
-if [ $? -ne 0 ] || [ -z "$TMP_DIR" ] ; then
-   echo "ERROR: unable to create temporary files" 1>&2
-   exit 1
-fi
-rm -f "$TMP_DIR"
-mkdir "$TMP_DIR"
-if [ ! -d "$TMP_DIR" ] ; then
-   echo "ERROR: unable to create temporary directory" 1>&2
-   exit 1
-fi
-
-
-cp "$GIS_OPT_INPUT" "$TMP_DIR"/
-cd "$TMP_DIR"/
-tar xzf "`basename $GIS_OPT_INPUT`"
-
-
-# check projection compatibility in a rather crappy way
-if [ ! -z "`diff proj_info "$MSET_DIR"/../PERMANENT/PROJ_INFO`" ] ; then
-    if [ $GIS_FLAG_O -eq 1 ] ; then
-        echo "WARNING: Projection information does not match. Proceeding.."
-    else
-        echo "ERROR: Projection information does not match. Aborting."
-        # clean up
-        cd "$MSET_DIR"
-        rm -rf "$TMP_DIR"
-        exit 1
-    fi
-fi
-
-
-r.in.mat input=map.mat output="$MAP_NAME"
-
-for SUPPORT in colr hist cats ; do 
-    if [ -e $SUPPORT ] ; then
-        cp $SUPPORT "$MSET_DIR"/$SUPPORT/"$MAP_NAME"
-    fi
-done
-
-
-# clean up
-cd "$MSET_DIR"
-rm -rf "$TMP_DIR"
-
-echo Finished.
-exit 0

Copied: grass-addons/raster/r.unpack.mat/Makefile (from rev 45458, grass-addons/raster/r.unpack/Makefile)
===================================================================
--- grass-addons/raster/r.unpack.mat/Makefile	                        (rev 0)
+++ grass-addons/raster/r.unpack.mat/Makefile	2011-02-27 17:32:24 UTC (rev 45479)
@@ -0,0 +1,7 @@
+MODULE_TOPDIR = ../..
+
+PGM = r.unpack.mat
+
+include $(MODULE_TOPDIR)/include/Make/Script.make
+
+default: script

Added: grass-addons/raster/r.unpack.mat/description.html
===================================================================
--- grass-addons/raster/r.unpack.mat/description.html	                        (rev 0)
+++ grass-addons/raster/r.unpack.mat/description.html	2011-02-27 17:32:24 UTC (rev 45479)
@@ -0,0 +1,13 @@
+<h2>DESCRIPTION</h2>
+
+<em>r.unpack</em> unpacks a binary MAT-File map packed with r.pack.mat.
+
+<h2>SEE ALSO</h2>
+
+<em><a href="r.pack.mat.html">r.pack.mat</a></em>
+
+<h2>AUTHOR</h2>
+
+Hamish Bowman, Otago University, New Zealand
+
+<p><i>Last changed: $Date: 2008-05-20 20:26:19 +0200 (Tue, 20 May 2008) $</i>

Copied: grass-addons/raster/r.unpack.mat/r.unpack.mat (from rev 45458, grass-addons/raster/r.unpack/r.unpack.mat)
===================================================================
--- grass-addons/raster/r.unpack.mat/r.unpack.mat	                        (rev 0)
+++ grass-addons/raster/r.unpack.mat/r.unpack.mat	2011-02-27 17:32:24 UTC (rev 45479)
@@ -0,0 +1,116 @@
+#!/bin/sh
+#  r.unpack.mat   --  unpack up a binary MAT-File(v4) map packed with r.pack.mat:
+#     tar+gzip => r.in.mat + support files
+#
+#   (c) 2004 GRASS Development Team
+#   AUTHOR: Hamish Bowman, Otago University, New Zealand
+#
+#   This program is free software under the GNU General Public
+#   License (>=v2). Read the file COPYING that comes with GRASS
+#   for details.
+#
+
+#%Module
+#%  description: Unpacks a binary MAT-File map packed with r.pack.mat
+#%End
+#%option
+#% key: input
+#% type: string
+#% gisprompt: file,file,file
+#% description: Name of an existing pack file
+#% required : yes
+#%end
+#%flag
+#%  key: o
+#%  description: Override projection (use location's projection)
+#%end
+
+
+if [ -z "$GISBASE" ] ; then
+   echo "You must be in GRASS GIS to run this program." >&2
+   exit 1
+fi   
+if [ "$1" != "@ARGS_PARSED@" ] ; then
+   exec g.parser "$0" "$@"
+fi
+
+# check for tar  (is there a better way?)
+if [ -z "`which tar`" ] ; then
+   echo "ERROR: tar must be installed to use this program."
+   exit 1
+fi
+# check for gzip
+if [ -z "`which gzip`" ] ; then
+   echo "ERROR: gzip must be installed to use this program."
+   exit 1
+fi
+
+
+eval `g.gisenv`
+MSET_DIR="$GISDBASE/$LOCATION_NAME/$MAPSET"
+
+
+if [ ! -e "$GIS_OPT_INPUT" ] ; then
+   echo "ERROR: file not found [$GIS_OPT_INPUT]"
+   exit 1
+fi
+
+# remove .pack and path from $GIS_OPT_INPUT
+MAP_NAME="`basename "$GIS_OPT_INPUT" | sed -e 's/\.pack$//'`"
+echo "The imported map will be named [$MAP_NAME]."
+
+eval `g.findfile element=cell file="$MAP_NAME"`
+if [ ! -z "$file" ] ; then
+   echo "ERROR: '$MAP_NAME' already exists."
+   exit 1
+fi
+
+
+# create temporary directory to hold bits
+TMP_DIR="`g.tempfile pid=$$`"
+if [ $? -ne 0 ] || [ -z "$TMP_DIR" ] ; then
+   echo "ERROR: unable to create temporary files" 1>&2
+   exit 1
+fi
+rm -f "$TMP_DIR"
+mkdir "$TMP_DIR"
+if [ ! -d "$TMP_DIR" ] ; then
+   echo "ERROR: unable to create temporary directory" 1>&2
+   exit 1
+fi
+
+
+cp "$GIS_OPT_INPUT" "$TMP_DIR"/
+cd "$TMP_DIR"/
+tar xzf "`basename $GIS_OPT_INPUT`"
+
+
+# check projection compatibility in a rather crappy way
+if [ ! -z "`diff proj_info "$MSET_DIR"/../PERMANENT/PROJ_INFO`" ] ; then
+    if [ $GIS_FLAG_O -eq 1 ] ; then
+        echo "WARNING: Projection information does not match. Proceeding.."
+    else
+        echo "ERROR: Projection information does not match. Aborting."
+        # clean up
+        cd "$MSET_DIR"
+        rm -rf "$TMP_DIR"
+        exit 1
+    fi
+fi
+
+
+r.in.mat input=map.mat output="$MAP_NAME"
+
+for SUPPORT in colr hist cats ; do 
+    if [ -e $SUPPORT ] ; then
+        cp $SUPPORT "$MSET_DIR"/$SUPPORT/"$MAP_NAME"
+    fi
+done
+
+
+# clean up
+cd "$MSET_DIR"
+rm -rf "$TMP_DIR"
+
+echo Finished.
+exit 0



More information about the grass-commit mailing list