移除 Terrain 金字塔等级 (3D Analyst)
摘要
从 terrain 数据集中移除金字塔等级。
用法
-
除了表示全分辨率金字塔的等级 0 之外,任何金字塔等级都可以移除。
-
在 ArcSDE 数据库中使用时,输入 terrain 将无法注册为版本。
语法
RemoveTerrainPyramidLevel_3d (in_terrain, pyramid_level_resolution)
参数 | 说明 | 数据类型 |
in_terrain |
输入 terrain 数据集。 | Terrain Layer |
pyramid_level_resolution |
要移除的由分辨率指定的金字塔等级。 | Double |
代码实例
RemoveTerrainPyramidLevel 示例 1(Python 窗口)
下面的示例演示了如何在 Python 窗口中使用此工具:
import arcpy
from arcpy import env
arcpy.CheckOutExtension("3D")
env.workspace = "C:/data"
arcpy.RemoveTerrainPyramidLevel_3d("sample.gdb/featuredataset/terrain", 10)
RemoveTerrainPyramidLevel 示例 2(独立脚本)
下面的示例演示了如何在独立 Python 脚本中使用此工具:
'''****************************************************************************
Name: RemoveTerrainPyramidLevel Example
Description: This script demonstrates how to add new
points to a terrain with the DeleteTerrainPoints tool, then use
the ChangeTerrainReferenceScale and RemoveTerrainPyramidLevel to
to adjust the pyramids for reducing the amount of data stored for
providing an optimized display performance.
****************************************************************************'''
# Import system modules
import arcpy
from arcpy import env
import traceback, sys
try:
# Obtain a license for the ArcGIS 3D Analyst extension
arcpy.CheckOutExtension("3D")
# Set environment settings
env.workspace = "C:/data"
# Set Local Variables
inTerrain = "sample.gdb/featuredataset/terrain"
targetPts = "mass_pts_embed"
AOI = "1379938.43267328 235633.08128634 1382756.00752135 237681.848838107"
#Execute DeleteTerrainPoints
arcpy.DeleteTerrainPoints_3d(inTerrain, targetPts, AOI)
arcpy.AddMessage("Changing the terrain reference scale...")
# Execute ChangeTerrainReferenceScale
arcpy.ChangeTerrainReferenceScale_3d(inTerrain, 500, 1000)
# Execute RemoveTerrainPyramidLevel
arcpy.RemoveTerrainPyramidLevel_3d(inTerrain, 4)
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)
相关主题
许可信息
ArcGIS for Desktop Basic:需要 3D Analyst
ArcGIS for Desktop Standard:需要 3D Analyst
ArcGIS for Desktop Advanced:需要 3D Analyst
9/15/2013