描述
Extracts data from an input database using selected areas of interest (AOI) and creates new databases for every AOI.
使用方法
At least one AOI feature must be selected.
If multiple AOI features are selected, the tool will create a separate database for each selected AOI. The resulting database only contains data that is contained in the selected AOI.
The resulting databases are named based on the NRN field of the AOI. For example, if you select the AOI feature with an NRN value of V795X16573, the output database will be named V795X16573.gdb.
The NRN field must be populated.
This tool is intended for clipping out a single AOI of data from the Input Datasets, making the data more manageable and portable.
语法
arcpy.defense.ExtractAOI(Area_of_Interest, Input_Datasets, Output_Directory)
参数 | 说明 | 数据类型 |
Area_of_Interest | The polygons used to define each database's clipped extent. | Feature Layer |
Input_Datasets | Datasets from which the data will be extracted. | Value Table |
Output_Directory | Location where the new databases will be created. | Folder |
代码示例
ExtractAOI example (Python window)
This script demonstrates how to use the ExtractAOI tool.
# Name: ExtractAOI_sample.py
# Description: Extracts data from one database using selected areas of interest (AOIs), and creates new databases for each AOI
# Requirements: ArcGIS Defense Mapping solution
# Import arcpy module
import arcpy
# Check out the extension
arcpy.CheckOutExtension('defense')
# Declare path to AOI features
AOIFeatures = r"C:\Program Files (x86)\ArcGIS\EsriDefenseMapping\Desktop10.3\ReferenceData\MapIndex.gdb\MapIndex\TLM50_Index"
# Create feature layers of the AOI
arcpy.management.MakeFeatureLayer(AOIFeatures, "AOIFeatures")
# Select specific AOIs
selection = "NRN = 'E732X57714'"
arcpy.management.SelectLayerByAttribute("AOIFeatures", "NEW_SELECTION", selection)
# Set parameters
Input_Datesets = r'C:\Data\MGCP_TRD_4_2.GDB\MGCP'
Output_Directory = r'C:\Data\Output'
# Execute the tool
arcpy.ExtractAOI_defense(Input_Datasets, AOIFeatures, Output_Directory)
# Check in the extension
arcpy.CheckInExtension('defense')
环境
许可信息
- Basic: 否
- Standard: 需要 Defense Mapping
- Advanced: 需要 Defense Mapping