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

Make XY Event Layer not taking .CSV info

$
0
0
I have a project going that requires an input XY to be mapped as a point before buffered. The XY point is in a .csv file and using the Make XY Event Layer results in an empty data set no matter what I do. I thought maybe it had something to do with the environments, hence why it is split into two at the moment.

the csv file has the following:

X_FIELD, Y_FIELD
33.8, 118

Python:

#Env 1
env.workspace = "I:\InfoRequest"
InfoRequestNum = arcpy.GetParameterAsText(1)
loctable = "I:\InfoRequest\XYLocation.csv"
sitelocfeat = "XYLOC" + InfoRequestNum
sitelocfeature = "XY_Loc_" + InfoRequestNum
locgdbtable = "XYLocation"

#Import table to InfoRequestGDB
arcpy.TableToGeodatabase_conversion([loctable], "I:\InfoRequest\InfoRequest.gdb")

#Env 2
env.workspace = "I:\InfoRequest\InfoRequest.gdb"

arcpy.MakeXYEventLayer_management(locgdbtable, "X_FIELD", "Y_FIELD", sitelocfeat)
arcpy.FeatureToPoint_management(sitelocfeat, sitelocfeature)

Viewing all articles
Browse latest Browse all 2485

Trending Articles