Raster To TIN (3D Analyst)

Summary

Converts a raster to a triangulated irregular network (TIN) dataset.

Learn more about how Raster To TIN works

Illustration

Raster to TIN

Usage

Syntax

RasterTin_3d (in_raster, out_tin, {z_tolerance}, {max_points}, {z_factor})
ParameterExplanationData Type
in_raster

The input raster.

Raster Layer
out_tin

The output TIN dataset.

TIN
z_tolerance
(Optional)

The maximum allowable difference in (z units) between the height of the input raster and the height of the output TIN. By default, the z tolerance is 1/10 of the z range of the input raster.

Double
max_points
(Optional)

The maximum number of points that will be added to the TIN before the process is terminated. By default, the process will continue until all the points are added.

Long
z_factor
(Optional)

The factor that the height values of the raster will be multiplied by in the resulting TIN dataset. This is typically used to convert Z units to match XY units.

Double

Code Sample

RasterToTIN example 1 (Python window)

The following sample demonstrates the use of this tool in the Python window:

import arcpy
from arcpy import env

arcpy.CheckOutExtension("3D")
env.workspace = "C:/data"
arcpy.RasterTin_3d("vermont_ele.tif", "C:/output/TIN_VT", "2", "1000", "1")
RasterToTIN example 2 (stand-alone script)

The following sample demonstrates the use of this tool in a stand-alone Python script:

'''*********************************************************************
Name: RasterTin Example
Description: This script demonstrates how to use the 
             RasterTin tool to create a TIN for each IMG raster in the 
             target workspace.
**********************************************************************'''

# Import system modules
import arcpy
from arcpy import env

# Obtain a license for the ArcGIS 3D Analyst extension
arcpy.CheckOutExtension("3D")

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

try:
    # Create the list of IMG rasters
    rasterList = arcpy.ListRasters("*", "IMG")
    # Loop the process for each raster
    if rasterList:
        for raster in rasterList:
            # Set Local Variables
            zTol = 2
            maxPts = 1500000
            zFactor = 1
            # [:-4] strips the last 4 characters (.img) from the raster name
            outTin = "C:/Output/TIN_" + raster[:-4] 
            print "Creating TIN from " + raster + "."
            #Execute RasterTin
            arcpy.RasterTin_3d(raster, outTIN, zTol, maxPts, zFactor)
        print "Finished."
    else:
        "There are no IMG rasters in the " + env.workspace + " directory."
except Exception as e:
    # Returns any other error messages
    print e.message

Environments

Related Topics

Licensing Information

ArcView: Requires 3D Analyst
ArcEditor: Requires 3D Analyst
ArcInfo: Requires 3D Analyst

6/10/2013