Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 413e0bdb3c48563b2d8d9038d07d5533 > files > 2267

grass-6.3.0-15.fc13.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>GRASS GIS: v.surf.rst</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="grassdocs.css" type="text/css">
</head>
<body bgcolor="white">

<img src="grass_logo.png" alt="GRASS logo"><hr align=center size=6 noshade>

<h2>NAME</h2>
<em><b>v.surf.rst</b></em>  - Spatial approximation and topographic analysis from given point or isoline data in vector format to floating point raster format using regularized spline with tension.
<h2>KEYWORDS</h2>
vector
<h2>SYNOPSIS</h2>
<b>v.surf.rst</b><br>
<b>v.surf.rst help</b><br>
<b>v.surf.rst</b> [-<b>ctd</b>] <b>input</b>=<em>name</em>  [<b>layer</b>=<em>integer</em>]   [<b>zcolumn</b>=<em>string</em>]   [<b>where</b>=<em>sql_query</em>]   [<b>elev</b>=<em>name</em>]   [<b>slope</b>=<em>name</em>]   [<b>aspect</b>=<em>name</em>]   [<b>pcurv</b>=<em>name</em>]   [<b>tcurv</b>=<em>name</em>]   [<b>mcurv</b>=<em>name</em>]   [<b>maskmap</b>=<em>name</em>]   [<b>tension</b>=<em>float</em>]   [<b>smooth</b>=<em>float</em>]   [<b>scolumn</b>=<em>string</em>]   [<b>segmax</b>=<em>integer</em>]   [<b>npmin</b>=<em>integer</em>]   [<b>dmin</b>=<em>float</em>]   [<b>dmax</b>=<em>float</em>]   [<b>zmult</b>=<em>float</em>]   [<b>devi</b>=<em>string</em>]   [<b>cvdev</b>=<em>name</em>]   [<b>treefile</b>=<em>name</em>]   [<b>overfile</b>=<em>name</em>]   [<b>theta</b>=<em>float</em>]   [<b>scalex</b>=<em>float</em>]   [--<b>overwrite</b>]  [--<b>verbose</b>]  [--<b>quiet</b>] 

<h3>Flags:</h3>
<DL>
<DT><b>-c</b></DT>
<DD>Perform cross-validation procedure without raster approximation</DD>

<DT><b>-t</b></DT>
<DD>Use scale dependent tension</DD>

<DT><b>-d</b></DT>
<DD>Output partial derivatives instead of topographic parameters</DD>

<DT><b>--overwrite</b></DT>
<DD>Allow output files to overwrite existing files</DD>
<DT><b>--verbose</b></DT>
<DD>Verbose module output</DD>
<DT><b>--quiet</b></DT>
<DD>Quiet module output</DD>
</DL>

<h3>Parameters:</h3>
<DL>
<DT><b>input</b>=<em>name</em></DT>
<DD>Name of input vector map</DD>

<DT><b>layer</b>=<em>integer</em></DT>
<DD>Layer number</DD>
<DD>Field value. If set to 0, z coordinates are used. (3D vector only)</DD>
<DD>Default: <em>1</em></DD>

<DT><b>zcolumn</b>=<em>string</em></DT>
<DD>Name of the attribute column with values to be used for approximation (if layer&gt;0)</DD>

<DT><b>where</b>=<em>sql_query</em></DT>
<DD>WHERE conditions of SQL statement without 'where' keyword</DD>
<DD>Example: income &lt; 1000 and inhab &gt;= 10000</DD>

<DT><b>elev</b>=<em>name</em></DT>
<DD>Output surface raster map (elevation)</DD>

<DT><b>slope</b>=<em>name</em></DT>
<DD>Output slope raster map</DD>

<DT><b>aspect</b>=<em>name</em></DT>
<DD>Output aspect raster map</DD>

<DT><b>pcurv</b>=<em>name</em></DT>
<DD>Output profile curvature raster map</DD>

<DT><b>tcurv</b>=<em>name</em></DT>
<DD>Output tangential curvature raster map</DD>

<DT><b>mcurv</b>=<em>name</em></DT>
<DD>Output mean curvature raster map</DD>

<DT><b>maskmap</b>=<em>name</em></DT>
<DD>Name of the raster map used as mask</DD>

<DT><b>tension</b>=<em>float</em></DT>
<DD>Tension parameter</DD>
<DD>Default: <em>40.</em></DD>

<DT><b>smooth</b>=<em>float</em></DT>
<DD>Smoothing parameter</DD>

<DT><b>scolumn</b>=<em>string</em></DT>
<DD>Name of the attribute column with smoothing parameters</DD>

<DT><b>segmax</b>=<em>integer</em></DT>
<DD>Maximum number of points in a segment</DD>
<DD>Default: <em>40</em></DD>

<DT><b>npmin</b>=<em>integer</em></DT>
<DD>Minimum number of points for approximation in a segment (&gt;segmax)</DD>
<DD>Default: <em>300</em></DD>

<DT><b>dmin</b>=<em>float</em></DT>
<DD>Minimum distance between points (to remove almost identical points)</DD>
<DD>Default: <em>0.500000</em></DD>

<DT><b>dmax</b>=<em>float</em></DT>
<DD>Maximum distance between points on isoline (to insert additional points)</DD>
<DD>Default: <em>2.500000</em></DD>

<DT><b>zmult</b>=<em>float</em></DT>
<DD>Conversion factor for values used for approximation</DD>
<DD>Default: <em>1.0</em></DD>

<DT><b>devi</b>=<em>string</em></DT>
<DD>Output deviations vector point file</DD>

<DT><b>cvdev</b>=<em>name</em></DT>
<DD>Output cross-validation errors vector point file</DD>

<DT><b>treefile</b>=<em>name</em></DT>
<DD>Output vector map showing quadtree segmentation</DD>

<DT><b>overfile</b>=<em>name</em></DT>
<DD>Output vector map showing overlapping windows</DD>

<DT><b>theta</b>=<em>float</em></DT>
<DD>Anisotropy angle (in degrees counterclockwise from East)</DD>

<DT><b>scalex</b>=<em>float</em></DT>
<DD>Anisotropy scaling factor</DD>

</DL>
<h2>DESCRIPTION</h2>

<em>v.surf.rst</em>
<br>This program performs spatial approximation based on z-values or attributes 
of point or isoline data given in a vector map named <em>input</em> to grid cells in the
output raster map <em>elev</em> representing a surface. As an option, simultaneously
with approximation, topographic parameters slope, aspect, profile curvature
(measured in the direction of the steepest slope), tangential curvature (measured
in the direction of a tangent to contour line) or mean curvature are computed
and saved as raster maps specified by the options <em>slope, aspect, pcurv,
tcurv, mcurv</em> respectively. If <b><em>-d</em></b> flag is set, the program
outputs partial derivatives f<sub>x</sub>,f<sub>y</sub>,f<sub>xx</sub>,
f<sub>yy</sub>,f<sub>xy</sub>
instead of slope, aspect, profile, tangential and mean curvatures respectively.
If the input data have time stamp, the program creates time stamp for all
output files.

<p>
User can define a raster map named <em>maskmap</em>, which will be used
as a mask. The approximation is skipped for cells which have zero or NULL
value in mask. NULL values will be assigned to these cells in all output
raster maps. Data points are checked for identical points and points that
are closer to each other than the given <em>dmin</em> are removed. 
If sparsely digitized contours or isolines are used as input, additional
points are computed between each 2 points on a line if the
distance between them is greater than specified <em>dmax</em>. Parameter
<em>zmult</em> allows user to rescale the values used for approximation
 (useful e.g. for transformation of
elevations given in feet to meters, so that the proper values of slopes
and curvatures can be computed).

<p>

Regularized spline with tension is used for the approximation. The
<em>tension</em>
parameter tunes the character of the resulting surface from thin plate
to membrane.
Smoothing parameter <em>smooth</em> controls the deviation between the given points
and the resulting surface and it can be very effective in smoothing
noisy data while preserving the geometrical properties of the surface.
With the smoothing parameter set to zero (<em>smooth=0</em>) 
the resulting surface passes exactly through the data points (spatial interpolation
is performed). When smoothing parameter
is used, it is also possible to output a vector point file <em>devi</em> containing deviations
of the resulting surface from the given data.

<p>

If the number of given points is greater than <em>segmax</em>, segmented
processing is used . The region is split into quadtree-based rectangular segments, each
having less than <em>segmax</em> points and approximation is performed on
each segment of the region. To ensure smooth connection of segments
the approximation function for each segment is computed using the points
in the given segment and the points in its neighborhood which are in the rectangular
window surrounding the given segment. The number of points taken for approximation
is controlled by <em>npmin</em>, the value of which must be larger than <em>segmax</em>. 
User can choose to output vector maps <em>treefile</em> and <em>overfile</em>
which represent the quad tree used for segmentation and overlapping neighborhoods
from which additional points for approximation on each segment were taken.

<P>

Predictive error of surface approximation for given parameters can be computed using the 
<b>-c</b> flag. A crossvalidation procedure is then performed using the data given in the vector map 
<em>input</em> and the estimated predictive errors are stored in the vector point file  
<em>cvdev</em>. When using this flag, no raster output files are computed.

Anisotropic surfaces can be interpolated by setting anisotropy angle <em>theta</em> 
and scaling factor <em>scalex</em>. 
The program writes values of selected input and internally computed parameters to 
the history file of raster map
<b><em>elev</em></b>.

<p>

<h2>NOTES</h2>

<em>v.surf.rst </em>uses regularized spline with tension for approximation
from vector data. The module does not require input data with topology, therefore
both level1 (no topology) and level2 (with topology) vector point data are supported.
Additional points are used for approximation between
each 2 points on a line if the distance between them is greater than specified
<em>dmax</em>. If <em>dmax</em> is small (less than cell size) the number of
added data points can be vary large and slow down approximation significantly.
The implementation has a segmentation procedure based on quadtrees which
enhances the efficiency for large data sets. Special color tables are created
by the program for output raster maps.
<p>Topographic parameters are computed directly from the approximation
function so that the important relationships between these parameters are
preserved. The equations for computation of these parameters and their
interpretation is described in
<a href="http://skagit.meas.ncsu.edu/~helena/gmslab/papers/hmg.rev1.ps">Mitasova and Hofierka, 1993</a>
or Neteler and Mitasova, 2004).
Slopes and aspect are computed in degrees (0-90 and 1-360 respectively).
The aspect raster map has value 0 assigned to flat areas (with slope less
than 0.1%) and to singular points with undefined aspect. Aspect points
downslope and is 90 to the North, 180 to the West, 270 to the South and
360 to the East, the values increase counterclockwise. Curvatures are positive
for convex and negative for concave areas. Singular points with undefined
curvatures have assigned zero values.
</p><p><em>Tension</em> and <em>smooth</em>ing allow user to tune the surface character.
For most landscape scale applications the default values should provide adequate results.
The program gives warning when significant overshoots appear in the resulting
surface and higher tension or smoothing should be used.

<!--
<br>While it is possible to automatize the selection of suitable <em>tension</em>
and <em>smooth</em>ing, it has not been done yet, so here are some hints
which may help to choose the proper parameters if the results look "weird".
-->
To select parameters that will produce a surface with desired properties,
it is useful to know that the method is scale dependent and the <em>tension</em>
works as a rescaling parameter (high <em>tension</em> "increases the distances
between the points" and reduces the range of impact of each point, low<em>
tension</em> "decreases the distance" and the points influence each other
over longer range). Surface with <em>tension</em> set too high behaves
like a membrane (rubber sheet stretched over the data points) with peak
or pit ("crater") in each given point and everywhere else the surface goes
rapidly to trend. If digitized contours are used as input data, high tension
can cause artificial waves along contours. Lower tension and higher smoothing
is suggested for such a case.

<br>Surface with <em>tension</em> set too low behaves like a stiff steel
plate and overshoots can appear in areas with rapid change of gradient
and segmentation can be visible. Increase in tension should solve the problems.
<br>There are two options how <em>tension</em> can be applied in relation
to <em>dnorm</em> (dnorm rescales the coordinates depending on the average
data density so that the size of segments with <em>segmax=</em>40 points
is around 1 - this ensures the numerical stability of the computation):
</p><p>1. Default: the given <em>tension</em>
is applied to normalized data (x/<em>dnorm</em>..), that means that
the distances are multiplied (rescaled) by <em>tension/dnorm</em>. If density
of points is changed, e.g., by using higher <em>dmin</em>, the <em>dnorm</em>

changes and <em>tension</em> needs to be changed too to get the same result.
Because the <em>tension</em> is applied to normalized data its suitable value
is usually within the 10-100 range and does not depend on the actual scale
(distances) of the original data (which can be km for regional applications
or cm for field experiments).
<br>2. Flag<b> -t </b>: </b>The given <em>tension</em>
is applied to un-normalized data (rescaled tension = t<em>ension*dnorm</em>/1000
is applied to normalized data (x/<em>dnorm</em>) and therefore <em>dnorm</em>

cancels out) so here <em>tension</em> truly works as a rescaling parameter.
For regional applications with distances between points in km. the suitable
tension can be 500 or higher, for detailed field scale analysis it can
be 0.1. To help select how much the data need to be rescaled the program
writes
<em>dnorm</em> and rescaled tension fi=<em>tension*dnorm</em>/1000 at the
beginning of the program run. This rescaled <em>tension</em> should be around
20-30. If it is lower or higher, the given <em>tension</em> parameter
should be changed accordingly.

</p><p>The default is a recommended choice, however for the applications where
the user needs to change density of data and preserve the approximation
character the <b>-t</b> flag can be helpful.</p>
<p>Anisotropic data (e.g. geologic phenomena) can be interpolated using <em>theta</em> 
and <em>scalex</em> defining orientation 
and ratio of the perpendicular axes put on the longest/shortest side of the feature, respectively.
<em>Theta</em> is measured in degrees from East, counterclockwise. <em>Scalex</em> is a ratio of axes sizes. 
Setting <em>scalex</em> in the range 0-1, results in a pattern prolonged in the
direction defined by <em>theta</em>. <em>Scalex</em> value 0.5 means that modeled feature is approximately
2 times longer in the direction of <em>theta</em> than in the perpendicular direction.
<em>Scalex</em> value 2 means that axes ratio is reverse resulting in a pattern 
perpendicular to the previous example. Please note that anisotropy
option has not been extensively tested and may include bugs (for example , topographic
parameters may not be computed correctly) - if there are
problems, please report to GRASS bugtracker 
(accessible from <a href="http://grass.itc.it/">http://grass.itc.it/</a>).<br>
</p>

<!--
<p>The program gives warning when significant overshoots appear and higher
tension should be used. However, with tension too high the resulting surface
changes its behavior to membrane (rubber sheet stretched over the data
points resulting in a peak or pit in each given point and everywhere else
the surface goes rapidly to trend). Also smoothing can be used to reduce
the overshoots.
-->

<p>For data with values changing over several magnitudes (sometimes the
concentration or density data) it is suggested to interpolate the log of
the values rather than the original ones.
</p>

<p>The program checks the numerical stability of the algorithm by computing
the values in given points, and prints the root mean square deviation (rms)
found into the history file of raster map <em>elev</em>. For computation
with smoothing set to 0. rms should be 0. Significant increase in <em>tension</em>
is suggested if the rms is unexpectedly high for this case. With smoothing
parameter greater than zero the surface will not pass exactly through the
data points and the higher the parameter the closer the surface will be
to the trend. The rms then represents a measure of smoothing effect on
data. More detailed analysis of smoothing effects can be performed using
the output deviations option.
</p>

<h3>SQL support</h3>

Using the <em>where</em> parameter, the interpolation can be limited to use
only a subset of the input vectors.

<P>
Spearfish example (we simulate randomly distributed elevation measures):

<div class="code"><pre>
g.region rast=elevation.10m -p
# random elevation extraction
r.random elevation.10m vector_output=elevrand n=200
v.info -c elevrand
v.db.select elevrand

# interpolation based on all points
v.surf.rst elevrand zcol=value elev=elev_full
r.colors elev_full rast=elevation.10m
d.rast elev_full
d.vect elevrand

# interpolation based on subset of points (only those over 1300m/asl)
v.surf.rst elevrand zcol=value elev=elev_partial where="value > 1300"
r.colors elev_partial rast=elevation.10m
d.rast elev_partial
d.vect elevrand where="value > 1300"
</pre></div>


<h3>Cross validation procedure</h3>

The "optimal" approximation parameters for given data can be found using 
a cross-validation (CV) procedure (<b>-c </b>flag). 
The CV procedure is based on removing one input data point at a time, 
performing the approximation for the location of the removed point using 
the remaining data points and calculating the difference between the actual and approximated
value for the removed data point. The procedure is repeated until every data point has been, 
in turn, removed. This form of CV is also known as the "leave-one-out" or "jack-knife" method 
(Hofierka et al., 2002; Hofierka, 2005). The differences (residuals) are then stored in 
the <em>cvdev</em> output vector map. Please note that during the CV procedure no other output 
files can be set, the approximation is performed only for locations defined by input data. 
To find "optimal parameters", the CV procedure must be iteratively performed for all reasonable 
combinations of the approximation parameters with small incremental steps (e.g. tension, smoothing) 
in order to find a combination with minimal statistical error (also called predictive error)
defined by root mean squared error (RMSE), mean absolute error (MAE) or other error characteristics. 
A script with loops for tested RST parameters can do the job, necessary statistics can be calculated 
using e.g. <a href="v.univar.html">v.univar</a>. It should be noted that crossvalidation is a time-consuming procedure, 
usually reasonable for up to several thousands of points. For larger data sets, CV should be applied 
to a representative subset of the data. The cross-validation procedure works well only for well-sampled 
phenomena and when minimizing the predictive error is the goal. 
The parameters found by minimizing the predictive (CV) error may not not be the best for
for poorly sampled phenomena (result could be strongly smoothed with lost details and fluctuations)
or when significant noise is present that needs to be smoothed out.
</p>

<p>The program writes the values of parameters used in computation into
the comment part of history file <em>elev</em> as well as the following values
which help to evaluate the results and choose the suitable parameters:
minimum and maximum z values in the data file (zmin_data, zmax_data) and
in the interpolated raster map (zmin_int, zmax_int), rescaling parameter
used for normalization (dnorm), which influences the tension.
</p><p>If visible connection of segments appears, the program should be rerun
with higher <em>npmin</em> to get more points from the neighborhood of given
segment and/or with higher tension.

</p><p>When the number of points in a vector map is not too large (less than
800), the user can skip segmentation by setting <em>segmax</em> to the number
of data points or <em>segmax=700</em>.
</p><p>The program gives warning when user wants to interpolate outside the
rectangle given by minimum and maximum coordinates in the vector map,
zoom into the area where the given data are is suggested in this case.
</p><p>When a mask is used, the program takes all points in the given region
for approximation, including those in the area which is masked out, to
ensure proper approximation along the border of the mask. It therefore
does not mask out the data points, if this is desirable, it must be done
outside <em>v.surf.rst</em>.
</p>

<p>For examples of applications see
<a href="http://skagit.meas.ncsu.edu/~helena/gmslab/">GRASS4 implementation</a> and
<a href="http://skagit.meas.ncsu.edu/~helena/">GRASS5 and GRASS6 implementation</a>
</p><p>The user must run <a href="g.region.html">g.region</a> before the program
to set the region and resolution for approximation.
</p>

<h2>
SEE ALSO</h2>
<a href="v.vol.rst.html">v.vol.rst</a>

<h2>
AUTHORS</h2>

<p><br><em>Original version of program (in FORTRAN) and GRASS enhancements</em>:
<br>Lubos Mitas, NCSA, University of Illinois at Urbana Champaign, Illinois,
USA (1990-2000); Department of Physics, North Carolina State University, Raleigh
<br>Helena Mitasova, USA CERL, Department of Geography, University of Illinois at
Urbana-Champaign, USA (1990-2001); MEAS, North Carolina State University, Raleigh 
</p><p><em>Modified program (translated to C, adapted for GRASS, new segmentation
procedure):</em>
<br>Irina Kosinovsky, US Army CERL, Dave Gerdes, US Army CERL
</p><p><em>Modifications for new sites format and timestamping:</em>
<br>Darrel McCauley, Purdue University, Bill Brown, US Army CERL
</p><p><em>Update for GRASS5.7, GRASS6 and addition of crossvalidation:</em>
Jaroslav Hofierka, University of Presov; Radim Blazek, ITC-irst
<br>
</p>
<h2> REFERENCES</h2>
<P>
<a href="http://skagit.meas.ncsu.edu/~helena/gmslab/papers/IEEEGRSL2005.pdf">
Mitasova, H., Mitas, L. and Harmon, R.S., 2005,</a> 
Simultaneous spline approximation and topographic analysis for
lidar elevation data in open source GIS, IEEE GRSL 2 (4), 375- 379.
<P>
Hofierka, J., 2005, Interpolation of Radioactivity Data Using Regularized Spline with Tension. Applied GIS, Vol. 1, No. 2, 
pp. 16-01 to 16-13. DOI: 10.2104/ag050016
</P>
<P>
<a href="http://skagit.meas.ncsu.edu/~helena/gmslab/papers/TGIS2002_Hofierka_et_al.pdf">
Hofierka J., Parajka J.,  Mitasova H., Mitas L., 2002,</a>
Multivariate Interpolation of Precipitation Using Regularized Spline with Tension.
Transactions in GIS 6(2), pp. 135-150.
</P>
<P>
H. Mitasova, L. Mitas, B.M. Brown, D.P. Gerdes, I. Kosinovsky, 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.
</P>
<p>
<a href="http://skagit.meas.ncsu.edu/~helena/gmslab/papers/MG-I-93.pdf">
Mitasova, H. and Mitas, L., 1993</a>: 
Interpolation by Regularized Spline with Tension: 
I. Theory and Implementation, Mathematical Geology ,25, 641-655.
</p>
<p>
<a href="http://skagit.meas.ncsu.edu/~helena/gmslab/papers/MG-II-93.pdf">
Mitasova, H. and Hofierka, J., 1993</a>: Interpolation
by Regularized Spline with Tension: II. Application to Terrain Modeling
and Surface Geometry Analysis, Mathematical Geology 25, 657-667.
</p>
<p>
<a href="http://skagit.meas.ncsu.edu/~helena/gmslab/papers/CMA1988.pdf">
Mitas, L., and Mitasova H., 1988, </a> General variational approach to the approximation
problem, Computers and Mathematics with Applications, v.16, p. 983-992.
</p>

<p>
<a href="http://mpa.itc.it/grasstutor/">
Neteler, M. and Mitasova, H., 2004, Open Source GIS: A GRASS GIS Approach, Second Edition, </a> 
Kluwer International Series in Engineering and Computer Science, 773, Kluwer Academic Press / Springer, 
Boston, Dordrecht, 424 pages.
</p>

<p>Talmi, A. and Gilat, G., 1977 : Method for Smooth Approximation of Data,
Journal of Computational Physics, 23, p.93-123.
</p>
<p>Wahba, G., 1990, : Spline Models for Observational Data, CNMS-NSF Regional
Conference series in applied mathematics, 59, SIAM, Philadelphia, Pennsylvania.

<p><i>Last changed: $Date: 2007-06-01 11:22:22 +0200 (Fri, 01 Jun 2007) $</i>
<HR>
<P><a href="index.html">Main index</a> - <a href="vector.html">vector index</a> - <a href="full_index.html">Full index</a></P>
<P>&copy; 2003-2008 <a href="http://grass.osgeo.org">GRASS Development Team</a></p>
</body>
</html>