TIN Triangle (3D Analyst)

Summary

Exports triangle faces from a TIN dataset to polygon features and provides slope, aspect, and optional attributes of hillshade and tag values for each triangle.

Illustration

TIN Triangle illustration

Usage

  • Slope and aspect calculations are based on the plane of the triangle. Slope cannot be calculated properly if the linear unit of the TIN's coordinate system uses angular measures, like decimal degrees.

  • XY and Z linear units should be in the same unit of measure in order for slope and hillshade calculations to provide accurate results. If the units differ but the TIN has its vertical and horizontal coordinate systems defined, an appropriate Z-factor is automatically determined. Otherwise, the Z Factor parameter can be used to explicitly define the conversion factor to be applied on the elevation values.

  • Aspect values are expressed in degrees and assume that North is 0°. The values increase clockwise and are recorded in the Aspect field. An aspect value of -1 is assigned for any flat triangle in the TIN.

  • Slope can be returned in degrees or percent, and the field name that the values are recorded in depends on the selection made in the Slope Units parameter:

    • PERCENT—Slope values will be stored in a field named Slope_Pct.
    • DEGREE—Slope values will be stored in a field named Slope_Deg.
  • Hillshade values reflect the localized relief that is produced from a light source that assumes the azimuth and vertical angle specified in the Hillshade parameter. 0° is assumed to be North for the azimuth, and the brightness value is expressed in between 0 to 255, where the lower the number, the darker the shade.

  • Tag Value Field parameter will only be active if the TIN has tag values that were explicitly defined.

Syntax

TinTriangle(in_tin, out_feature_class, {units}, {z_factor}, {hillshade}, {tag_field})
ParameterExplanationData Type
in_tin

The TIN dataset to process.

TIN Layer
out_feature_class

The feature class that will be produced by this tool.

Feature Class
units
(Optional)

The units of measure to be used in calculating slope.

  • PERCENTSlope is expressed as a percentage value. This is the default.
  • DEGREESlope is expressed as the angle of inclination from a horizontal plane.
String
z_factor
(Optional)

The factor by which z-values will be multiplied. This is typically used to convert Z linear units to match XY linear units. The default is 1, which leaves elevation values unchanged. This parameter is disabled if the spatial reference of the input surface has a Z datum with a specified linear unit.

Double
hillshade
HILLSHADE <azimuth>, <angle>
(Optional)

Specifies the azimuth and altitude angles of the light source when applying a hillshade effect for the feature layer output. Azimuth can range from 0 to 360 degrees, whereas altitude can range from 0 to 90. An azimuth of 45 degrees and altitude of 30 degrees would be entered as "HILLSHADE 45, 30".

String
tag_field
(Optional)

The field name in the output feature that will store the triangle tag value. This parameter is empty by default, which will result in tag values not being written to the output.

String

Code sample

TinTriangle example 1 (Python window)

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

arcpy.env.workspace = "C:/data"
arcpy.TinTriangle_3d("tin", "tin_triangle.shp", units="DEGREE", 
                     z_factor=1, hillshade="HILLSHADE 310,45", tag_field="tag")
TinTriangle example 2 (stand-alone script)

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

'''****************************************************************************
Name: TinTriangle Example
Description: This script demonstrates how to use the 
             TinTriangle tool to extract triangles from each TIN in the 
             target workspace.
****************************************************************************'''
# Import system modules
import arcpy

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

# Create list of TINs
TINList = arcpy.ListDatasets("*", "Tin")

# Verify the presence of TINs in the list
if TINList:
    for dataset in TINList:
        # Set Local Variables
        TINList = arcpy.ListDatasets("*", "Tin")
        slopeUnits = "PERCENT"
        zfactor = 1
        hillshade = "HILLSHADE 300, 45" # defines hillshade azimuth & angle
        tagField = "Tag"
        Output = dataset + "_triangles.shp" # name of the output file
        #Execute TinTriangle
        arcpy.ddd.TinTriangle(dataset, Output, slopeUnits, zfactor,
                              hillshade, tagField)
        print("Finished.")
else:
    print("There are no TIN(s) in the " + env.workspace + " directory.")

Licensing information

  • Basic: Requires 3D Analyst
  • Standard: Requires 3D Analyst
  • Advanced: Requires 3D Analyst

Related topics