TIN-Polygon-Tag (ArcGIS 3D Analyst)

Lizenzstufe:BasicStandardAdvanced

Zusammenfassung

Erstellt Polygon-Features mit den Tag-Werten in einem TIN-Dataset (Triangulated Irregular Network, trianguliertes unregelmäßiges Netzwerk).

Bild

Abbildung "TIN-Polygon-Tag"

Verwendung

Syntax

TinPolygonTag_3d (in_tin, out_feature_class, {tag_field})
ParameterErläuterungDatentyp
in_tin

Das Eingabe-TIN.

TIN Layer
out_feature_class

Die Ausgabe-Feature-Class.

Feature Class
tag_field
(optional)

Der Name des Feldes, in dem das Tag-Attribut der Ausgabe-Feature-Class gespeichert wird. Der Feldname lautet standardmäßig Tag_Value.

String

Codebeispiel

TinPolygonTag – 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.TinPolygonTag_3d("tin", "tin_polytag.shp", "Tag_Value")
TinPolygonTag – Beispiel 2 (eigenständiges Skript)

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

'''****************************************************************************
Name: TinPolygonTag Example
Description: This script demonstrates use of the 
             TinPolygonTag tool to extract tag information 
             from each TIN in the target workspace.
****************************************************************************'''
# 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
    TagField = "Code"
    # Create list of TINs
    TINList = arcpy.ListDatasets("*", "Tin")
    # Verify the presence of TINs in the list
    if TINList:
        # Iterate through the list of TINs
        for dataset in TINList:
            # Define the name of the output file
            Output = dataset + "_domain.shp"
            # Execute TinPolygonTag
            arcpy.TinPolygonTag_3d(dataset, Output, TagFieldField)
        print "Finished."
    else:
        print "No TIN files reside in {0}".format(env.workspace)
    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
9/11/2013