Stack-Profil (ArcGIS 3D Analyst)

Lizenzstufe:BasicStandardAdvanced

Zusammenfassung

Erstellt eine Tabelle und optional ein Diagramm für das Profil von Linien-Features auf einer oder mehreren Multipatch-, Raster-, TIN- oder Terrain-Oberflächen.

Bild

Stack-Profil – Beispiel

Verwendung

Syntax

StackProfile_3d (in_line_features, profile_targets, out_table, {out_graph})
ParameterErläuterungDatentyp
in_line_features

Die Linien-Features, für die ein Profil über die Oberflächen-Eingaben erstellt wird.

Feature Layer
profile_targets
[profile_targets,...]

Die abgebildeten Daten, die aus einer beliebigen Kombination aus Multipatch-Features und Flächenmodellen wie Raster-, TIN-, Terrain- und LAS-Datasets bestehen können.

Feature Layer; LAS Dataset Layer; Raster Layer; Terrain Layer; TIN Layer
out_table

Die Ausgabetabelle, in der die interpolierten Messwerte für jedes Profil gespeichert werden.

Table
out_graph
(optional)

Der Name des Ausgabediagramms, das in ArcMap, ArcScene oder ArcGlobe angezeigt werden kann.

Graph

Codebeispiel

StackProfile – Beispiel 1 (Python-Fenster)

Anhand des folgenden Beispiels wird die Verwendung dieses Werkzeugs im Python-Fenster veranschaulicht:

import arcpy
from arcpy import env

arcpy.CheckOutExtension('3D')
env.workspace = 'C:/data'
arcpy.StackProfile_3d('profile_line.shp', 'dem.tif; buildings.shp', 
                     'profile_values.dbf', 'Surface Profile')
StackProfile – Beispiel 2 (eigenständiges Skript)

Im folgenden Beispiel wird die Verwendung dieses Werkzeugs in einem eigenständigen Python-Skript veranschaulicht:

'''**********************************************************************
Name: Save Profiles to Graph Files
Description: Creates profile graphs of multipatch and surface features, 
             which are then saved as graph files.
**********************************************************************'''
# Import system modules
import arcpy
import exceptions, sys, traceback

# Set Local Variables
profileLine = arcpy.GetParameterAsText(0)
profileTargets = arcpy.GetParameterAsText(1) # input las files
profileTable = arcpy.CreateUniqueName('profile_table', 'in_memory')
graphName = "Sample Graph"
outGraph = arcpy.GetParameterAsText(2) # output graph file

try:
    arcpy.CheckOutExtension('3D')
    # Execute StackProfile
    arcpy.ddd.StackProfile(profileLine, profileTargets, profileTable, graphName)
    # Execute SaveGraph
    arcpy.management.SaveGraph(graphName, outGraph)
    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)

Umgebung

Verwandte Themen

Lizenzierungsinformationen

ArcGIS for Desktop Basic: Erfordert 3D Analyst
ArcGIS for Desktop Standard: Erfordert 3D Analyst
ArcGIS for Desktop Advanced: Erfordert 3D Analyst
6/5/2014