# Spline

Interpolates a surface from points using a minimum curvature spline technique.

## Usage tips

Command line and Scripting

• The resulting smooth surface from Spline passes exactly through the input points.

• The REGULARIZED option of Spline Type usually produces smoother surfaces than those created with the TENSION option.

• With the REGULARIZED option, higher values used for the weight parameter produce smoother surfaces. The values entered for this parameter must be equal to or greater than zero. Typical values used are 0, 0.001, 0.01, 0.1, and 0.5. The Weight is the square of the parameter referred to in the literature as tau (t).

• With the TENSION option, higher values entered for the weight parameter result in somewhat coarser surfaces, but surfaces that closely conform to the control points. The values entered must be equal to or greater than zero. Typical values are 0, 1, 5, and 10. The Weight is the square of the parameter referred to in the literature as phi (Φ).

• The greater the value of Number of Points, the smoother the surface of the output raster.

• 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 may cause the Spline tool to fail. The solution is to prepare your data by removing these points.

• The following environment settings affect this tool:

Map Algebra

• The REGULARIZED option usually produces smoother surfaces than those created with the TENSION option.

• With the REGULARIZED option, higher values used for the {weight} parameter produce smoother surfaces. The values entered for this parameter must be equal to or greater than zero. Typical values that may be used are 0, 0.001, 0.01, 0.1, and 0.5. The {weight} is the square of the parameter referred to in the literature as tau (t).

• With the TENSION option, higher values entered for the weight parameter result in somewhat coarser surfaces, but surfaces that closely conform to the control points. The values entered must be equal to or greater than zero. The typical values are 0, 1, 5, and 10. The {weight} is the square of the parameter referred to in the literature as phi (Φ).

• The greater the value of {num_points}, the smoother the surface of the output raster.

• To create surfaces and two-dimensional coverages from ASCII files containing x,y coordinates and z-values, input files in the GENERATE POINT format can be used. The x,y coordinates for the output raster are stored in double precision. The z-values are stored in single precision. GENERATE files in the POINT format contain the feature ID, x,y coordinates, and z-values for point features. The ID values are not used by SPLINE. The format for GENERATE files containing points is:

```     ID,X,Y,Z
...
END
```
The end of the file is indicated with the END keyword. A typical GENERATE file containing points is shown below. The file can be comma or space delimited.
```     1,234.065,837.123,125.845
2,735.774,729.345,93.739
37,840.934,385.700,157.037
5,385.888,286.602,25.764
END
```

• 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 may cause the Spline tool to fail. The solution is to prepare your data by removing these points.

• Spline does not respect the Mask setting.

ArcObjects

• With the splineType parameter, the Regularized option usually produces smoother surfaces than those created with the Tension option.

• With the Regularized option, higher values used for the [weight] parameter produce smoother surfaces. The values entered for this parameter must be equal to or greater than zero. Typical values that may be used are 0, 0.001, 0.01, 0.1, and 0.5. The [weight] is the square of the parameter referred to in the literature as tau(t).

• With the Tension option, higher values entered for the [weight] parameter result in somewhat coarser surfaces, but surfaces that closely conform to the control points. The values entered must be equal to or greater than zero. The typical values are 0, 1, 5, and 10. The [weight] is the square of the parameter referred to in the literature as phi(Φ).

• The greater the value of [numPoints], the smoother the surface of the output raster.

• 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 may cause the Spline tool to fail. The solution is to prepare your data by removing these points.

• The output from ArcObjects is a temporary raster. To save the raster permanently, use the IRasterBandCollection::SaveAs method.

## Syntax

Spline_sa (in_point_features, z_field, out_raster, cell_size, spline_type, weight, number_points)
Parameter Explanation Datatype
Input point features (Required)

The input point features containing the 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.

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
Spline type (Optional)

The type of spline to be used.

• REGULARIZED — Yields a smooth surface and smooth first derivatives.

• TENSION — Tunes the stiffness of the interpolant according to the character of the modeled phenomenon.

String
Weight (Optional)

Parameter influencing the character of the surface interpolation.

When the REGULARIZED option is used, it defines the weight of the third derivatives of the surface in the curvature minimization expression. If the TENSION option is used, it defines the weight of tension.

The default weight is 0.1.

Double
Number of points (Optional)

The number of points per region used for local approximation.

The default is 12.

Long
Data types for geoprocessing tool parameters

Script Example

```# Spline_sample.py
# Description:
#   Interpolate a series of point features onto a rectangular
#   raster using Spline 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 = "spline1"

# 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
Weight = 0.1
NoPointsToUse = 5

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

# Process: Spline
gp.Spline_sa(inputFeatureDataset, attributeName, outputRaster, cellSize, _
"REGULARIZED", Weight, NoPointsToUse)

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

```

## Map Algebra syntax

Spline(<point_cover | point_file>, {spot_item}, {REGULARIZED | TENSION}, {weight}, {num_points}, {cellsize}, {xmin, ymin, xmax, ymax})

Parameter Explanation
<point_cover | point_file> The input data source containing points with z-values to be interpolated onto a surface raster.
• point_cover — A point coverage or shapefile with z-values stored in {spot_item}.
• point_file — An ASCII file in the POINT format of GENERATE.
{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>.
{REGULARIZED | TENSION} The method of Spline to be performed. There are two options:
• REGULARIZED — Yields a smooth surface and smooth first derivatives.
• TENSION — Tunes the stiffness of the interpolation according to the character of the modeled phenomenon.
{weight} Parameter influencing the character of the surface interpolation. When the REGULARIZED option is used, it defines the weight of the third derivatives of the surface in the curvature minimization expression. If the TENSION method is used, it defines the weight of tension. The default is 0.1.
{num_points} Number of points per region used for local approximation. The default is 12.
{cellsize} The width or height of a cell in map units. The default is the current cell size. The cell size must be specified in the analysis environment.
{xmin, ymin, xmax, ymax} The dimensions of the window in map units within 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 point data source extended 0.5 times the cell size in each direction.

### Map Algebra example

```spline(samplepoints)
spline(samplepoints, Concentration)
spline(samplepoints, #, #, 2, 10, 50)
```

## ArcObjects syntax

IInterpolationOp::Spline (geoData As IGeodataset, splineType As esriGeoAnalysisSpliceEnum, [weight As Variant], [numPoints As Variant]) As IGeoDataset

Parameter Explanation
geoData A Featureclass or FeatureclassDescriptor containing point features with z-values to be interpolated to a raster surface.
splineType An esriGeoAnalysisSpliceEnum defining the method of Spline to be performed. There are two options:
• esriGeoAnalysisRegularizedSpline — Yields a smooth surface and smooth first derivatives.
• esriGeoAnalysisTensionSpline — Tunes the stiffness of the interpolation according to the character of the modeled phenomenon.
[weight] Parameter influencing the character of the surface interpolation. When the Regularized option is used, it defines the weight of the third derivatives of the surface in the curvature minimization expression. If the Tension method is used, it defines the weight of tension. When no weight is specified, the default is 0.1.
[numPoints] Number of points per region used for local approximation. When no numPoints is given, the Spline method will use 12.

### 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.Spline (pInputPoints, esriGeoAnalysisRegularizedSpline
```