Trend

Interpolates a surface from points using a trend technique.

Learn more about how Trend works


Usage tips

Command line and Scripting

Map Algebra

ArcObjects

Syntax

Trend_sa (in_point_features, z_field, out_raster, cell_size, order, regression_type, out_rms_file)
Parameter Explanation Datatype
Input point features (Required)

The input point features containing z-values to be interpolated into a surface raster.

Composite Geodataset
Z value field (Required)

Field that holds a height or magnitude value for each point.

This can be a numeric field, or the Shape field if the in_point_features contain z-values.

If the regression type is Logistic, the values in the field can only be 0 or 1.

Field
Output raster (Required)

The output raster surface to be created.

Raster Dataset
Output cell size (Optional)

The cell size at which the output raster will be created.

This will be the value in the environment if it is explicitly set. Otherwise, it is the shorter of the width or the height of the extent of in_point_features, in the input spatial reference, divided by 250.

Analysis cell size
Polynomial order (Optional)

The order of the polynomial.

This must be an integer between 1 and 12. A value of 1 will fit a flat plane to the points, and a higher value will fit a more complex surface. The default is 1.

Long
Type of regression (Optional)

The type of regression to be performed.

  • LINEAR — Polynomial regression is performed to fit a least-squares surface to the set of input points. This is applicable for continuous types of data.

  • LOGISTIC — Logistic trend surface analysis is performed. It generates a continuous probability surface for binary, or dichotomous, types of data.

String
The name of the output containing RMS error and Chi-Square values. (Optional)

Filename for the output text file that contains information about the RMS error and the Chi-Square of the interpolation.

The extension must be ".txt".

File
Data types for geoprocessing tool parameters

Script Example

# Trend_sample.py
# Description: 
#   Interpolate a series of point features onto a rectangular 
#   raster using Trend surface interpolation.
# Requirements: None
# Author: ESRI
# Date: Sept 6, 2005

# Import system modules
import arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create()

try:
    # Set the output workspace name
    gp.Workspace = "C:/data"

    # Set the input feature dataset
    inputFeatureDataset = "C:/data/pts.shp"

    # Set the output raster name
    outputRaster = "trend1" 

    # Set the output extent
    gp.Extent = "0 0 6 6"

    # Set the attribute field, cellsize, weight and number of points to use
    AttributeName = "spot"
    CellSize = 1
    Polynomial_order = 3
    RegressionType = "LINEAR"

    # Check out ArcGIS Spatial Analyst extension license
    gp.CheckOutExtension("Spatial")

    # Process: Trend
    gp.Trend_sa(inputFeatureDataset, AttributeName, outputRaster, CellSize, _
                Polynomial_order, RegressionType)

except:
     # If an error occurred while running a tool, then print the messages
    print gp.GetMessages()

Map Algebra syntax

Trend(<point_feature | point_file>, {spot_item}, {order}, {LINEAR | LOGISTIC}, {cellsize}, {xmin, ymin, xmax, ymax}, {rms_file})

Parameter Explanation
<point_feature | point_file> The source of the data containing points with z-values to be converted to a raster surface.
  • point_feature — A point coverage or shapefile with z-values stored in an item.
  • point_file — An ASCII GENERATE file in the POINT format.
{spot_item} The item in the point coverage to be used as the z-value for the interpolation. The default is an item named SPOT. Use the # symbol as a placeholder when the point locations are input using a <point_file>.
{order} Order of the polynomial. It must be an integer with a value of 1 through 12. A value of 1 will fit a flat plane to the points, and a higher value will fit a more complex surface. The default is 1.
{LINEAR | LOGISTIC} Keywords specifying the type of regression to be performed.
  • LINEAR — Polynomial regression is performed to fit a least-squares surface to the set of input points. It is applicable for continuous types of data.
  • LOGISTIC — Logistic trend surface analysis is performed. It generates a continuous probability surface for binary, or dichotomous, types of data.
{cellsize} The width or height of a cell in map units. The default is the present environment. If the cell size is not set, an error message will occur. In this case, specify the {cellsize} argument or set the cell size in the analysis environment to establish the current environment setting.
{xmin, ymin, xmax, ymax} The dimensions, in map units, of the window in which to perform the interpolation. The window defaults to the current environment settings. If no environment is set, the default is the boundary of the input extended 0.5 times the cell size in each direction.
{rms_file} The filename for an output text file that contains information about the RMS error of the interpolation.

Map Algebra example

trend(pointfile)
trend(pointcov, nest, 2, logistic)
trend(wells, dry, #, logistic, 24)
trend(xmart, client, 1, linear, .25)
con(trend(elev, hills, 3, logistic ) > 2000, 1, 0 )

ArcObjects syntax

IInterpolationOp3:: Trend(geoData As IGeoDataset, trendType As esriGeoAnalysisTrendEnum, order As Long, out_rms_file As String) As IGeoDataset

Parameter Explanation
geoDataset A Featureclass or FeatureclassDescriptor containing point features with z-values to be converted to a raster surface.
trendType An esriGeoAnalysisTrendEnum specifying the type of regression to be performed.
  • esriGeoAnalysisLinear — Trend polynomial regression is performed to fit a least-squares surface to the set of input points. It is applicable for continuous types of data.
  • esriGeoAnalysisLogisticTrend — Logistic trend surface analysis is performed. It generates a continuous probability surface for binary, or dichotomous, types of data.
[order] Order of the polynomial. It must be an integer with a value of 1 through 12. A value of 1 will fit a flat plane to the points, and a higher value will fit a more complex surface. A commonly used value is 1.
[out_rms_file] The filename for an output text file that contains information about the RMS error of the interpolation.

ArcObjects example

' Create the RasterInterpolationOp object
Dim pInterpolationOp As IInterpolationOp
Set pInterpolationOp = New RasterInterpolationOp

' Declare the input feature class object
Dim pInputPoints As IGeoDataset

' Calls function to open a points dataset from disk
Set pInputPoints = OpenFeatureClassDataset ("D:\SpatialData", "inputsamples")

' Declare the output raster object
Dim pOutputRaster As IGeoDataset

' Calls the method
Set pOutputRaster = pInterpolationOp.Trend (pInputPoints, esriGeoAnalysisLinearTrend)

See Also

  • Natural Neighbor
  • IDW
  • Kriging
  • An overview of the Interpolation tools