arcgis中如何使用python_如何使用ArcGIS/Python生成输入参数?

我对Python是全新的。我试图使用arcpy.GetParameterAsText函数将“source folder”和“geodatabase”作为ArcGIS工具箱中的输入参数。在

我真的不知道把这两个arcpy.GetParameterAsText函数放在哪里。是否要将工作区设置为它?如果我这样做,我不知道如何创建前面没有路径的GDB文件。在# Set the workspace

arcpy.env.workspace = "C:\\Users\\x\\Desktop\\Python_Scripting\\4\\Lesson4_Data\\Lesson4_Data"

#Create the GDB

arcpy.CreateFileGDB_management("C:\\Users\\x\\Desktop\\Python_Scripting\\4\\Lesson4_Data\\Lesson4_Data","lesson4a.gdb")

# Set the feature class variables

fclist = arcpy.ListFeatureClasses("","polygon")

fctotal = arcpy.ListFeatureClasses()

# Start the loop on all feature classes

for fc in fclist:

fcdesc = arcpy.Describe(fc)

print fcdesc.basename + " is currently importing into the lesson4a.gdb."

arcpy.CopyFeatures_management (fc, "C:\\Users\\x\\Desktop\\Python_Scripting\\4\\Lesson4_Data\\Lesson4_Data\\lesson4a.gdb\\" + fcdesc.basename)

print fcdesc.basename + " is done importing into the lesson4a.gdb.\n"

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值