[GRASS-SVN] r71982 - grass-addons/grass7/raster/r.clip

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Dec 27 06:42:06 PST 2017


Author: wenzeslaus
Date: 2017-12-27 06:42:05 -0800 (Wed, 27 Dec 2017)
New Revision: 71982

Modified:
   grass-addons/grass7/raster/r.clip/r.clip.html
   grass-addons/grass7/raster/r.clip/r.clip.py
Log:
r.clip: align applies res automatically

No r.info call needed. Thanks to mmetz:
https://lists.osgeo.org/pipermail/grass-user/2017-December/077425.html

Doc says:
Set the current resolution equal to that of the named raster map, and align...

Also improves doc (g.copy sometimes confused, better wording).


Modified: grass-addons/grass7/raster/r.clip/r.clip.html
===================================================================
--- grass-addons/grass7/raster/r.clip/r.clip.html	2017-12-27 12:56:12 UTC (rev 71981)
+++ grass-addons/grass7/raster/r.clip/r.clip.html	2017-12-27 14:42:05 UTC (rev 71982)
@@ -54,7 +54,6 @@
 <em><a href="g.region.html">g.region</a></em> and then use
 <em>r.clip</em> with the <b>-r</b> flag.
 
-
 </ul>
 
 <h2>EXAMPLES</h2>
@@ -132,9 +131,9 @@
 r.info map=clipped_elevation -g
 </pre></div>
 
-In the output, we can see that the extent is the same as the
-computational region in this case while the resolution and number of
-cells is different:
+In the output, we can see that the extent is the same
+(exactly the same in this case) as the computational region
+while the resolution and number of cells is different:
 
 <pre>
 ...
@@ -180,12 +179,16 @@
 
 <h2>SEE ALSO</h2>
 
+<em>
 <a href="g.region.html">g.region</a>,
+<a href="g.copy.html">g.copy</a>,
 <a href="r.mask.html">r.mask</a>,
 <a href="r.patch.html">r.patch</a>,
+<a href="r.proj.html">r.proj</a>,
 <a href="r.mapcalc.html">r.mapcalc</a>,
 <a href="r.resample.html">r.resample</a>,
 <a href="r.resamp.rst.html">r.resamp.rst</a>
+</em>
 
 <h2>AUTHOR</h2>
 

Modified: grass-addons/grass7/raster/r.clip/r.clip.py
===================================================================
--- grass-addons/grass7/raster/r.clip/r.clip.py	2017-12-27 12:56:12 UTC (rev 71981)
+++ grass-addons/grass7/raster/r.clip/r.clip.py	2017-12-27 14:42:05 UTC (rev 71982)
@@ -35,11 +35,9 @@
 
     # set region res and grid to match raster to avoid resampling
     if not flags['r']:
-        info = gs.raster_info(original)
         gs.use_temp_region()
         atexit.register(gs.del_temp_region)
-        gs.run_command('g.region', align=original,
-                       ewres=info['ewres'], nsres=info['nsres'])
+        gs.run_command('g.region', align=original)
 
     gs.mapcalc("$clipped = $original", clipped=clipped, original=original)
 



More information about the grass-commit mailing list