I have created a code that iterates through a geodatabase, intersecting each feature with a road network. I am not sure how to make it so the intersected features are output into a new geodatabase. Here is my code so far:
import arcpy import os arcpy.env.overwriteOutput = True # Location of the data you want to import arcpy.env.workspace = r"D:\Data\OriginalFCs.gdb" # Output Location out_workspace = r"D:\Data\IntersectedFCs.gdb" # Lists all feature classes in the workspace fc_list = arcpy.ListFeatureClasses() # Iterating intersect through GDB for fc in fc_list: arcpy.Intersect_analysis(["RoadNetwork", fc], fc + "_Intersect", "NO_FID") arcpy.CopyFeatures_management(fc, out_workspace)
I want the output intersected features to be saved into the geodatabase specified by out_workspace, which is what I attempted to do with arcpy.CopyFeatures_Management in the final line. However, the intersected features are still output to the input workspace and nothing is created in the output location.
How can I modify my code to place the intersected features created in the FOR loop to my output workspace?