This tool can be used to plot a variogram based on a vector points file. The user must specify the name of the input vector shapefile and the name of the field within the vector's attribute table that is used to indicate the interpolated variable (taken to be height). The variogram measures differences in observed values over a set of separation distance bands, or lags. The plot of semivariance (a measure of the difference in values) by lag distance derived for a set of point observations is known as the experimental variogram. The variogram is central to the Kriging Interpolation method. In fact, kriging methods do not use this data directly to determine interpolation weights. Instead, a continuous model is fit to these observed data and this forms the basis for weight determination. The continuous model, known as the theoretical variogram, may take many forms but the three options that are included by this tool include, Gaussian, Exponential, and Spherical models. The models differ largely in the shape of the fitted line, however, each model type has the characteristic that the semivariance starts off low at the shortest lag distances (i.e. near points have similar values) and increases until eventually levelling off. The separation distance at which the variogram levels off is known as the range or active lag distance. This represents the maximum distance to which spatial autocorrelation is observed within the data set. The semivariance value at which the variogram levels off is known as the sill. In fact, not all variograms display this characteristic levelling off. Such variograms are referred to as non-transitive. This occurs when the data points do not extend beyond the correlation length of the modelled phenomena. The y-intercept of the variogram model is known as the nugget or nugget variance. The nugget is assumed to be non-spatial variation, i.e. apparent random noise, resulting from either measurement error or else variation caused by phenomena operating at shorter spatial scales than the minimum separation distance within the sampled data.
If the characteristics of spatial autocorrelation within the data set are the same in all directions, the variogram is said to be isotopic. If the data demonstrate a strong directional trend, the same variogram will not apply in all directions. An anisotropic, or directionally variant, variogram model can be applied by specifying the angle, tolerance, and band width parameters within an anisotropic variogram model.
Generally, the process of deriving a theoretical variogram model for use in kriging requires a certain amount of experimentation. It is an iterative process that requires modifying the model type, number of lags, and lag size in order to achieve the best possible fit. The Plot Variogram tool allows users to interactively adjust these input parameters and to view the variogram and variogram surface map. When the user has found a satisfactory model, the tool can be run and the final variogram report will be output along with the variogram plot and optionally the variogram map.
The following is an example of a Python script using this tool:
wd = pluginHost.getWorkingDirectory()
# Input data has the shapefile name followed
# by the attribute, separated by a semicolon.
inputData = wd + "spotHeights.shp" + ";" + "HEIGHT"
modelType = "Gaussian"
numLags = "12"
lagSize = "1000.0"
applyNugget = "true"
anisotropic = "false"
angle = "not specified"
tolerance = "not specified"
bandWidth = "not specified"
showVariogramMap = "true"
args = [inputData, modelType, numLags, lagSize, applyNugget, anisotropic, angle, tolerance, bandWidth, showVariogramMap]
pluginHost.runPlugin("PlotVariogram", args, False)
This is a Groovy script also using this tool:
def wd = pluginHost.getWorkingDirectory()
// Input data has the shapefile name followed
// by the attribute, separated by a semicolon.
def inputData = wd + "spotHeights.shp" + ";" + "HEIGHT"
def modelType = "Gaussian"
def numLags = "12"
def lagSize = "1000.0"
def applyNugget = "true"
def anisotropic = "false"
def angle = "not specified"
def tolerance = "not specified"
def bandWidth = "not specified"
def showVariogramMap = "true"
String[] args = [inputData, modelType, numLags, lagSize, applyNugget, anisotropic, angle, tolerance, bandWidth, showVariogramMap]
pluginHost.runPlugin("PlotVariogram", args, false)