The intersection of two polygons

1588
4
Jump to solution
11-17-2012 04:56 PM
XintaoLiu
Occasional Contributor II
Now I have two shapes of polygons, how to get the intersection area of them?

I tried: interShp = Shp1.intersection(shp2), but it does not work.

Thanks in advance.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
MikeHunter
Occasional Contributor
What you are trying to do will work with arcpy 10.0 or 10.1.  But you are calling the geometry object method wrong:

 interShp = Shp1.intersect(shp2, 4)


Not "intersection, but "intersect."  And you need the 2nd arg, the dimension of the output geometry.  You said area, so that would be 4.

good luck
Mike

View solution in original post

0 Kudos
4 Replies
T__WayneWhitley
Frequent Contributor
You can use geometry objects with the Intersect tool, see this:
http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000001z000000

In your case as you've described it, you would create 2 objects to enter as input, potentially writing a 3rd geom object or write the output to a new shapefile or fc.
0 Kudos
MikeHunter
Occasional Contributor
What you are trying to do will work with arcpy 10.0 or 10.1.  But you are calling the geometry object method wrong:

 interShp = Shp1.intersect(shp2, 4)


Not "intersection, but "intersect."  And you need the 2nd arg, the dimension of the output geometry.  You said area, so that would be 4.

good luck
Mike
0 Kudos
XintaoLiu
Occasional Contributor II
What you are trying to do will work with arcpy 10.0 or 10.1.  But you are calling the geometry object method wrong:

 interShp = Shp1.intersect(shp2, 4)


Not "intersection, but "intersect."  And you need the 2nd arg, the dimension of the output geometry.  You said area, so that would be 4.

good luck
Mike


Thank you so muck! It works!

By the way, where can I find such specific reference and examples to read? Thank you again.
0 Kudos
T__WayneWhitley
Frequent Contributor
I am not using 10.1 yet but found the method, intersect(other, dimension), documented here:
http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000061000000

Thanks Mike, I was unaware of this and although I couldn't find the specific doc for 10.0, I will try this out tomorrow.
0 Kudos