I'm currently trying to create a function for calculating an intersect of one of two shapefiles with another shapefile. I am later looping through the list of files and, depending on which one the loop lands on, would like to call the function to run the intersect on the respective file.
My script is as follows:
new_forest = "New_Forest.shp"
south_downs = "South_Downs.shp"
noise = "RoadNoise.shp"
def noise_intersect(park):
if park == new_forest:
arcpy.Intersect_analysis([new_forest, noise],"nf_noise_intersect")
return park + " intersect complete"
elif park == south_downs:
arcpy.Intersect_analysis([south_downs, noise],"sd_noise_intersect")
return park + " intersect complete"
I'm pretty new to this. I feel like what I have is roughly correct but I'm just trying to see if I'm missing something. I will later try to add code to calculate area of the output file but for now need to make sure this is correct.