Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Error message even though script finishes with expected results.

$
0
0
I am working on a script trying to plot lines from csv point data file..
It all seems to work until the end where I get an error stating that the table is not found..

when I open the FC in the map view, I see that I am getting the result I was expecting..

any help would be greatly appreciated..

here is the error...
Code:

Traceback (most recent call last):
  File "C:\temp\GIS_projects\Sample_tripData\test.py", line 27, in <module>
    "TELATDD","GEODESIC","TRIPSEQNUM")
  File "C:\Program Files (x86)\ArcGIS\Desktop10.1\arcpy\arcpy\management.py", line 2913, in XYToLine
    raise e
ExecuteError: ERROR 999999: Error executing function.
The table was not found. [trip_lines]
Failed to execute (XYToLine).


here is my code..
Code:

# Import system modules
import arcpy
print "importing modules and set environment...."
from arcpy import env
env.workspace = "c:/temp/gis_projects/sample_tripdata/test.gdb"
fc = "trip_lines"
#overwrite pre-existing files
arcpy.env.overwriteOutput = True

# Set local variables
print "setting data input and output variables..."
input_table = "C:/temp/GIS_projects/Sample_tripData/A6_TEMP_ATL_TRIP_HAULx.csv"

# check to see if FC exists, if so, delete.
if arcpy.Exists(fc):
    print "trip_lines exists..."
    print "deleting trip_lines..."
    arcpy.Delete_management(fc)
    print "trip_lines deleted..."

out_lines = "C:/temp/GIS_projects/Sample_tripData/test.gdb/trip_lines"

#XY To Line
print "running XY to Line Geoprocesseing tool..."
arcpy.XYToLine_management(input_table,out_lines,
                        "TSLONGDD","TSLATDD","TELONGDD",
                        "TELATDD","GEODESIC","TRIPSEQNUM")


Viewing all articles
Browse latest Browse all 2485

Trending Articles