.TH v.vol.rst 1grass "" "GRASS 6.4.4" "Grass User's Manual"
.SH NAME
\fI\fBv.vol.rst\fR\fR - Interpolates point data to a 3D raster map using regularized spline with tension (RST) algorithm.
.SH KEYWORDS
vector, interpolation
.SH SYNOPSIS
\fBv.vol.rst\fR
.br
\fBv.vol.rst help\fR
.br
\fBv.vol.rst\fR [\-\fBc\fR] \fBinput\fR=\fIstring\fR [\fBcellinp\fR=\fIstring\fR] [\fBwcolumn\fR=\fIstring\fR] [\fBtension\fR=\fIfloat\fR] [\fBsmooth\fR=\fIfloat\fR] [\fBscolumn\fR=\fIstring\fR] [\fBwhere\fR=\fIsql_query\fR] [\fBdevi\fR=\fIstring\fR] [\fBcvdev\fR=\fIstring\fR] [\fBmaskmap\fR=\fIstring\fR] [\fBsegmax\fR=\fIinteger\fR] [\fBnpmin\fR=\fIinteger\fR] [\fBnpmax\fR=\fIinteger\fR] [\fBdmin\fR=\fIfloat\fR] [\fBwmult\fR=\fIfloat\fR] [\fBzmult\fR=\fIfloat\fR] [\fBcellout\fR=\fIstring\fR] [\fBelev\fR=\fIstring\fR] [\fBgradient\fR=\fIstring\fR] [\fBaspect1\fR=\fIstring\fR] [\fBaspect2\fR=\fIstring\fR] [\fBncurv\fR=\fIstring\fR] [\fBgcurv\fR=\fIstring\fR] [\fBmcurv\fR=\fIstring\fR] [\-\-\fBoverwrite\fR] [\-\-\fBverbose\fR] [\-\-\fBquiet\fR]
.SS Flags:
.IP "\fB\-c\fR" 4m
.br
Perform a cross-validation procedure without volume interpolation
.IP "\fB\-\-overwrite\fR" 4m
.br
Allow output files to overwrite existing files
.IP "\fB\-\-verbose\fR" 4m
.br
Verbose module output
.IP "\fB\-\-quiet\fR" 4m
.br
Quiet module output
.PP
.SS Parameters:
.IP "\fBinput\fR=\fIstring\fR" 4m
.br
Name of the vector map with input x,y,z,w
.IP "\fBcellinp\fR=\fIstring\fR" 4m
.br
Name of the surface raster map for cross-section
.IP "\fBwcolumn\fR=\fIstring\fR" 4m
.br
Name of the column containing w attribute to interpolate
.br
Default: \fIflt1\fR
.IP "\fBtension\fR=\fIfloat\fR" 4m
.br
Tension parameter
.br
Default: \fI40.\fR
.IP "\fBsmooth\fR=\fIfloat\fR" 4m
.br
Smoothing parameter
.br
Default: \fI0.1\fR
.IP "\fBscolumn\fR=\fIstring\fR" 4m
.br
Name of the column with smoothing parameters
.IP "\fBwhere\fR=\fIsql_query\fR" 4m
.br
WHERE conditions of SQL statement without 'where' keyword
.br
Example: income = 10000
.IP "\fBdevi\fR=\fIstring\fR" 4m
.br
Output deviations vector point file
.IP "\fBcvdev\fR=\fIstring\fR" 4m
.br
Output cross-validation vector map
.IP "\fBmaskmap\fR=\fIstring\fR" 4m
.br
Name of the raster map used as mask
.IP "\fBsegmax\fR=\fIinteger\fR" 4m
.br
Maximum number of points in a segment
.br
Default: \fI50\fR
.IP "\fBnpmin\fR=\fIinteger\fR" 4m
.br
Minimum number of points for approximation in a segment (>segmax)
.br
Default: \fI200\fR
.IP "\fBnpmax\fR=\fIinteger\fR" 4m
.br
Maximum number of points for approximation in a segment (>npmin)
.br
Default: \fI700\fR
.IP "\fBdmin\fR=\fIfloat\fR" 4m
.br
Minimum distance between points (to remove almost identical points)
.br
Default: \fI0.500000\fR
.IP "\fBwmult\fR=\fIfloat\fR" 4m
.br
Conversion factor for w-values used for interpolation
.br
Default: \fI1.0\fR
.IP "\fBzmult\fR=\fIfloat\fR" 4m
.br
Conversion factor for z-values
.br
Default: \fI1.0\fR
.IP "\fBcellout\fR=\fIstring\fR" 4m
.br
Output cross-section raster map
.IP "\fBelev\fR=\fIstring\fR" 4m
.br
Output elevation g3d-file
.IP "\fBgradient\fR=\fIstring\fR" 4m
.br
Output gradient magnitude g3d-file
.IP "\fBaspect1\fR=\fIstring\fR" 4m
.br
Output gradient horizontal angle g3d-file
.IP "\fBaspect2\fR=\fIstring\fR" 4m
.br
Output gradient vertical angle g3d-file
.IP "\fBncurv\fR=\fIstring\fR" 4m
.br
Output change of gradient g3d-file
.IP "\fBgcurv\fR=\fIstring\fR" 4m
.br
Output gaussian curvature g3d-file
.IP "\fBmcurv\fR=\fIstring\fR" 4m
.br
Output mean curvature g3d-file
.PP
.SH DESCRIPTION
.PP
\fIv.vol.rst\fR interpolates values to a 3-dimensional raster map from
3-dimensional point data (e.g. temperature, rainfall data from climatic
stations, concentrations from drill holes etc.) given in a 3-D vector
point file named \fBinput\fR. The size of the output
3d raster map \fBelev\fR is given by the current 3D region. Sometimes, the
user
may want to get a 2-D map showing a modelled phenomenon at a
crossection surface. In that case, \fBcellinp\fR and \fBcellout\fR
options must be specified, with the output 2D raster map \fBcellout\fR
containing the crossection of the interpolated volume with a surface
defined by \fBcellinp\fR
2D raster map. As an option, simultaneously with interpolation,
geometric parameters of the interpolated
phenomenon can be computed (magnitude of gradient, direction of
gradient defined by horizontal and vertical angles), change of gradient,
Gauss-Kronecker curvature, or mean curvature). These geometric
parameteres are saved as
3d raster maps \fBgradient, aspect1, aspect2, ncurv, gcurv, mcurv\fR,
respectively.
.PP
At first, data points are checked for identical positions and points
that are closer to each other than given \fBdmin\fR are removed.
Parameters \fBwmult\fR and \fBzmult\fR allow the user to re-scale
the w-values and z-coordinates of the point data (useful e.g. for
transformation of elevations given in feet to meters, so that the
proper values of gradient and curvatures can be computed).
Rescaling of z-coordinates (\fBzmult\fR) is also needed when the distances
in vertical direction are much smaller than the horizontal
distances; if that is the case, the value of \fBzmult\fR
should be selected so that the vertical and horizontal distances
have about the same magnitude.
.PP
Regularized spline with tension method is used in the interpolation.
The \fBtension\fR parameter controls the distance over which
each given point influences the resulting volume (with very high tension,
each point influences only its close neighborhood and the volume goes
rapidly to trend between the points).
Higher values of tension parameter reduce the overshoots that
can appear in volumes with rapid change of gradient. For noisy data, it
is possible to define a global smoothing parameter, \fBsmooth\fR.
With the
smoothing parameter set to zero (\fBsmooth=0\fR) the resulting volume
passes exactly through the data points.
When smoothing is used, it is possible to output a vector map \fBdevi\fR
containing deviations of the resulting volume from the given data.
.PP
The user can define a 2D raster map named \fBmaskmap\fR, which will
be used as a mask. The interpolation is skipped for 3-dimensional cells
whose 2-dimensional projection has a zero value in the mask. Zero values will
be assigned to these cells in all output 3d raster maps.
.PP
If the number of given points is greater than 700, segmented
processing is used. The region is split into 3-dimensional "box"
segments, each having less than \fBsegmax\fR points and interpolation
is performed on each segment of the region. To ensure the smooth
connection of segments, the interpolation function for each segment is
computed using the points in the given segment
and the points in its neighborhood. The minimum number of points taken
for interpolation is controlled by \fBnpmin\fR , the value of which
must
be larger than \fBsegmax\fR and less than 700. This limit of 700 was
selected to ensure the numerical stability and efficiency of the
algorithm.
.SH EXAMPLES
Spearfish example (we first simulate 3D soil range data):
\fC
.DS
.br
g.region \-dp
.br
# define volume
.br
g.region res=100 tbres=100 res3=100 b=0 t=1500 \-ap3
.br
.br
### First part: generate synthetic 3D data (true 3D soil data preferred)
.br
# generate random positions from elevation map (2D)
.br
r.random elevation.10m vector_output=elevrand n=200
.br
.br
# generate synthetic values
.br
v.db.addcol elevrand col="x double precision, y double precision"
.br
v.to.db elevrand option=coor col=x,y
.br
v.db.select elevrand
.br
.br
# create new 3D map
.br
v.in.db elevrand out=elevrand_3d x=x y=y z=value key=cat
.br
v.info \-c elevrand_3d
.br
v.info \-t elevrand_3d
.br
.br
# remove the now superfluous 'x', 'y' and 'value' (z) columns
.br
v.db.dropcol elevrand_3d col=x
.br
v.db.dropcol elevrand_3d col=y
.br
v.db.dropcol elevrand_3d col=value
.br
.br
# add attribute to have data available for 3D interpolation
.br
# (Soil range types taken from the USDA Soil Survey)
.br
d.mon x0
.br
d.rast soils.range
.br
d.vect elevrand_3d
.br
v.db.addcol elevrand_3d col="soilrange integer"
.br
v.what.rast elevrand_3d col=soilrange rast=soils.range
.br
.br
# fix 0 (no data in raster map) to NULL:
.br
v.db.update elevrand_3d col=soilrange value=NULL where="soilrange=0"
.br
v.db.select elevrand_3d
.br
.br
# optionally: check 3D points in Paraview
.br
v.out.vtk input=elevrand_3d output=elevrand_3d.vtk type=point dp=2
.br
paraview \-\-data=elevrand_3d.vtk
.br
.br
### Second part: 3D interpolation from 3D point data
.br
# interpolate volume to "soilrange" voxel map
.br
v.vol.rst input=elevrand_3d wcol=soilrange elev=soilrange zmult=100
.br
.br
# visualize I: in GRASS GIS wxGUI
.br
nviz elevation.10m vol=soilrange
.br
.br
# visualize II: export to Paraview
.br
r.mapcalc "bottom = 0.0"
.br
r3.out.vtk \-s input=soilrange top=elevation.10m bottom=bottom dp=2 output=volume.vtk
.br
paraview \-\-data=volume.vtk
.br
.DE
\fR
.SS SQL support
Using the \fBwhere\fR parameter, the interpolation can be limited to use
only a subset of the input vectors.
\fC
.DS
.br
# preparation as in above example
.br
v.vol.rst elevrand_3d wcol=soilrange elev=soilrange zmult=100 where="soilrange > 3"
.br
.DE
\fR
.SS Cross validation procedure
Sometimes it can be difficult to figure out the proper values of
interpolation parameters. In this case, the user can use a
crossvalidation procedure using \fB-c\fR flag (a.k.a. "jack-knife"
method) to find optimal parameters for given data. In this method,
every point in the input point file is temporarily excluded from the
computation and interpolation error for this point location is
computed. During this procedure no output grid files can be
simultanuously computed. The procedure for larger datasets may take a
very long time, so it might be worth to use just a sample data
representing the whole dataset.
.PP
\fIExample
(based on Slovakia3d dataset):\fR
.PP
\fC
.DS
.br
v.info \-c precip3d
.br
g.region n=5530000 s=5275000 w=4186000 e=4631000 res=500 \-p
.br
v.vol.rst \-c input=precip3d wcolumn=precip zmult=50 segmax=700 cvdev=cvdevmap tension=10
.br
v.db.select cvdevmap
.br
v.univar cvdevmap col=flt1 type=point
.br
.DE
\fR
Based on these results, the parameters will have to be optimized. It is
recommended to plot the CV error as curve while modifying
the parameters.
.PP
The best approach is to start with \fBtension\fR, \fBsmooth\fR
and \fBzmult\fR with rough steps, or to set \fBzmult\fR to a
constant somewhere between 30-60. This helps to find minimal RMSE
values while then finer steps can be used in all parameters. The
reasonable range is \fBtension\fR=10...100,
\fBsmooth\fR=0.1...1.0, \fBzmult\fR=10...100.
.PP
In \fIv.vol.rst\fR the tension parameter is much more sensitive to
changes than in \fIv.surf.rst\fR,
therefore the user should always check the
result by visual inspection. Minimizing CV does not always provide the best
result, especially when the density of data are insufficient. Then
the optimal result found by CV is an oversmoothed surface.
.SH NOTES
The vector points map must be a 3D vector map (x, y, z as geometry).
The module v.in.db can be used to generate
a 3D vector map from a table containing x,y,z columns.
Also, the input data should be in a projected coodinate system, such as
Univeral Transverse Mercator. The module does not appear to have support for
geographic (Lat/Long) coordinates as of May 2009.
.PP
\fIv.vol.rst\fR uses regularized spline with tension for
interpolation from point data (as described in Mitasova and Mitas,
1993). The implementation has an improved segmentation procedure based
on Oct-trees which enhances the efficiency for large data sets.
.PP
Geometric parameters - magnitude of gradient (\fBgradient\fR),
horizontal (\fBaspect1\fR) and vertical (\fBaspect2) \fRaspects,
change of gradient (\fBncurv\fR), Gauss-Kronecker (\fBgcurv\fR) and
mean curvatures (\fBmcurv\fR) are computed directly from the
interpolation function so that the important relationships between
these parameters are preserved. More information on these parameters
can be found in Mitasova et al., 1995 or Thorpe, 1979.
.PP
The program gives warning when significant overshoots appear and
higher tension should be used. However, with tension too high the
resulting volume will have local maximum in each given point
and everywhere else the volume goes rapidly to trend. With a smoothing
parameter greater than zero, the volume will not pass through the data
points and the higher the parameter the closer the volume will be to the
trend. For theory on smoothing with splines see Talmi and Gilat, 1977 or Wahba, 1990.
.PP
If a visible connection of segments appears, the program should be
rerun with higher \fBnpmin\fR to get more points from the
neighborhood of given segment.
.PP
If the number of points in a vector map is less than 400, \fBsegmax\fR
should be set to 400 so that segmentation is not performed when it is
not necessary.
.PP
The program gives a warning when the user wants to interpolate outside the
\(dqbox" given by minimum and maximum coordinates in the input vector map.
To remedy this, zoom into the area encompassing the input vector data points.
.PP
For large data sets (thousands of data points), it is suggested to
zoom into a smaller representative area and test whether the parameters
chosen (e.g. defaults) are appropriate.
.PP
The user must run \fIg.region\fR before the program to set the
3D region for interpolation.
.SH BUGS
\fBdevi\fR file is written as 2D and deviations are not written as attributes.
.SH REFERENCES
.PP
Hofierka J., Parajka J., Mitasova H., Mitas L., 2002, Multivariate
Interpolation of Precipitation Using Regularized Spline with Tension.
Transactions in
GIS 6, pp. 135-150.
.PP
Mitas, L.,
Mitasova, H., 1999, Spatial Interpolation. In: P.Longley, M.F.
Goodchild, D.J. Maguire, D.W.Rhind (Eds.), Geographical Information
Systems: Principles, Techniques, Management and Applications, Wiley,
pp.481-492
.PP
Mitas L., Brown W. M., Mitasova H., 1997, Role
of dynamic cartography in simulations of landscape processes based on
multi-variate fields. Computers and Geosciences, Vol. 23, No. 4,
pp. 437-446 (includes CDROM and WWW: www.elsevier.nl/locate/cgvis)
.PP
Mitasova H., Mitas L., Brown W.M., D.P. Gerdes, I.
Kosinovsky, Baker, T.1995, Modeling spatially and temporally
distributed phenomena:
New methods and tools for GRASS GIS. International Journal of GIS, 9
(4),
special issue on Integrating GIS and Environmental modeling, 433-446.
.PP
Mitasova, H., Mitas, L., Brown, B., Kosinovsky, I., Baker, T.,
Gerdes, D. (1994): Multidimensional
interpolation and visualization in GRASS GIS
.PP
Mitasova
H. and Mitas L. 1993: Interpolation by Regularized Spline with
Tension: I. Theory and Implementation, \fIMathematical Geology\fR 25,
641-655.
.PP
Mitasova
H. and Hofierka J. 1993: Interpolation by Regularized Spline with
Tension: II. Application to Terrain Modeling and Surface Geometry
Analysis, \fIMathematical Geology\fR 25, 657-667.
.PP
Mitasova, H., 1992 : New capabilities for interpolation and
topographic analysis in GRASS, GRASSclippings 6, No.2 (summer), p.13.
.PP
Wahba, G., 1990 : Spline Models for Observational Data, CNMS-NSF
Regional Conference series in applied mathematics, 59, SIAM,
Philadelphia, Pennsylvania.
.PP
Mitas, L., Mitasova H., 1988 : General variational approach to the
interpolation problem, Computers and Mathematics with Applications 16,
p. 983
.PP
Talmi, A. and Gilat, G., 1977 : Method for Smooth Approximation of
Data, Journal of Computational Physics, 23, p.93-123.
.PP
Thorpe, J. A. (1979): Elementary Topics in Differential Geometry.
Springer-Verlag, New York, pp. 6-94.
.SH SEE ALSO
\fI
g.region,
v.in.ascii,
r3.mask,
v.in.db,
v.surf.rst,
v.univar
\fR
.SH AUTHOR
Original version of program (in FORTRAN) and GRASS enhancements:
.br
Lubos Mitas, NCSA, University of Illinois at Urbana-Champaign,
Illinois, USA, since 2000 at Department of Physics,
North Carolina State University, Raleigh, USA
lubos_mitas@ncsu.edu
.br
Helena Mitasova, Department of Marine, Earth and Atmospheric Sciences,
North Carolina State University, Raleigh, USA,
hmitaso@unity.ncsu.edu
.PP
Modified program (translated to C, adapted for GRASS, new
segmentation procedure):
.br
Irina Kosinovsky, US Army CERL, Champaign, Illinois, USA
.br
Dave Gerdes, US Army CERL, Champaign, Illinois, USA
.PP
Modifications for g3d library, geometric parameters,
cross-validation, deviations:
.br
Jaro Hofierka, Department of Geography and Regional Development,
University of Presov, Presov, Slovakia,
hofierka@fhpv.unipo.sk,
http://www.geomodel.sk
.PP
\fILast changed: $Date: 2014-05-16 22:20:46 +0200 (Fri, 16 May 2014) $\fR
.PP
Full index
.PP
© 2003-2014 GRASS Development Team