Overlap of two polygon layers

09-02-2011 06:28 AM
New Contributor
I have a buffer of an original line shapefile, now a polygon file, and want determine what percentage that buffer occupies in polygons from another poly shapefile.  I thought either intersect or union was the way to go, but I can't seem to get the numbers to work out.  I know the total area of the buffer by running statistics on the field.  And I have calculated geometry on the output files, The problem is that the area of the union/intersect polys are much higher than the original buffer area.  Perhaps in the union I am inadvertently including both sets of polygons in the calculation?  But in the intersect, I don't understand why the total area of the original buffer is much lower than the intersect output.  Any suggestions?  Am I at least on the right track on the procedure, should both of these overlays work or just one or the other?
0 Kudos
4 Replies
New Contributor
You definitely want to use intersect, as union does include the area of both sets of buffers. The intersect output should be only the area shared by both sets of polygons. If you are still getting a larger area with the intersect output, the problem might be in the area analysis.
Have you figured this out yet? I'm interested in how you solved it.
0 Kudos
New Contributor
Could this also be an issue of differing units of measurement?
0 Kudos
Occasional Contributor III
For me this is almost always caused by overlapping features in the input datasets.


I have 1 polygon in dataset 1, dataset 2 contains 5 polygons of the exact same extent.

When I take the area of polygon 1 it is 10m2...after an intersect with dataset 2 there will now be 5 polygons of this same area, so 50m2 when counting the areas of dataset 1.
0 Kudos
Regular Contributor III
If it helps, here is some Python code that among other things calculates the % overlap of a "Spruce Zone" layer with a "watershed layer" (that is, the code figures out what pct of the watershed is covered by the spruce zone layer). Parts of it a bit cryptic (cause this code snipit is running in a large loop that I didn't include), but it should help demonstarte the process. And yes, the process is probably easier if you use the the union tool... Otherwise with intersect you would not recieve back any tabular data concerning the areas that did not overlap (FID_* = -1).... And would then you wouldn't be able to make the "full-picture" overlap % summary table if you were lacking the records where ovlp% was 0 (I guess you could do some aditional steps to put those records back in... Anyway, union is probably your best bet).

watershedFC = fgdbPath + "\\" + watershedLyr
arcpy.Dissolve_management(oesfWatershedsFC, watershedFC, watershedLyrDict[watershedLyr][0], "", "SINGLE_PART"); showGpMessage()
arcpy.AddField_management(watershedFC, "ACRES", "DOUBLE"); showGpMessage()
arcpy.CalculateField_management(watershedFC, "ACRES", "!shape.area@acres!", "PYTHON_9.3", ""); showGpMessage() 
union1FC = "in_memory\\union1"
arcpy.Union_analysis([watershedFC, spruceZoneFC], union1FC, "ALL", "" , "GAPS"); showGpMessage()
arcpy.DeleteField_management(union1FC, "ACRES"); showGpMessage()
arcpy.AddField_management(union1FC, "ACRES", "DOUBLE"); showGpMessage()
arcpy.CalculateField_management(union1FC, "ACRES", "!shape.area@acres!", "PYTHON_9.3", ""); showGpMessage() 
arcpy.MakeFeatureLayer_management(union1FC, "fl", "FID_spruce_zone <> -1"); showGpMessage()
freq1Tbl = "in_memory\\freq1"
arcpy.Frequency_analysis("fl", freq1Tbl, watershedLyrDict[watershedLyr][0], "ACRES"); showGpMessage()
arcpy.AddField_management(watershedFC, "SPRUCE_PCT", "DOUBLE"); showGpMessage()
arcpy.AddField_management(watershedFC, "SPRUCE_FLG", "DOUBLE"); showGpMessage()
arcpy.MakeFeatureLayer_management(watershedFC, "fl"); showGpMessage()
arcpy.AddJoin_management("fl", watershedLyrDict[watershedLyr][0], freq1Tbl, watershedLyrDict[watershedLyr][0], "KEEP_ALL"); showGpMessage()
arcpy.CalculateField_management("fl", "SPRUCE_PCT", "[freq1.ACRES] / [" + watershedLyr + ".ACRES]", "VB", ""); showGpMessage()
arcpy.RemoveJoin_management("fl", "freq1"); showGpMessage()
arcpy.MakeFeatureLayer_management(watershedFC, "fl", "SPRUCE_PCT < .5 OR SPRUCE_PCT IS NULL"); showGpMessage()
arcpy.CalculateField_management("fl", "SPRUCE_FLG", "-1", "PYTHON_9.3", ""); showGpMessage()
arcpy.MakeFeatureLayer_management(watershedFC, "fl", "SPRUCE_PCT >= .50"); showGpMessage()
arcpy.CalculateField_management("fl", "SPRUCE_FLG", "1", "PYTHON_9.3", ""); showGpMessage()
freq2Tbl = "in_memory\\freq2"
arcpy.Frequency_analysis(intersect1FC, freq2Tbl, watershedLyrDict[watershedLyr][0], "STRM_MILES"); showGpMessage()
arcpy.AddField_management(watershedFC, "STRM_MILES", "DOUBLE"); showGpMessage()
arcpy.MakeFeatureLayer_management(watershedFC, "fl"); showGpMessage()
arcpy.AddJoin_management("fl", watershedLyrDict[watershedLyr][0], freq2Tbl, watershedLyrDict[watershedLyr][0], "KEEP_ALL"); showGpMessage()
arcpy.CalculateField_management("fl", "STRM_MILES", "[freq2.STRM_MILES]", "VB", ""); showGpMessage()
arcpy.RemoveJoin_management("fl", "freq2"); showGpMessage()
0 Kudos