Select to view content in your preferred language

The intersection of two polygons

1796
4
Jump to solution
11-17-2012 04:56 PM
XintaoLiu
Deactivated User
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
Frequent 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
Honored 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
Frequent 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
Deactivated User
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
Honored 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