Terrain To Points (3D Analyst)
Summary
Converts a terrain dataset into a new point or multipoint feature class.
Illustration
![Terrain to Points Example Terrain to Points Example](00q9/GUID-CA22ECE2-0CDA-4A2C-A33A-6262B83E10A3-web.png)
Usage
- Points are extracted for the specified pyramid level resolution and area of interest.
- If an embedded feature class is specified, the output points will only come from the embedded features. Otherwise, the output points will be derived from all points contributing to the terrain surface.
If an embedded feature contains lidar attributes, such as RGB, classification, or return values, the attributes will be written to the output feature class. However, the way the attributes are written will depend on the geometry type that is specified:
- MULTIPOINT—Attributes will be stored in BLOB field.
- POINT—Attributes will be stored in numeric fields.
For more information on embedded features, read Embedded feature classes.
Syntax
Parameter | Explanation | Data Type |
in_terrain |
The input terrain dataset. | Terrain Layer |
out_feature_class |
The output feature class. | Feature Class |
pyramid_level_resolution (Optional) |
The z-tolerance or window-size resolution of the terrain pyramid level that will be used by this tool. The default is 0, or full resolution. | Double |
source_embedded_feature_class (Optional) |
The name of the terrain dataset's embedded points to be exported. If an embedded feature is specified, only the points from the feature will be written to the output. Otherwise, all points from all data sources in the terrain will be exported. | String |
out_geometry_type (Optional) |
The geometry type of the output feature class.
| String |
Code Sample
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.TerrainToPoints_3d("sample.gdb/featuredataset/terrain", "terrain_points.shp", "6", "<NONE>", "POINT")
The following sample demonstrates the use of this tool in a stand-alone Python script:
'''*****************************************************************
Name: TerrainToPoints Example
Description: This script demonstrates how to use the
TerrainToPoints tool.
*****************************************************************'''
# Import system modules
import arcpy
from arcpy import env
import exceptions, sys, traceback
try:
arcpy.CheckOutExtension("3D")
# Set environment settings
env.workspace = "C:/data"
# Set Local Variables
terrain = "sample.gdb/featuredataset/terrain"
outPts = arcpy.CreateUniqueName("terrain_pts", "sample.gdb")
outGeo = "POINT"
# Execute TerrainToPoints
arcpy.ddd.TerrainToPoints(terrain, outPts, 6, "<NONE>", outGeo)
except arcpy.ExecuteError:
print arcpy.GetMessages()
except:
# Get the traceback object
tb = sys.exc_info()[2]
tbinfo = traceback.format_tb(tb)[0]
# Concatenate error information into message string
pymsg = 'PYTHON ERRORS:\nTraceback info:\n{0}\nError Info:\n{1}'\
.format(tbinfo, str(sys.exc_info()[1]))
msgs = 'ArcPy ERRORS:\n {0}\n'.format(arcpy.GetMessages(2))
# Return python error messages for script tool or Python Window
arcpy.AddError(pymsg)
arcpy.AddError(msgs)