[GRASS-SVN] r61022 - in grass-addons/grass6/raster: . r.intersect
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Jun 28 02:06:44 PDT 2014
Author: hamish
Date: 2014-06-28 02:06:44 -0700 (Sat, 28 Jun 2014)
New Revision: 61022
Added:
grass-addons/grass6/raster/r.intersect/
grass-addons/grass6/raster/r.intersect/Makefile
grass-addons/grass6/raster/r.intersect/description.html
grass-addons/grass6/raster/r.intersect/r.intersect
Log:
new module: Creates a vector line at the intersection of two raster maps.
Copied: grass-addons/grass6/raster/r.intersect/Makefile (from rev 60363, grass-addons/grass6/raster/r.out.mbtiles/Makefile)
===================================================================
--- grass-addons/grass6/raster/r.intersect/Makefile (rev 0)
+++ grass-addons/grass6/raster/r.intersect/Makefile 2014-06-28 09:06:44 UTC (rev 61022)
@@ -0,0 +1,7 @@
+MODULE_TOPDIR = ../..
+
+PGM = r.intersect
+
+include $(MODULE_TOPDIR)/include/Make/Script.make
+
+default: script
Copied: grass-addons/grass6/raster/r.intersect/description.html (from rev 60367, grass-addons/grass6/raster/r.out.mbtiles/description.html)
===================================================================
--- grass-addons/grass6/raster/r.intersect/description.html (rev 0)
+++ grass-addons/grass6/raster/r.intersect/description.html 2014-06-28 09:06:44 UTC (rev 61022)
@@ -0,0 +1,46 @@
+<h2>DESCRIPTION</h2>
+
+<em>r.intersect</em> creates a vector line at the intersection point of
+two raster maps.
+
+For example if a planar trend surface or dynamic flooding level raster
+map is available this module can create a "bathtub ring" vector line
+at the intersection of that map and a coincident elevation map.
+
+
+<h2>NOTES</h2>
+
+This module uses <em>r.contour</em> internally, which can use a lot of
+memory in very large regions.
+
+
+<!-- TODO
+<h2>EXAMPLE</h2>
+
+Create a trend plane and intersect it with an elevation map.
+
+<div class="code"><pre>
+g.region rast=elevation
+r.cog ... (addons)
+r.plane ...
+r.intersect map1=elevation map2=elevation.trend output=elev_intersection_line
+</pre></div>
+-->
+
+<h2>SEE ALSO</h2>
+
+<em>
+<a href="r.contour.html">r.contour</a>,
+<a href="r.mapcalc.html">r.mapcalc</a>
+</em>
+
+
+<h2>AUTHOR</h2>
+
+Hamish Bowman<br>
+<i>Department of Geology<br>
+University of Otago<br>
+Dunedin, New Zealand</i>
+
+<p>
+<i>Last changed: $Date$</i>
Added: grass-addons/grass6/raster/r.intersect/r.intersect
===================================================================
--- grass-addons/grass6/raster/r.intersect/r.intersect (rev 0)
+++ grass-addons/grass6/raster/r.intersect/r.intersect 2014-06-28 09:06:44 UTC (rev 61022)
@@ -0,0 +1,88 @@
+#!/bin/sh
+############################################################################
+#
+# MODULE: r.intersect
+# AUTHOR(S): M. Hamish Bowman, Dunedin, New Zealand
+# PURPOSE: Creates a vector line at the "bathtub ring" intersection of
+# two raster maps.
+# COPYRIGHT: (C) 2014 Hamish Bowman, and the GRASS Development Team
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+############################################################################
+
+#%Module
+#% description: Creates a vector line at the intersection of two raster maps.
+#% keywords: raster, intersection
+#%End
+#%Option
+#% key: map1
+#% type: string
+#% required: yes
+#% multiple: no
+#% description: Name of first input raster map
+#% gisprompt: old,cell,raster
+#%End
+#%Option
+#% key: map2
+#% type: string
+#% required: yes
+#% multiple: no
+#% description: Name of second input raster map
+#% gisprompt: old,cell,raster
+#%End
+#%Option
+#% key: output
+#% type: string
+#% required: yes
+#% multiple: no
+#% key_desc: name
+#% description: Name for output vector map
+#% gisprompt: new,vector,vector
+#%End
+
+
+if [ -z "$GISBASE" ] ; then
+ echo "You must be in GRASS GIS to run this program." 1>&2
+ exit 1
+fi
+
+if [ "$1" != "@ARGS_PARSED@" ] ; then
+ exec g.parser "$0" "$@"
+fi
+
+cleanup()
+{
+ #remove temporary map
+ g.remove rast="tmp.rinter_diff.$$" --quiet
+}
+
+# what to do in case of user break:
+exitprocedure()
+{
+ g.message -e message='User break!'
+ cleanup
+ exit 1
+}
+
+
+r.mapcalc "tmp.rinter_diff.$$ = \"$GIS_OPT_MAP2\" - \"$GIS_OPT_MAP1\""
+
+if [ $? -ne 0 ] ; then
+ g.message -e "Failed to calculate intersection. Aborting."
+ cleanup
+ exit 1
+fi
+
+
+r.contour input="tmp.rinter_diff.$$" output="$GIS_OPT_OUTPUT" levels=0
+
+cleanup
Property changes on: grass-addons/grass6/raster/r.intersect/r.intersect
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ text/x-sh
Added: svn:eol-style
+ native
More information about the grass-commit
mailing list