[GRASS-SVN] r71130 - grass-addons/grass7/raster/r.mblend

svn_grass at osgeo.org svn_grass at osgeo.org
Wed May 24 06:04:20 PDT 2017


Author: Lads
Date: 2017-05-24 06:04:20 -0700 (Wed, 24 May 2017)
New Revision: 71130

Added:
   grass-addons/grass7/raster/r.mblend/blended.png
   grass-addons/grass7/raster/r.mblend/both_inputs.png
   grass-addons/grass7/raster/r.mblend/edges.png
Removed:
   grass-addons/grass7/raster/r.mblend/figures/
Modified:
   grass-addons/grass7/raster/r.mblend/r.mblend.html
   grass-addons/grass7/raster/r.mblend/r.mblend.py
Log:
Fixed issues with PEP8 compliance and the HTML file.

Added: grass-addons/grass7/raster/r.mblend/blended.png
===================================================================
(Binary files differ)


Property changes on: grass-addons/grass7/raster/r.mblend/blended.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: grass-addons/grass7/raster/r.mblend/both_inputs.png
===================================================================
(Binary files differ)


Property changes on: grass-addons/grass7/raster/r.mblend/both_inputs.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: grass-addons/grass7/raster/r.mblend/edges.png
===================================================================
(Binary files differ)


Property changes on: grass-addons/grass7/raster/r.mblend/edges.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Modified: grass-addons/grass7/raster/r.mblend/r.mblend.html
===================================================================
--- grass-addons/grass7/raster/r.mblend/r.mblend.html	2017-05-24 12:14:44 UTC (rev 71129)
+++ grass-addons/grass7/raster/r.mblend/r.mblend.html	2017-05-24 13:04:20 UTC (rev 71130)
@@ -1,23 +1,21 @@
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-
 <h2>DESCRIPTION</h2>
 
-This module implements Mblend, a DEM merging method proposed by Leitão <i>et al.</i> (2016). It deals with cases where a study area is only partially covered by a high resolution DEM, with a coarser DEM available for the remainder (as in the case shown below). <i>r.mblend</i> merges the two DEMs, producing a smooth transition from the high resolution DEM to the low resolution DEM.<br><br>
+This module implements Mblend, a DEM merging method proposed by Leitão <i>et al.</i> (2016). It deals with cases where a study area is only partially covered by a high resolution DEM, with a coarser DEM available for the remainder (as in the case shown below). <i>r.mblend</i> merges the two DEMs, producing a smooth transition from the high resolution DEM to the low resolution DEM.<br><br>
 
 <center>
-<img width=40% align=center src=figures/both_inputs.png><br><br>
+<img width=40% align=center src=both_inputs.png><br><br>
 </center>
 
 The module works by identifying the edge between the two rasters (near edge, shown in read below) and the edge composed by the cells in the low resolution DEM farther away from the high resolution raster (far edge, shown in blue below). To each point along the near edge is assigned the difference between the two DEMs. To each point in the far edge is assigned the value 0. The Inverse Distance Weighted (IDW) method is then used to interpolate a new raster with the points along the two edges. This differences raster thus trends from the full difference at the near edge towards zero at the far edge. <br><br>
 
 <center>
-<img width=40% align=center src=figures/edges.png><br><br>
+<img width=40% align=center src=edges.png><br><br>
 </center>
 
 The differences raster is finally added to the low resolution DEM given as input. In the resulting DEM, cells along the near edge take the values in the high resolution raster. The farther away from the near edge (and closer to to the far edge) the closer is their value is to the low resolution raster, producing a smooth transition, without artefacts.<br><br>
 
 <center>
-<img width=40% src=figures/blended.png>
+<img width=40% src=blended.png>
 </center>  
 
 <h2>EXAMPLES</h2>
@@ -36,7 +34,7 @@
 
 <h2>REFERENCES</h2>
 
-J.P. Leitão, D. Prodanović, Č. Maksimović, <a href=http://www.sciencedirect.com/science/article/pii/S0098300416300012>Improving merge methods for grid-based digital elevation models</a>, <i>Computers & Geosciences</i>, Volume 88, March 2016, Pages 115-131, ISSN 0098-3004, <a href=http://doi.org/10.1016/j.cageo.2016.01.001>http://doi.org/10.1016/j.cageo.2016.01.001</a>.
+J.P. Leitão, D. Prodanovic, c. Maksimovic, <a href=http://www.sciencedirect.com/science/article/pii/S0098300416300012>Improving merge methods for grid-based digital elevation models</a>, <i>Computers & Geosciences</i>, Volume 88, March 2016, Pages 115-131, ISSN 0098-3004, <a href=http://doi.org/10.1016/j.cageo.2016.01.001>http://doi.org/10.1016/j.cageo.2016.01.001</a>.
 
 
 <h2>SEE ALSO</h2>
@@ -45,5 +43,5 @@
 
 <h2>AUTHORS</h2>
 
-Luís Moreira de Sousa
+Luís Moreira de Sousa<br>
 EAWAG: Swiss Federal Institute of Aquatic Science and Technology.

Modified: grass-addons/grass7/raster/r.mblend/r.mblend.py
===================================================================
--- grass-addons/grass7/raster/r.mblend/r.mblend.py	2017-05-24 12:14:44 UTC (rev 71129)
+++ grass-addons/grass7/raster/r.mblend/r.mblend.py	2017-05-24 13:04:20 UTC (rev 71130)
@@ -16,41 +16,38 @@
 #
 #############################################################################
 
-# %module
-# % description: Blends two rasters of different spatial resolution
-# % keyword: raster
-# % keyword: resolution
-# %end
-# %option HIGH
-# % key: high
-# %end
-# %option LOW
-# % key: low
-# %end
-# %option OUTPUT
-# % key: output
-# %end
-# %option FAR_EDGE
-# % key: far_edge
-# % key_desc: value
-# % type: double
-# % description: Percentage of distance to high resolution raster used to
-# %              determine far edge. Number between 0 and 100; 95% by default.
-# % answer: 95
-# % multiple: no
-# % required: no
-# %end
-# %option INTER_POINTS
-# % key: inter_points
-# % key_desc: value
-# % type: integer
-# % description: Number of points to use in interpolation. A higher number
-# %              produces a smoother result but requires a lengthier
-# %              computation. 50 by default.
-# % answer: 50
-# % multiple: no
-# % required: no
-# %end
+#%module
+#% description: Blends two rasters of different spatial resolution
+#% keyword: raster
+#% keyword: resolution
+#%end
+#%option HIGH
+#% key: high
+#%end
+#%option LOW
+#% key: low
+#%end
+#%option OUTPUT
+#% key: output
+#%end
+#%option FAR_EDGE
+#% key: far_edge
+#% key_desc: value
+#% type: double
+#% description: Percentage of distance to high resolution raster used to determine far edge. Number between 0 and 100; 95% by default.
+#% answer: 95
+#% multiple: no
+#% required: no
+#%end
+#%option INTER_POINTS
+#% key: inter_points
+#% key_desc: value
+#% type: integer
+#% description: Number of points to use in interpolation. A higher number produces a smoother result but requires a lengthier computation. 50 by default.
+#% answer: 50
+#% multiple: no
+#% required: no
+#%end
 
 import os
 import atexit
@@ -121,7 +118,7 @@
 
     # Make cell size compatible
     low_res_inter = getTemporaryIdentifier()
-    gscript.message(_("[r.mblend] Resampling low resolution raster to higher",
+    gscript.message(_("[r.mblend] Resampling low resolution raster to higher" +
                       " resolution"))
     gscript.run_command('r.resamp.interp', input=low, output=low_res_inter,
                         method='nearest')
@@ -150,7 +147,7 @@
     diff = getTemporaryIdentifier()
     diff_points = getTemporaryIdentifier()
     gscript.mapcalc(diff + ' = ' + high + ' - ' + low_res_inter)
-    gscript.message(_("[r.mblend] Vectorising differences between input",
+    gscript.message(_("[r.mblend] Vectorising differences between input" +
                       " rasters"))
     gscript.run_command('r.to.vect', input=diff, output=diff_points,
                         type='point')



More information about the grass-commit mailing list