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.")
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").
    – Vince
    Feb 25, 2018 at 1:42
  • 1
    See also gis.stackexchange.com/questions/26336/…
    – Vince
    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").

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.