[GRASS-SVN] r68326 - grass/trunk/raster/r.in.xyz

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Apr 29 00:44:40 PDT 2016


Author: neteler
Date: 2016-04-29 00:44:40 -0700 (Fri, 29 Apr 2016)
New Revision: 68326

Modified:
   grass/trunk/raster/r.in.xyz/r.in.xyz.html
Log:
r.in.xyz manual: improved example for x,y,z ASCII file import

Modified: grass/trunk/raster/r.in.xyz/r.in.xyz.html
===================================================================
--- grass/trunk/raster/r.in.xyz/r.in.xyz.html	2016-04-28 18:22:40 UTC (rev 68325)
+++ grass/trunk/raster/r.in.xyz/r.in.xyz.html	2016-04-29 07:44:40 UTC (rev 68326)
@@ -208,21 +208,35 @@
 
 Sometimes elevation data are delivered as x,y,z ASCII files instead of
 a raster matrix:
+
+<!-- NC: preparation for this example
+g.region raster=elevation res=15 -p 
+# 
+r.stats -1g elevation > elevation.xyz
+-->
+
 <div class="code"><pre>
+# Important: observe the raster spacing from the ASCII file:
 # ASCII file format (example):
 # 630007.5 228492.5 141.99614
 # 630022.5 228492.5 141.37904
 # 630037.5 228492.5 142.29822
 # 630052.5 228492.5 143.97987
 # ...
+# The point distance is 15m here.
 
 # detect extent, print result as g.region parameters
 r.in.xyz input=elevation.xyz separator=space -s output=dummy -g
 # ... n=228492.5 s=215007.5 e=644992.5 w=630007.5 b=55.578793 t=156.32986
 
-# set computational region
-g.region n=228492.5 s=215007.5 e=644992.5 w=630007.5 -p
+# set computational region, along with the actual raster resolution
+# which is defined by the ASCII file point spacing:
+g.region n=228492.5 s=215007.5 e=644992.5 w=630007.5 res=15 -p
 
+# enlarge computational region by half a raster cell (here 7.5m) to
+# store the points as cell centers:
+g.region n=n+7.5 s=s-7.5 w=w-7.5 e=e+7.5 -p
+
 # import XYZ ASCII file, with z values as raster cell values
 r.in.xyz input=elevation.xyz separator=space method=mean output=myelev
 



More information about the grass-commit mailing list