HowTo:  Remove rasters from a mosaic dataset using an area of interest polygon in Python

相关信息
Article ID: 41281
Software:
ArcGIS - ArcEditor 10
ArcGIS - ArcInfo 10
ArcGIS for Desktop Advanced 10.1, 10.2
ArcGIS for Desktop Standard 10.1, 10.2
Platforms:
Windows XP, Server 2003, Windows 8, Server 2012, Vista, Server 2008, Windows 7, Server 2008 R2

问题描述
The Remove rasters from Mosaic Dataset tool does not have the option for spatial query. The code below illustrates the use of ArcPy to remove rasters based on a polygon area of interest.
已邀请:

易智瑞技术支持

赞同来自:

解决方案
The code sample can be used as a stand alone Python script to remove rasters from a mosaic dataset based on a spatial query. A polygon is used in this example.

1.
 
import arcpy
from arcpy import env

#set variables
env.workspace = r"D:\Documents\Northwest.gdb"
clipShape = "parks"
mosaicDataset = "CityOfPortland"

# Make a mosaic layer to be able to select the footprint
arcpy.MakeMosaicLayer_management(mosaicDataset, "mdlayer")

# Select the footprint based on polygon clipShape using the intersect method
arcpy.SelectLayerByLocation_management("mdlayer", "INTERSECT", clipShape)

# Run the remove rasters tool without any query on the selection
arcpy.RemoveRastersFromMosaicDataset_management("mdlayer", "#", "UPDATE_BOUNDARY", "MARK_OVERVIEW_ITEMS")

其它相关参考
  1. How to address e.g. Footprint in mosaic dataset from Modelbuilder and in Python


创建及修改时间
Created: 6/13/2013

Last Modified: 8/8/2013
原文链接
http://support.esri.com/en/kno ... 41281

要回复问题请先登录注册