[GRASS-SVN] r68327 - grass/branches/releasebranch_7_0/raster/r.in.xyz

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Apr 29 00:45:23 PDT 2016


Author: neteler
Date: 2016-04-29 00:45:23 -0700 (Fri, 29 Apr 2016)
New Revision: 68327

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

Modified: grass/branches/releasebranch_7_0/raster/r.in.xyz/r.in.xyz.html
===================================================================
--- grass/branches/releasebranch_7_0/raster/r.in.xyz/r.in.xyz.html	2016-04-29 07:44:40 UTC (rev 68326)
+++ grass/branches/releasebranch_7_0/raster/r.in.xyz/r.in.xyz.html	2016-04-29 07:45:23 UTC (rev 68327)
@@ -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