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
Solved! Go to Solution.
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.
You need to pass a feature class not an ArcGIS Pro aprx file as the output.
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
Hi, I did try what you said but it is giving me the same error.
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.