Select to view content in your preferred language

# Overlap of two polygon layers

654
4
09-02-2011 06:28 AM
Deactivated User
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?
Tags (3)
4 Replies
Emerging Contributor
Hi~
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.
Susan
Deactivated User
Could this also be an issue of differing units of measurement?
by
Frequent Contributor
For me this is almost always caused by overlapping features in the input datasets.

E.G.

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.
Honored Contributor
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.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.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.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()