Using Intersect_analysis in script

967
2
02-05-2013 10:20 AM
stacyventresca1
New Contributor
Hello everyone, looking for some guidance. I want to intersect three features but I want to intersect 2 first then do some other stuff to that output then intersect that output to the next feature. I am not really understanding what I am doing wrong with the code, it seems to not like me using the output feature created from the first intersect as an input feature for the next intersect.

import arcpy
from arcpy import env

# set the workspace to avoid having to type in the full path to the data every time
env.workspace = r"E:\Development\Novus.gdb"



inFeatures = ("Existing_LU", "soils")
intOut = "LUsoilsInt"
arcpy.Intersect_analysis (inFeatures, intOut)


inFeatures2 = ("LUsoilsInt", "Subbasins_Dek")
intOut2 = "Int_LU_Soils_basins"
arcpy.Intersect_analysis (inFeatures2, intOut2)
Tags (2)
0 Kudos
2 Replies
markdenil
Occasional Contributor III
Use intOut, not the actual FC name, as input to the second intersect.


inFeatures = ("Existing_LU", "soils")
intOut = "LUsoilsInt"
arcpy.Intersect_analysis (inFeatures, intOut)


inFeatures2 = (intOut , "Subbasins_Dek")
intOut2 = "Int_LU_Soils_basins"
arcpy.Intersect_analysis (inFeatures2, intOut2).
0 Kudos
stacyventresca1
New Contributor
Thank you so much! Such a simple fix.
0 Kudos