私はPythonの初心者です。 arcpy.GetParameterAsText
関数を使用して、「ソースフォルダ」と「ジオデータベース」をArcGISツールボックスの入力パラメータにすることを試みています。ArcGIS/Pythonで入力パラメータを作成するにはどうすればよいですか?
私は2つの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"