[GRASS-SVN] r58367 - grass/branches/develbranch_6/vector/v.vol.rst

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Dec 3 03:33:54 PST 2013


Author: neteler
Date: 2013-12-03 03:33:53 -0800 (Tue, 03 Dec 2013)
New Revision: 58367

Modified:
   grass/branches/develbranch_6/vector/v.vol.rst/description.html
Log:
v.vol.rst manual: example cosmetics

Modified: grass/branches/develbranch_6/vector/v.vol.rst/description.html
===================================================================
--- grass/branches/develbranch_6/vector/v.vol.rst/description.html	2013-12-03 11:29:43 UTC (rev 58366)
+++ grass/branches/develbranch_6/vector/v.vol.rst/description.html	2013-12-03 11:33:53 UTC (rev 58367)
@@ -64,18 +64,19 @@
 
 <h2>EXAMPLES</h2>
 
-<!-- TODO: find better data -->
-Spearfish example (we simulate 3D soil range data):
+<!-- TODO: find better data. This example is nonsensical :-) -->
+Spearfish example (we first simulate 3D soil range data):
 
 <div class="code"><pre>
 g.region -dp
 # define volume
-g.region res=50 tbres=50 b=0 t=1500 -ap3
+g.region res=100 tbres=100 res3=100 b=0 t=1500 -ap3
 
-# random elevation extraction (2D)
+### First part: generate synthetic 3D data (true 3D soil data preferred)
+# generate random positions from elevation map (2D)
 r.random elevation.10m vector_output=elevrand n=200
 
-# conversion to 3D
+# generate synthetic values
 v.db.addcol elevrand col="x double precision, y double precision"
 v.to.db elevrand option=coor col=x,y
 v.db.select elevrand
@@ -90,8 +91,9 @@
 v.db.dropcol elevrand_3d col=y
 v.db.dropcol elevrand_3d col=value
 
-# add attribute to interpolate
+# add attribute to have data available for 3D interpolation
 # (Soil range types taken from the USDA Soil Survey)
+d.mon x0
 d.rast soils.range
 d.vect elevrand_3d
 v.db.addcol elevrand_3d col="soilrange integer"
@@ -101,16 +103,21 @@
 v.db.update elevrand_3d col=soilrange value=NULL where="soilrange=0"
 v.db.select elevrand_3d
 
-# interpolate volume
-v.vol.rst elevrand_3d wcol=soilrange elev=soilrange zmult=100
+# optionally: check 3D points in Paraview
+v.out.vtk input=elevrand_3d output=elevrand_3d.vtk type=point dp=2
+paraview --data=elevrand_3d.vtk
 
-# visualize
+### Second part: 3D interpolation from 3D point data
+# interpolate volume to "soilrange" voxel map
+v.vol.rst input=elevrand_3d wcol=soilrange elev=soilrange zmult=100
+
+# visualize I: in GRASS GIS wxGUI
 nviz elevation.10m vol=soilrange
 
-# export to Paraview
-r.out.vtk elevation.10m out=elev.vtk
-r3.out.vtk elevrand_3d out=volume.vtk
-paraview
+# visualize II: export to Paraview
+r.mapcalc "bottom = 0.0"
+r3.out.vtk -s input=soilrange top=elevation.10m bottom=bottom dp=2 output=volume.vtk
+paraview --data=volume.vtk
 </pre></div>
 
 



More information about the grass-commit mailing list