0

I'm trying to create a feature class from a table and I've gotten as far as you can see in my code below. I noticed that after running the code through the arcpy.MakeXYEventLayer_management function, the code returned no errors but the January2018_points file never showed up in Output.gdb. Because of this, the next section of code where I use Feature Class to Feature Class does not work, and it returns an error saying the input parameter does not exist or is not supported.

Is there something I'm missing here?

 # Import modules
 import arcpy
 from arcpy import env
 # Set workspace
 env.workspace = r"E:\GIS 4090\Projects\Project 1\Data"
 env.overwriteOutput = True
 # Import CSV file into a geodatabase using Copy Rows
 arcpy.CopyRows_management("January2018.csv",\
 r"E:\GIS 4090\Projects\Project 1\Data\Output.gdb\January2018")
 print("Table imported to gdb.")
 # Make XY Event later from the table
 arcpy.MakeXYEventLayer_management(r"Output.gdb\January2018", "XCoord", 
 "YCoord",\
 r"Output\January2018_points")
 print("Temporary XY Event layer created.")
 # Convert XY Event layer to a feature class using Feature Class to 
 Feature Class
 out_path = r"E:\GIS 4090\Projects\Project 1\Data\Output.gdb"
arcpy.FeatureClassToFeatureClass_conversion(r"Output.gdb\January2018_points", out_path, r"Output.gdb\January2018_points")
 print("XY Event Layer converted to feature class.")
PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Feb 25, 2018 at 0:25
2
  • 1
    This is just a simple typo. You declared a layer (which never results in a file) named Output\January2018_points and tried to input Output.gdb\January2018_points, which, of course does not exist (every once in a while, the error message is right). You will run into a second typo immediately, since the third parameter to FeatureClassToFeatureClass is a feature class name and you have a path (change "Output.gdb\January2018_points" to "January2018_points"). Commented Feb 25, 2018 at 1:42
  • 1
    See also gis.stackexchange.com/questions/26336/… Commented Feb 25, 2018 at 1:50

1 Answer 1

1

As commented by @Vince:

This is just a simple typo. You declared a layer (which never results in a file) named Output\January2018_points and tried to input Output.gdb\January2018_points, which, of course does not exist (every once in a while, the error message is right). You will run into a second typo immediately, since the third parameter to FeatureClassToFeatureClass is a feature class name and you have a path (change "Output.gdb\January2018_points" to "January2018_points").

answered Feb 25, 2018 at 22:51

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.