TIN vers raster (3D Analyst)

Récapitulatif

Crée un raster en interpolant ses valeurs de cellule à partir de l'altitude du TIN en entrée à la distance d'échantillonnage spécifiée.

Pour en savoir plus sur le fonctionnement de l'outil TIN vers raster

Illustration

Illustration de l'outil de création d'un raster à partir d'un TIN

Utilisation

Syntaxe

TinRaster_3d (in_tin, out_raster, {data_type}, {method}, {sample_distance}, {z_factor})
ParamètreExplicationType de données
in_tin

The input TIN.

TIN Layer
out_raster

The location and name of the output raster. When storing a raster dataset in a geodatabase or in a folder such as an Esri Grid, no file extension should be added to the name of the raster dataset. A file extension can be provided to define the raster's format when storing it in a folder:

  • .bil—Esri BIL
  • .bip—Esri BIP
  • .bsq—Esri BSQ
  • .dat—ENVI DAT
  • .img—ERDAS IMAGINE
  • .png—PNG
  • .tif—TIFF

If the raster is stored as a TIFF file or in a geodatabase, its raster compression type and quality can be specified using geoprocessing environment settings.

Raster Dataset
data_type
(Facultatif)

The data type of the output raster can be defined by the following keywords:

  • FLOATOutput raster will use 32-bit floating point, which supports values ranging from -3.402823466e+38 to 3.402823466e+38. This is the default.
  • INTOutput raster will use an appropriate integer bit depth. This option will round Z-values to the nearest whole number and write an integer to each raster cell value.
String
method
(Facultatif)

Méthode d'interpolation utilisée pour créer le raster.

  • LINEARCalcule les valeurs des cellules en appliquant une interpolation linéaire aux triangles TIN. Il s'agit de l'option par défaut.
  • NATURAL_NEIGHBORSCalcule les valeurs des cellules en utilisant une interpolation par voisins naturels des triangles TIN.
String
sample_distance
sampling_method distance
(Facultatif)

The sampling method and distance used to define the cell size of the output raster.

  • OBSERVATIONS—Defines the number of cells on the longest side of the output raster. This method is used by default with a distance of 250.
  • CELLSIZE—Defines the cell size of the output raster.
String
z_factor
(Facultatif)

The factor by which elevation values will be multiplied. This is typically used to convert Z linear units that match those of the XY linear units. The default is 1, which leaves elevation values unchanged.

Double

Exemple de code

Exemple 1 d'utilisation de l'outil TinRaster (fenêtre Python)

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.TinRaster_3d("tin", "raster.img", "INT", "LINEAR", "OBSERVATIONS 250", 1)
2e exemple d'utilisation de l'outil TinRaster (script autonome)

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

'''******************************************************************
Name: TinRaster Example
Description: This script demonstrates how to use the 
             TinRaster tool to create rasters 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 setting
    env.workspace = "C:/data"
    # Set Local Variables
    dataType = "INT"
    method = "NATURAL_NEIGHBORS"
    sampling = "CELLSIZE 10"
    zfactor = "1"
    # 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
            outRaster = "{0}_natural.img".format(dataset)
            # Execute TinRaster
            arcpy.ddd.TinRaster(dataset, outRaster, dataType, 
                                method, sampling, zfactor)
        print "Finished."
    else:
        print "There are no TIN(s) 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)

Environnements

Rubriques connexes

Informations de licence

ArcView : Obligatoire 3D Analyst
ArcEditor : Obligatoire 3D Analyst
ArcInfo : Obligatoire 3D Analyst

7/10/2012