栅格范围 (3D Analyst)

许可等级:BasicStandardAdvanced

摘要

创建栅格数据集数据部分的面或折线的轮廓线。

插图

TinDomain and RasterDomain illustration

用法

语法

RasterDomain_3d (in_raster, out_feature_class, out_geometry_type)
参数说明数据类型
in_raster

输入栅格。

Raster Layer
out_feature_class

输出要素类。

Feature Class
out_geometry_type

输出要素类的几何。

  • LINE输出将是启用了 z 值的线要素类。
  • POLYGON输出将是启用了 z 值的面要素类。
String

代码实例

栅格范围 (RasterDomain) 示例 1(Python 窗口)

下面的示例演示了如何在 Python 窗口中使用此工具:

import arcpy
from arcpy import env

arcpy.CheckOutExtension("3D")
env.workspace = "C:/data"
arcpy.RasterDomain_3d("dtm_grd", "raster_domain.shp", "POLYGON")
栅格范围 (RasterDomain) 示例 2(独立脚本)

下面的示例演示了如何在独立 Python 脚本中使用此工具:

'''*********************************************************************
Name: RasterDomain Example
Description: This script demonstrates how to use the 
             Raster Domain tool to generate polygon footprints for all
             *.img rasters in a given workspace.
**********************************************************************'''

# Import system modules
import arcpy
from arcpy import env

# Obtain a license for the ArcGIS 3D Analyst extension
arcpy.CheckOutExtension("3D")

# Set environment settings
env.workspace = "C:/data"

try:
    # Create the list of IMG rasters
    rasterList = arcpy.ListRasters("*", "IMG")
    # Verify there are rasters in the list
    if rasterList:
        # Loop the process for each raster
        for raster in rasterList:
            # Set Local Variables
            outGeom = "POLYGON" # output geometry type
            # The [:-4] strips the .img from the raster name
            outPoly = "domain_" + raster[:-4] + ".shp"
            print "Creating footprint polygon for " + raster + "."
            #Execute RasterDomain
            arcpy.RasterDomain_3d(raster, outPoly, outGeom)
        print "Finished."
    else:
        "There are no IMG files in the " + env.workspace + " directory."
        
except Exception as e:
    # Returns any other error messages
    print e.message

环境

相关主题

许可信息

ArcGIS for Desktop Basic: 需要 3D Analyst
ArcGIS for Desktop Standard: 需要 3D Analyst
ArcGIS for Desktop Advanced: 需要 3D Analyst
5/10/2014