[GRASS-SVN] r56295 - in grass-addons/grass7/raster: . r.hazard.flood

svn_grass at osgeo.org svn_grass at osgeo.org
Sat May 18 05:46:28 PDT 2013


Author: neteler
Date: 2013-05-18 05:46:27 -0700 (Sat, 18 May 2013)
New Revision: 56295

Added:
   grass-addons/grass7/raster/r.hazard.flood/
   grass-addons/grass7/raster/r.hazard.flood/r.hazard.flood.html
Removed:
   grass-addons/grass7/raster/r.hazard.flood/description.html
Modified:
   grass-addons/grass7/raster/r.hazard.flood/Makefile
   grass-addons/grass7/raster/r.hazard.flood/r.hazard.flood.py
Log:
r.hazard.flood: ported to GRASS 7

Modified: grass-addons/grass7/raster/r.hazard.flood/Makefile
===================================================================
--- grass-addons/grass6/raster/r.hazard.flood/Makefile	2013-05-18 11:18:59 UTC (rev 56294)
+++ grass-addons/grass7/raster/r.hazard.flood/Makefile	2013-05-18 12:46:27 UTC (rev 56295)
@@ -1,6 +1,6 @@
 MODULE_TOPDIR = ../..
 
-PGM = r.hazard.flood.py
+PGM = r.hazard.flood
 
 include $(MODULE_TOPDIR)/include/Make/Script.make
 

Deleted: grass-addons/grass7/raster/r.hazard.flood/description.html
===================================================================
--- grass-addons/grass6/raster/r.hazard.flood/description.html	2013-05-18 11:18:59 UTC (rev 56294)
+++ grass-addons/grass7/raster/r.hazard.flood/description.html	2013-05-18 12:46:27 UTC (rev 56295)
@@ -1,57 +0,0 @@
-<h2>DESCRIPTION</h2>
-<em>r.hazard.flood</em> Implementation of a fast procedure to detect flood prone areas
-
-<h2>NOTES</h2>
-<p>The availability of new technologies for the measurement of surface
-elevation has addressed the lack of high resolution elevation data, and
-this has led to an increase in the attraction of DEM-based automated
-procedures for hydrological applications including the delineation of
-floodplains. In particular, the exposure to flooding may be delineated
-quite well by adopting a modified topographic index (TIm) computed from
-a DEM. The comparison between TIm and flood inundation maps (obtained
-from hydraulic simulations) shows that the portion of a basin exposed to
-flood inundation is generally characterized by a TIm higher than a given
-threshold, tau. This allows the development of a simple procedure for
-the identification of flood prone areas that requires only two parameters
-for the calibration: the threshold tau and the exponent of TIm. Because
-the topographic index is sensitive to the spatial resolution of the digital
-elevation model, the threshold is automatically determinated from the cellsize.
-<p>
-The proposed procedure may help in the delineation of flood prone areas
-especially in basins with marked topography. The method is sensitive to the
-DEM resolution, but a cell size of ~100m is sufficient to reach good
-performances for the catchments investigated here. The procedure is also
-tested adopting DEMs from different sources, such as the shuttle radar 
-topography mission (SRTM) DEM, ASTER GDEM, and national elevation data.
-This experiment highlights the reliability with the SRTM DEM for the
-delineation of flood prone areas. A useful relationship between model parameters
-and the reference scale of the DEM was also obtained providing a strategy
-for the application of this method in different contexts. 
-<p>
-The use of the modified topographic index should not be considered as an
-alternative to standard hydrological-hydraulic simulations for flood mapping,
-but it may represent a useful and rapid tool for a preliminary delineation
-of flooding areas in ungauged basins and in areas where expensive and time
-consuming hydrological-hydraulic simulations are not affordable or economically
-convenient. 
-
-<h2>EXAMPLE</h2>
-
-<div class="code"><pre>
-r.hazard.flood.py map=elevation flood=flood mti=MTI
-</pre></div>
-
-<h3>Dependencies</h3>
-<em>
-<a href="r.area.html">r.area</a>,
-</em>
-
-<h2>REFERENCES</h2>
-<p><em>Manfreda S., Di Leo M., Sole A., Detection of Flood Prone Areas using Digital Elevation Models, Journal of Hydrologic Engineering, (10.1061/(ASCE)HE.1943-5584.0000367), 2011.</em>
-<p><em>Di Leo M., Manfreda S., Fiorentino M., An automated procedure for the detection of flood prone areas: r.hazard.flood, Geomatics Workbooks n.10, 2011. (<a href="http://geomatica.como.polimi.it/workbooks/n10/GW10-FOSS4Git_2011.pdf">PDF</a>) </em>
-
-<h2>AUTHOR</h2>
-<p>Margherita Di Leo (dileomargherita AT gmail DOT com)
-
-<p>
-<i>Last changed: $Date$</i>

Copied: grass-addons/grass7/raster/r.hazard.flood/r.hazard.flood.html (from rev 56294, grass-addons/grass6/raster/r.hazard.flood/description.html)
===================================================================
--- grass-addons/grass7/raster/r.hazard.flood/r.hazard.flood.html	                        (rev 0)
+++ grass-addons/grass7/raster/r.hazard.flood/r.hazard.flood.html	2013-05-18 12:46:27 UTC (rev 56295)
@@ -0,0 +1,58 @@
+<h2>DESCRIPTION</h2>
+<em>r.hazard.flood</em> Implementation of a fast procedure to detect flood prone areas
+
+<h2>NOTES</h2>
+<p>The availability of new technologies for the measurement of surface
+elevation has addressed the lack of high resolution elevation data, and
+this has led to an increase in the attraction of DEM-based automated
+procedures for hydrological applications including the delineation of
+floodplains. In particular, the exposure to flooding may be delineated
+quite well by adopting a modified topographic index (TIm) computed from
+a DEM. The comparison between TIm and flood inundation maps (obtained
+from hydraulic simulations) shows that the portion of a basin exposed to
+flood inundation is generally characterized by a TIm higher than a given
+threshold, tau. This allows the development of a simple procedure for
+the identification of flood prone areas that requires only two parameters
+for the calibration: the threshold tau and the exponent of TIm. Because
+the topographic index is sensitive to the spatial resolution of the digital
+elevation model, the threshold is automatically determinated from the cellsize.
+<p>
+The proposed procedure may help in the delineation of flood prone areas
+especially in basins with marked topography. The method is sensitive to the
+DEM resolution, but a cell size of ~100m is sufficient to reach good
+performances for the catchments investigated here. The procedure is also
+tested adopting DEMs from different sources, such as the shuttle radar 
+topography mission (SRTM) DEM, ASTER GDEM, and national elevation data.
+This experiment highlights the reliability with the SRTM DEM for the
+delineation of flood prone areas. A useful relationship between model parameters
+and the reference scale of the DEM was also obtained providing a strategy
+for the application of this method in different contexts. 
+<p>
+The use of the modified topographic index should not be considered as an
+alternative to standard hydrological-hydraulic simulations for flood mapping,
+but it may represent a useful and rapid tool for a preliminary delineation
+of flooding areas in ungauged basins and in areas where expensive and time
+consuming hydrological-hydraulic simulations are not affordable or economically
+convenient. 
+
+<h2>EXAMPLE</h2>
+
+<div class="code"><pre>
+g.region rast=elevation -p
+r.hazard.flood map=elevation flood=flood mti=mti
+</pre></div>
+
+<h3>Dependencies</h3>
+<em>
+<a href="r.area.html">r.area</a>,
+</em>
+
+<h2>REFERENCES</h2>
+<p><em>Manfreda S., Di Leo M., Sole A., Detection of Flood Prone Areas using Digital Elevation Models, Journal of Hydrologic Engineering, (10.1061/(ASCE)HE.1943-5584.0000367), 2011.</em>
+<p><em>Di Leo M., Manfreda S., Fiorentino M., An automated procedure for the detection of flood prone areas: r.hazard.flood, Geomatics Workbooks n.10, 2011. (<a href="http://geomatica.como.polimi.it/workbooks/n10/GW10-FOSS4Git_2011.pdf">PDF</a>) </em>
+
+<h2>AUTHOR</h2>
+<p>Margherita Di Leo (dileomargherita AT gmail DOT com)
+
+<p>
+<i>Last changed: $Date$</i>

Modified: grass-addons/grass7/raster/r.hazard.flood/r.hazard.flood.py
===================================================================
--- grass-addons/grass6/raster/r.hazard.flood/r.hazard.flood.py	2013-05-18 11:18:59 UTC (rev 56294)
+++ grass-addons/grass7/raster/r.hazard.flood/r.hazard.flood.py	2013-05-18 12:46:27 UTC (rev 56295)
@@ -13,6 +13,7 @@
 #              License (>=v2). Read the file COPYING that comes with GRASS
 #              for details.
 #
+# TODO: add overwrite check for resulting flood/mti maps
 #############################################################################
 
 #%module
@@ -59,6 +60,13 @@
     sys.exit(1)
 
 def main():
+
+    #### check for r.area
+    if not grass.find_program('r.area', ['help']):
+        grass.fatal(_("'r.area' program not found, install it first:") +
+                    "\n" +
+                    "g.extension r.area")
+
     r_elevation = options['map'].split('@')[0] 
     mapname = options['map'].replace("@"," ")
     mapname = mapname.split()
@@ -73,7 +81,7 @@
     grass.message("Cellsize : %s " % resolution) 
 
     # Flow accumulation map MFD
-    grass.run_command('r.watershed', elevation = r_elevation , accumulation = 'r_accumulation' , convergence = 5, flags = 'fa')
+    grass.run_command('r.watershed', elevation = r_elevation , accumulation = 'r_accumulation' , convergence = 5, flags = 'a')
     grass.message("Flow accumulation done. ")
 
     # Slope map
@@ -89,7 +97,7 @@
     grass.message("MTI threshold : %s " % mti_th) 
     
     # MTI map
-    grass.message("Calculating mti raster map.. ")
+    grass.message("Calculating MTI raster map.. ")
     grass.mapcalc("$r_mti = log((exp((($rast1+1)*$resolution) , $n)) / (tan($rast2+0.001)))", 
                    r_mti = r_mti, 
                    rast1 = 'r_accumulation', 
@@ -99,8 +107,8 @@
 
     # Cleaning up
     grass.message("Cleaning up.. ")
-    grass.run_command('g.remove', rast = 'r_accumulation')
-    grass.run_command('g.remove', rast = 'r_slope')
+    grass.run_command('g.remove', quiet = True, rast = 'r_accumulation')
+    grass.run_command('g.remove', quiet = True, rast = 'r_slope')
 
     # flood map
     grass.message("Calculating flood raster map.. ")



More information about the grass-commit mailing list