Trend surface (vector points)

This tool can be used to interpolate a trend surface from a vector points file. The technique uses a polynomial, least-squares regression analysis. The user must specify the name of the input shapefile, which must be of a 'Points' base ShapeType and select the attribute in the shapefile's associated attribute table for which to base the trend surface analysis. The attribute must be numerical. In addition, the user must specify the polynomial order (0 to 10) for the analysis. A first-order polynomial is a planar surface with no curvature. As the polynomial order is increased, greater flexibility is allowed in the fitted surface. Although polynomial orders as high as 10 are accepted, numerical instability in the analysis often creates artifacts in trend surfaces of orders greater than 5. The operation will display a text report on completion, in addition to the output raster image. The report will list each of the coefficient values and the r-square value. The Trend Surface tool can be used instead if the input data is a raster image.

See Also:

Scripting:

The following is an example of a Python script that uses this tool:

wd = pluginHost.getWorkingDirectory()
# Input data has the shapefile name followed
# by the attribute, separated by a semicolon.
inputData = wd + "neighbourhoods.shp" + ";" + "NUM_SCHOOLS"
outputFile = wd + "output.dep"
polyOrder = "1"
gridRes = "10.0"
args = [inputData, outputFile, polyOrder, gridRes]
pluginHost.runPlugin("CorrelationForAttributes", 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 + "neighbourhoods.shp" + ";" + "NUM_SCHOOLS"
def outputFile = wd + "output.dep"
def polyOrder = "1"
def gridRes = "10.0"
String[] args = [inputData, outputFile, polyOrder, gridRes]
pluginHost.runPlugin("CorrelationForAttributes", args, False)

Credits: