浏览代码

d.shade and r.shade: replace 'reliefmap' by more general 'shade' and 'drapemap' by more straight forward 'color'

 * this also follows the practice of not putting map when it is not necessary and not merging the words together
 * the change in GUI makes it work as before (probably also for d.his and r.his) but a strange or wrong behavior remains when the guessing of layer name fails (in case of other commands)
 * not changing variables in code, these might be changed during some refactoring
 * not changing descriptions and manual and leaving 'drapping', examples are already there and no better idea for description now
 * not adding to renamed_options because also the modules were renamed and there is not mechanism for this, so changes in users' code is necessary anyway


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@63741 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 10 年之前
父节点
当前提交
35ea4b194c

+ 4 - 3
gui/wxpython/core/utils.py

@@ -123,11 +123,12 @@ def GetLayerNameFromCmd(dcmd, fullyQualified = False, param = None,
             if p == param:
             if p == param:
                 params = [(idx, p, v)]
                 params = [(idx, p, v)]
                 break
                 break
-            
+
+            # this does not use types, just some (incomplete subset of?) names
             if p in ('map', 'input', 'layer',
             if p in ('map', 'input', 'layer',
                      'red', 'blue', 'green',
                      'red', 'blue', 'green',
-                     'h_map', 's_map', 'i_map',
-                     'reliefmap', 'labels'):
+                     'hue', 'saturation', 'intensity',
+                     'shade', 'labels'):
                 params.append((idx, p, v))
                 params.append((idx, p, v))
 
 
         if len(params) < 1:
         if len(params) < 1:

+ 1 - 1
raster/r.relief/r.relief.html

@@ -65,7 +65,7 @@ r.relief input=elevation output=elevation_shade
 
 
 Color can be added later using <em><a href="r.shade.html">r.shade</a></em>:
 Color can be added later using <em><a href="r.shade.html">r.shade</a></em>:
 <div class="code"><pre>
 <div class="code"><pre>
-r.shade reliefmap=elevation_shade drapemap=elevation output=elevation_shaded
+r.shade shade=elevation_shade color=elevation output=elevation_shaded
 </pre></div>
 </pre></div>
 
 
 <p>In Latitude-Longitude locations (or other non-metric locations), the
 <p>In Latitude-Longitude locations (or other non-metric locations), the

+ 1 - 1
raster/r.surf.fractal/r.surf.fractal.html

@@ -27,7 +27,7 @@ r.colors map=fractals color=byr
 r.relief input=fractals output=fractals_shade
 r.relief input=fractals output=fractals_shade
 
 
 d.mon wx0
 d.mon wx0
-d.shade relief=fractals_shade drape=fractals b=50
+d.shade shade=fractals_shade color=fractals b=50
 </pre></div>
 </pre></div>
 
 
 <center>
 <center>

+ 1 - 1
raster/r.texture/r.texture.html

@@ -112,7 +112,7 @@ r.mapcalc "ortho_2001_t792_1m.greylevel = ortho_2001_t792_1m"
 r.texture ortho_2001_t792_1m.greylevel prefix=ortho_texture method=asm -s 
 r.texture ortho_2001_t792_1m.greylevel prefix=ortho_texture method=asm -s 
 # display
 # display
 g.region n=221461 s=221094 w=638279 e=638694
 g.region n=221461 s=221094 w=638279 e=638694
-d.shade drape=ortho_texture_ASM_0 rel=ortho_2001_t792_1m
+d.shade color=ortho_texture_ASM_0 shade=ortho_2001_t792_1m
 </pre></div>
 </pre></div>
 
 
 This calculates four maps (requested texture at four orientations):
 This calculates four maps (requested texture at four orientations):

+ 1 - 1
raster/r.watershed/front/r.watershed.html

@@ -450,7 +450,7 @@ cut-off value. This only works with SFD, not with MFD.
 Display output in a nice way
 Display output in a nice way
 <div class="code"><pre>
 <div class="code"><pre>
   r.relief map=elevation.dem
   r.relief map=elevation.dem
-  d.shade rel=elevation.dem.shade drape=rwater.basin bright=40
+  d.shade shade=elevation.dem.shade color=rwater.basin bright=40
   d.vect rwater_course color=orange
   d.vect rwater_course color=orange
 </pre></div>
 </pre></div>
 
 

+ 2 - 2
scripts/d.shade/d.shade.html

@@ -32,7 +32,7 @@ dataset location is used to hillshade the <tt>elevation</tt> map:
 <div class="code"><pre>
 <div class="code"><pre>
 g.region raster=aspect -p
 g.region raster=aspect -p
 d.mon wx0
 d.mon wx0
-d.shade reliefmap=aspect drapemap=elevation
+d.shade shade=aspect color=elevation
 </pre></div>
 </pre></div>
 
 
 <!--
 <!--
@@ -62,7 +62,7 @@ g.region raster=elevation
 r.relief input=elevation output=elevation_shaded_relief
 r.relief input=elevation output=elevation_shaded_relief
 
 
 d.mon wx1
 d.mon wx1
-d.shade reliefmap=elevation_shaded_relief drapemap=elevation
+d.shade shade=elevation_shaded_relief color=elevation
 </pre></div>
 </pre></div>
 
 
 Interesting visualizations can be created using different color tables for
 Interesting visualizations can be created using different color tables for

+ 4 - 4
scripts/d.shade/d.shade.py

@@ -23,11 +23,11 @@
 #% keywords: visualization
 #% keywords: visualization
 #%end
 #%end
 #%option G_OPT_R_INPUT
 #%option G_OPT_R_INPUT
-#% key: reliefmap
+#% key: shade
 #% description: Name of shaded relief or aspect raster map
 #% description: Name of shaded relief or aspect raster map
 #%end
 #%end
 #%option G_OPT_R_INPUT
 #%option G_OPT_R_INPUT
-#% key: drapemap
+#% key: color
 #% label: Name of raster to drape over relief raster map
 #% label: Name of raster to drape over relief raster map
 #% description: Typically, this raster is elevation or other colorful raster
 #% description: Typically, this raster is elevation or other colorful raster
 #%end
 #%end
@@ -47,8 +47,8 @@ from grass.exceptions import CalledModuleError
 def main():
 def main():
     options, unused = gcore.parser()
     options, unused = gcore.parser()
 
 
-    drape_map = options['drapemap']
-    relief_map = options['reliefmap']
+    drape_map = options['color']
+    relief_map = options['shade']
     brighten = options['brighten']
     brighten = options['brighten']
 
 
     try:
     try:

+ 4 - 4
scripts/r.shade/r.shade.html

@@ -19,8 +19,8 @@ The input for this module can be created for example using
 <p>
 <p>
 NULL values are propagated by default, so if any of the two input rasters
 NULL values are propagated by default, so if any of the two input rasters
 contains NULL cell NULL will be also in the output. If <b>-c</b> flag is
 contains NULL cell NULL will be also in the output. If <b>-c</b> flag is
-used and cell in <b>drapemap</b> raster is NULL, just <b>reliefmap</b>
-color is used. If cell in <b>reliefmap</b> raster is NULL, shading effect
+used and cell in <b>color</b> raster is NULL, just <b>shade</b>
+color is used. If cell in <b>shade</b> raster is NULL, shading effect
 is not applied and original colors are used. If <b>bgcolor</b> option is
 is not applied and original colors are used. If <b>bgcolor</b> option is
 used, NULL value in any input raster will be in the output replaced
 used, NULL value in any input raster will be in the output replaced
 by the given color.
 by the given color.
@@ -46,7 +46,7 @@ dataset location is used to hillshade the <tt>elevation</tt> map:
 
 
 <div class="code"><pre>
 <div class="code"><pre>
 g.region raster=aspect -p
 g.region raster=aspect -p
-r.shade reliefmap=aspect drapemap=elevation output=elevation_aspect_shaded
+r.shade shade=aspect color=elevation output=elevation_aspect_shaded
 
 
 d.mon wx0
 d.mon wx0
 d.rast elevation_aspect_shaded
 d.rast elevation_aspect_shaded
@@ -60,7 +60,7 @@ raster map for later use:
 g.region raster=elevation
 g.region raster=elevation
 r.relief input=elevation output=elevation_shaded_relief
 r.relief input=elevation output=elevation_shaded_relief
 
 
-r.shade reliefmap=elevation_shaded_relief drapemap=elevation \
+r.shade shade=elevation_shaded_relief color=elevation \
     output=elevation_relief_shaded
     output=elevation_relief_shaded
 
 
 d.mon wx1
 d.mon wx1

+ 4 - 4
scripts/r.shade/r.shade.py

@@ -24,11 +24,11 @@
 #% keywords: visualization
 #% keywords: visualization
 #%end
 #%end
 #%option G_OPT_R_INPUT
 #%option G_OPT_R_INPUT
-#% key: reliefmap
+#% key: shade
 #% description: Name of shaded relief or aspect raster map
 #% description: Name of shaded relief or aspect raster map
 #%end
 #%end
 #%option G_OPT_R_INPUT
 #%option G_OPT_R_INPUT
-#% key: drapemap
+#% key: color
 #% label: Name of raster to drape over relief raster map
 #% label: Name of raster to drape over relief raster map
 #% description: Typically, this raster is elevation or other colorful raster
 #% description: Typically, this raster is elevation or other colorful raster
 #%end
 #%end
@@ -77,8 +77,8 @@ def remove(maps):
 def main():
 def main():
     options, flags = gcore.parser()
     options, flags = gcore.parser()
 
 
-    drape_map = options['drapemap']
-    relief_map = options['reliefmap']
+    drape_map = options['color']
+    relief_map = options['shade']
     brighten = int(options['brighten'])
     brighten = int(options['brighten'])
     output_map = options['output']
     output_map = options['output']
     bgcolor = options['bgcolor']
     bgcolor = options['bgcolor']