|
本帖最后由 benu 于 2015-9-15 16:36 编辑
利用python裁剪脚本可以批量自动生成shp图层,且被裁剪的数据无论是gdb中的图层还是shp文件,都可以,但只会生成shp文件,如何才能让它生成gdb下的图层文件.
下面是一个对 f:/data/目录下AAAA.gdb中的B图层,用1.shp来裁剪,得到S1.shp文件的脚本.
如何生成gdb下的图层?如要f:/output/BBBB.gdb下生成T2文件.如何操作?
# Name: Clip_Example2.py
# Description: Clip major roads that fall within the gnatcatcher habitat study area.
# Author: ESRI
# Import system modules
import arcpy
from arcpy import env
# Set workspace
env.workspace = "f:/data"
# Set local variables
in_features = "/AAAA.gdb/B"
clip_features = "1.shp"
out_feature_class = "f:/output/S1.shp"
xy_tolerance = ""
# Execute Clip
arcpy.Clip_analysis(in_features, clip_features, out_feature_class, xy_tolerance)
|
|