[GRASS-SVN] r45477 - in grass-addons/raster: . r.pack r.pack.mat

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


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

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

Deleted: grass-addons/raster/r.pack/r.pack.mat
===================================================================
--- grass-addons/raster/r.pack/r.pack.mat	2011-02-27 17:16:05 UTC (rev 45476)
+++ grass-addons/raster/r.pack/r.pack.mat	2011-02-27 17:24:52 UTC (rev 45477)
@@ -1,88 +0,0 @@
-#!/bin/sh
-#  r.pack   --  pack up a raster map:
-#     r.out.mat file + support files => gzip
-#
-#   (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: Packs up a raster map and support files for copying
-#%End
-#%option
-#% key: input
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: Name of an existing raster map
-#% required : yes
-#%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
-
-
-# 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
-
-# output map
-r.out.mat input="$GIS_OPT_INPUT" output="$TMP_DIR"/map.mat
-
-
-# copy support files
-for SUPPORT in colr hist cats ; do 
-    eval `g.findfile element=$SUPPORT file="$GIS_OPT_INPUT"`
-    if [ ! -z "$file" ] ; then
-        cp "$file" "$TMP_DIR"/$SUPPORT
-    fi
-done
-
-
-# copy projection info
-#   (would prefer to use g.proj*, but this way is 5.3 and 5.7 compat)
-eval `g.gisenv`
-cp "$GISDBASE"/"$LOCATION_NAME"/PERMANENT/PROJ_INFO "$TMP_DIR"/proj_info
-
-
-# pack it all up
-OLD_DIR="`pwd`"
-cd "$TMP_DIR"/
-tar czf "$OLD_DIR"/"$GIS_OPT_INPUT".pack *
-
-
-# clean up
-cd "$OLD_DIR"
-rm -rf "$TMP_DIR"
-
-echo Finished.
-exit 0

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

Added: grass-addons/raster/r.pack.mat/description.html
===================================================================
--- grass-addons/raster/r.pack.mat/description.html	                        (rev 0)
+++ grass-addons/raster/r.pack.mat/description.html	2011-02-27 17:24:52 UTC (rev 45477)
@@ -0,0 +1,24 @@
+<h2>DESCRIPTION</h2>
+
+<em>r.pack.mat</em> packs up a GRASS raster map and related support files
+(color table etc) for copying to another computer as a single compressed
+binary MAT-File (gzip compression).
+
+<h2>EXAMPLE</h2>
+
+This command saves the raster map "elevation.dem" into the export
+file "elevation.dem.pack" which can be transferred to another computer:
+
+<div class="code"><pre> 
+r.pack.mat elevation.dem
+</pre></div>
+
+<h2>SEE ALSO</h2>
+
+<em><a href="r.unpack.mat.html">r.unpack.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.pack.mat/r.pack.mat (from rev 45458, grass-addons/raster/r.pack/r.pack.mat)
===================================================================
--- grass-addons/raster/r.pack.mat/r.pack.mat	                        (rev 0)
+++ grass-addons/raster/r.pack.mat/r.pack.mat	2011-02-27 17:24:52 UTC (rev 45477)
@@ -0,0 +1,88 @@
+#!/bin/sh
+#  r.pack   --  pack up a raster map as binary MAT-File:
+#     r.out.mat file + support files => gzip
+#
+#   (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: Packs up a raster map as binary MAT-File and support files for copying
+#%End
+#%option
+#% key: input
+#% type: string
+#% gisprompt: old,cell,raster
+#% description: Name of an existing raster map
+#% required : yes
+#%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
+
+
+# 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
+
+# output map
+r.out.mat input="$GIS_OPT_INPUT" output="$TMP_DIR"/map.mat
+
+
+# copy support files
+for SUPPORT in colr hist cats ; do 
+    eval `g.findfile element=$SUPPORT file="$GIS_OPT_INPUT"`
+    if [ ! -z "$file" ] ; then
+        cp "$file" "$TMP_DIR"/$SUPPORT
+    fi
+done
+
+
+# copy projection info
+#   (would prefer to use g.proj*, but this way is 5.3 and 5.7 compat)
+eval `g.gisenv`
+cp "$GISDBASE"/"$LOCATION_NAME"/PERMANENT/PROJ_INFO "$TMP_DIR"/proj_info
+
+
+# pack it all up
+OLD_DIR="`pwd`"
+cd "$TMP_DIR"/
+tar czf "$OLD_DIR"/"$GIS_OPT_INPUT".pack *
+
+
+# clean up
+cd "$OLD_DIR"
+rm -rf "$TMP_DIR"
+
+echo Finished.
+exit 0



More information about the grass-commit mailing list