ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Trend

Available with Spatial Analyst license.

  • Summary
  • Usage
  • Syntax
  • Code Sample
  • Environments
  • Licensing Information

Summary

Interpolates a raster surface from points using a trend technique.

Learn more about how Trend works

Usage

  • As the order of the polynomial is increased, the surface being fitted becomes progressively more complex. A higher-order polynomial will not always generate the most accurate surface; it is dependent on the data.

  • The optional RMS file output contains information on the RMS (root mean square) error of the interpolation. This information can be used to determine the best value to use for the polynomial order, by changing the order value until you get the lowest RMS error. See How Trend works for information on the RMS file.

  • For the LOGISTIC option of Type of regression, the z-value field of input point features should have codes of zero (0) and one (1).

  • Some input datasets may have several points with the same x,y coordinates. If the values of the points at the common location are the same, they are considered duplicates and have no effect on the output. If the values are different, they are considered coincident points.

    The various interpolation tools may handle this data condition differently. For example, in some cases, the first coincident point encountered is used for the calculation; in other cases, the last point encountered is used. This may cause some locations in the output raster to have different values than what you might expect. The solution is to prepare your data by removing these coincident points. The Collect Events tool in the Spatial Statistics toolbox is useful for identifying any coincident points in your data.

  • See Analysis environments and Spatial Analyst for additional details on the geoprocessing environments that apply to this tool.

Syntax

Trend (in_point_features, z_field, {cell_size}, {order}, {regression_type}, {out_rms_file})
ParameterExplanationData Type
in_point_features

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

Feature Layer
z_field

The field that holds a height or magnitude value for each point.

This can be a numeric field or the Shape field if the input point features contain z-values.

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

Field
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 the input point features, in the input spatial reference, divided by 250.

Analysis Cell Size
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
regression_type
(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
out_rms_file
(Optional)

File name 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

Return Value

NameExplanationData Type
out_raster

The output interpolated surface raster.

It is always a floating-point raster.

Raster

Code Sample

Trend example 1 (Python window)

This example inputs a point shapefile and interpolates the output surface as a TIFF raster.

import arcpy
from arcpy import env  
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
outTrend = Trend("ozone_pts.shp", "ozone", 2000, 2, "LINEAR")
outTrend.save("C:/sapyexamples/output/trendout.tif")
Trend example 2 (stand-alone script)

This example inputs a point shapefile and interpolates the output surface as a Grid raster.

# Name: Trend_Ex_02.py
# Description: Interpolate a series of point features 
#    onto a rectangular raster using a trend technique.
# Requirements: Spatial Analyst Extension

# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *

# Set environment settings
env.workspace = "C:/sapyexamples/data"

# Set local variables
inPointFeatures = "ca_ozone_pts.shp"
zField = "ozone"
cellSize = 2000.0
PolynomialOrder = 2
regressionType = "LINEAR"


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

# Execute Trend
outTrend = Trend(inPointFeatures, zField, cellSize, 
                 PolynomialOrder, regressionType)

# Save the output 
outTrend.save("C:/sapyexamples/output/trendout02")

Environments

  • Auto Commit
  • Cell Size
  • Current Workspace
  • Extent
  • Geographic Transformations
  • Mask
  • Output CONFIG Keyword
  • Output Coordinate System
  • Raster Statistics
  • Scratch Workspace
  • Snap Raster
  • Tile Size

Licensing Information

  • ArcGIS for Desktop Basic: Requires Spatial Analyst or 3D Analyst
  • ArcGIS for Desktop Standard: Requires Spatial Analyst or 3D Analyst
  • ArcGIS for Desktop Advanced: Requires Spatial Analyst or 3D Analyst

Related Topics

  • An overview of the Interpolation toolset
  • Understanding interpolation analysis
  • Comparing interpolation methods
Feedback on this topic?

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal