1

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?

Vince
20.5k16 gold badges49 silver badges65 bronze badges
asked Sep 4, 2020 at 10:55
1
  • 1
    @BERA sure thing Commented Sep 4, 2020 at 11:55

1 Answer 1

0

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")
answered Sep 9, 2020 at 9:49

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.