描述
Exports one or more feature classes in a geodatabase to shapefiles using one of three modes: defense, generic, and Multinational Geospatial Co-Production Program (MGCP).
Each mode controls how the output shapefiles are named. The defense and MGCP export modes follow Defense Mapping data model requirements. The generic mode uses the same logic as the Feature Class To Feature Class tool.
使用方法
The Conversion Method parameter 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.
语法
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 containing output shape files created from input_features. | Folder |
代码示例
The following stand-alone script demonstrates how to use the GeodatabaseToShape tool to export feature classes from an MGCP workspace to shapefiles.
# Name: GeodatabaseToShape_sample.py
# Description: Exports feature classes from an MGCP workspace to shapefiles
# Import System Modules
import arcpy
# Check Out Extensions
arcpy.CheckOutExtension('Foundation')
# Setting Local Variables
in_features = r'C:\Temp\Test.gdb\MGCP\AerofacA;C:\Temp\Test.gdb\MGCP\AerofacP;C:\Temp\Test.gdb\MGCP\AgristrA;C:\Temp\Test.gdb\MGCP\AgristrP'
in_shape_folder = r'C:\Temp\Shapefiles'
in_output_type = 'Values'
in_conversion_method = 'MGCP'
# Execute Geodatabase To Shape Function
arcpy.topographic.GeodatabaseToShape(in_features, in_shape_folder, in_output_type, in_conversion_method)
# Check In Extensions
arcpy.CheckInExtension('Foundation')
许可信息
- Basic: 否
- Standard: 需要 Production Mapping
- Advanced: 需要 Production Mapping