Error Creating FeatureClass

المشرف العام

Administrator
طاقم الإدارة
I am very, very new to Python and to posting in this site. I am trying to create a new Feature Class within a long script but before I do so, I am running it separately to make sure I have the syntax correct.The code below mimics the one in the ESRI help documentation.

# create new featureclass in which to put pointsimport arcpyarcpy.env.Workspace = "C:/Test2/GIS"out_path = "C:/Test2/GIS"out_name = "rhinoLines.shp"geometry_type = "POLYLINE"sr = arcpy.Describe("C:/Test2/GIS/RhinoTracks.shp").spatialReferencearcpy.CreateFeatureclass_management(out_path, out_name, geometry_type,sr)But I keep getting this error:

Traceback (most recent call last): File "C:\Python27\ArcGIS10.3\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 326, in RunScript exec codeObject in __main__.__dict__ File "C:\Test2\Scripts\stupid.py", line 16, in arcpy.CreateFeatureclass_management(out_path, out_name, geometry_type,sr) File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\management.py", line 1807, in CreateFeatureclass raise eRuntimeError: Object: Error in executing toolIf anyone has any ideas as to what I might be doing wrong I would greatly appreciate suggestions. In addition, is there a way to AddField while creating the FeatureClass?

thankyou,

~natasha



أكثر...
 
أعلى