RuntimeError: Object: Error in executing tool (in XYTableToPoint)

2209
4
Jump to solution
03-21-2021 09:21 PM
NabilaChaudhry
New Contributor

This is the code I write and it gives me following error. 

# reading the csv file containing wildfire data
fires_dataset=pd.read_csv(r'D:/UCALGARY/urbanGIS/lab4/lab4data/fires_data.csv',encoding='mac_roman')

# specify the location you want the store your point features after running the XY to Point tool.
fire_data_output = r'D:/UCALGARY/urban GIS/lab4/lab4ugis/lab4ugis.aprx'

fires_data = arcpy.management.XYTableToPoint(fires_dataset,fire_data_output, 'fire_location_longitude', 'fire_location_latitude')

Error

RuntimeError                              Traceback (most recent call last)
In  [7]:
Line 9:     fires_data = arcpy.management.XYTableToPoint(fires_dataset,fire_data_output, 'fire_location_longitude', 'fire_location_latitude')

File c:\program files\arcgis\pro\Resources\arcpy\arcpy\management.py, in XYTableToPoint:
Line 4151:  raise e

File c:\program files\arcgis\pro\Resources\arcpy\arcpy\management.py, in XYTableToPoint:
Line 4148:  retval = convertArcObjectToPythonObject(gp.XYTableToPoint_management(*gp_fixargs((in_table, out_feature_class, x_field, y_field, z_field, coordinate_system), True)))

File c:\program files\arcgis\pro\Resources\arcpy\arcpy\geoprocessing\_base.py, in <lambda>:
Line 511:   return lambda *args: val(*gp_fixargs(args, True))

RuntimeError: Object: Error in executing tool

 

0 Kudos
1 Solution

Accepted Solutions
DavidPike
MVP Frequent Contributor

I don't think a pandas dataframe is an allowed input.  I would just reference the path to the csv in arcpy.management.XYTableToPoint and do away with any pandas.

View solution in original post

4 Replies
Luke_Pinner
MVP Regular Contributor

You need to pass a feature class not an ArcGIS Pro aprx file as the output.

 

0 Kudos
mody_buchbinder
Occasional Contributor III

Hi

The second parameter should be a new feature class name (something like r'D:\temp\abc.gdb\fc') and not an aprx.

 

Have fun

Mody

0 Kudos
NabilaChaudhry
New Contributor

Hi, I did try what you said but it is giving me the same error. 

0 Kudos
DavidPike
MVP Frequent Contributor

I don't think a pandas dataframe is an allowed input.  I would just reference the path to the csv in arcpy.management.XYTableToPoint and do away with any pandas.