描述
Exports one or more feature classes in a geodatabase to shapefiles.
This tool has three modes of converting feature classes to shapefiles: defense, generic, and MGCP. Each mode controls how the output shapefiles are named. The defense and MGCP export modes follow ArcGIS Defense Mapping data model requirements. Generic mode uses the same logic as Feature Class To Feature Class.
使用方法
Conversion Method specifies the export mode.
Coded domain values are exported as part of the shapefile to maintain data integrity. You can choose to export them as raw values, string descriptions, or both.
语法
arcpy.defense.GeodatabaseToShape(in_features, output_folder, coded_value_domain_export_mode, conversion_method, create_empties)
参数 | 说明 | 数据类型 |
in_features [in_features,...] | The features used to create the shapefiles. | Feature Layer |
output_folder | The folder that will contain the output shapefiles. | Folder |
coded_value_domain_export_mode | Indicates what method will be used to export coded domain values.
| String |
conversion_method | Indicates which conversion method will be applied.
| String |
create_empties | Indicates that the tool will create empty shapefiles if the input feature classes are also empty.
| Boolean |
派生输出
名称 | 说明 | 数据类型 |
derived_folder | Folder |
代码示例
GeodatabaseToShape example (stand-alone script)
The following stand-alone script demonstrates how to use the GeodatabaseToShape tool.
# Name: GeodatabaseToShape_Example.py
# Description: Exports feature classes from an MGCP workspace to shapefiles
# Requirements: Defense Mapping extension
# Import arcpy module
import arcpy
# Check out a DefenseMapping extension license
arcpy.CheckOutExtension("defense")
# Local variables
inFeatures = "C:\\Data\\Defense\\MGCP_TRD3.mdb\\MGCP\\AerofacA;C:\\Data\\Defense\\MGCP_TRD3.mdb\\MGCP\\AerofacP;C:\\Data\\Defense\\MGCP_TRD3.mdb\\MGCP\\AgristrA;C:\\Data\\Defense\\MGCP_TRD3.mdb\\MGCP\\AgristrP"
inShapeFolder = "C:\\Data\\Shapefiles"
inOutputType = "Values"
inConversionMethod = "MGCP"
# Execute Geodatabase To Shape function
arcpy.GeodatabaseToShape_defense(inFeatures, inShapeFolder, inOutputType, inConversionMethod)
# Check in the Defense Mapping extension
arcpy.CheckInExtension("defense")
环境
许可信息
- Basic: 否
- Standard: 需要 Defense Mapping
- Advanced: 需要 Defense Mapping