Hi,
I am making a looping code for Intersect_analysis of multiple files in a folder, but I ended up with having only one outcome..
''''
### folder containing facilities
in_folder_2 = r"D:\WORK\PROJECT\COVID_19_2\GIS\CREATED_DATA\FACILITIES"
shp_file_list_2 = [ ]
path_list2 = [ ]
intersectInput_list = [ ]
for shp_file2 in os.listdir(in_folder_2):
if shp_file2.endswith(".shp"):
intersectInput = os.path.join(in_folder_2, shp_file2)
intersectInput_list.append(intersectInput)
intersectInput_list
['D:\\WORK\\PROJECT\\COVID_19_2\\GIS\\CREATED_DATA\\FACILITIES\\N3A_A0010000.shp', 'D:\\WORK\\PROJECT\\COVID_19_2\\GIS\\CREATED_DATA\\FACILITIES\\TBGIS_TRDAR_RELM_prj.shp', 'D:\\WORK\\PROJECT\\COVID_19_2\\GIS\\CREATED_DATA\\FACILITIES\\UPIS_SHP_ZON216.shp']
interFeature = r"D:\WORK\PROJECT\COVID_19_2\Created_Data\PED_FLOW\eoul_flow_time_ymd_20200401.shp"
out_folder2 = r"D:\WORK\PROJECT\COVID_19_2\GIS\CREATED_DATA\FACILITIES_INTERS"
for intersectInput in intersectInput_list:
inFeatures = [intersectInput, interFeature]
name = shp_file2.strip(".shp")
clusterTolerance = 10
intersectOutput = os.path.join(out_folder2, name)
arcpy.Intersect_analysis(inFeatures, intersectOutput, "", clusterTolerance, "point")
The below is my output. Please help me, since I will increase the files in the folder much more than the current 3.
'D:\\WORK\\PROJECT\\COVID_19_2\\GIS\\CREATED_DATA\\FACILITIES_INTERS\\UPIS_SHP_ZON216.shx'