ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS 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
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Terrain To Points

  • Summary
  • Illustration
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Converts a terrain dataset into a new point or multipoint feature class.

Illustration

Terrain to Points Example

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

arcpy.ddd.TerrainToPoints(in_terrain, out_feature_class, {pyramid_level_resolution}, {source_embedded_feature_class}, {out_geometry_type})
ParameterExplanationData Type
in_terrain

The terrain dataset to process.

Terrain Layer
out_feature_class

The feature class that will be produced by this tool.

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 of the output feature class.

  • MULTIPOINT —The output point features will be written to a multipoint feature class. This is the default.
  • POINT —The output point features will be written to a point feature class.
String

Code sample

TerrainToPoints 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.TerrainToPoints_3d("sample.gdb/featuredataset/terrain", "terrain_points.shp", "6", "<NONE>", "POINT")
TerrainToPoints example 2 (stand-alone script)

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)

Environments

  • Current Workspace
  • Extent
  • Output Coordinate System
  • Geographic Transformations
  • XY Resolution
  • XY Tolerance
  • Z Resolution
  • Z Tolerance
  • Output CONFIG Keyword
  • Auto Commit

Licensing information

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

Related topics

  • 3D point features

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal