Delete Terrain Points (3D Analyst)

Summary

Deletes points within a specified area of interest from one or more features that participate in a terrain dataset.

Usage

Syntax

DeleteTerrainPoints_3d (in_terrain, data_source, polygon_features_or_extent)
ParameterExplanationData Type
in_terrain

The input terrain dataset.

Terrain Layer
data_source

One or more feature classes from which points will be removed.

String
polygon_features_or_extent

Specifies the area from which points will be removed. A polygon feature class or an extent can be used.

If extent values are desired, use an arcpy.Extent object.

Feature Layer; Extent

Code Sample

DeleteTerrainPoints 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.DeleteTerrainPoints_3d("sample.gdb/featuredataset/terrain", 
                           "mass_pts_embed", "1379938 235633 1382756 237681")
DeleteTerrainPoints example 2 (stand-alone script)

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

'''**********************************************************************
Name: Delete Terrain Outliers
Description: Uses Locate Outliers to identify outlier points in 
             a terrain dataset, and eliminates the outliers from the 
             terrain with Delete Terrain Points.
**********************************************************************'''
# Import system modules
import arcpy
import exceptions, sys, traceback
from arcpy import env

try:
    arcpy.CheckOutExtension('3D')
    # Set Local Variables
    env.workspace = 'C:/data'
    terrain = 'test.gdb/featuredataset/sample_terrain'
    terrainPt = 'elevation_pts' # name of terrain point data source
    outliers = 'in_memory/outliers'
    # Execute LocateOutliers
    arcpy.ddd.LocateOutliers(terrain, outliers, 'APPLY_HARD_LIMIT', -10, 
                             350, 'APPLY_COMPARISON_FILTER', 1.2, 120, 
                             0.8, 8000)
    # Execute Delete Terrain Points
    arcpy.ddd.DeleteTerrainPoints(terrain, terrainPt, outliers)
    arcpy.CheckInExtension('3D')
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

Related Topics

Licensing Information

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

6/10/2013