I am currently running the following code in ArcPy:
in_dir_temp = "D:\\X\\"
x1= in_dir_temp + "x1.shp"
x2= in_dir_temp + "x2.shp"
y1= in_dir_temp + "y1.shp"
arcpy.Intersect_analysis([x1, x2], y1, "ALL", "", "INPUT")
Where x1 and x2 are polygons and so is y1.
When running this in ArcPy, it does not generate a shapefile in the output. It only generates .sbn .xml and .sbx files, despite the code outputting
<Result 'D:\\X\\y1.shp'>
However when I manually intersect the two polygons in ArcMap, it generates a polygon and shapefile.
I can't figure out why I am getting two different outputs?
-
1@BERA sure thingjusef– jusef2020年09月04日 11:55:24 +00:00Commented Sep 4, 2020 at 11:55
1 Answer 1
I managed to fix the issue.
I put the out in a geodb and it seemed work.
My new code is:
in_dir_temp = "D:\\X\\"
x1= in_dir_temp + "x1.shp"
x2= in_dir_temp + "x2.shp"
y1= in_dir_temp + "Default.gdb\\y1.shp"
arcpy.Intersect_analysis([x1, x2], y1, "ALL", "", "INPUT")
Explore related questions
See similar questions with these tags.