Sum polygons within polygons

1909
8
11-08-2012 11:18 AM
DE1
by
New Contributor
Hello,

I am trying to sum small polygons (land disturbance) that are within larger ones (counties). Some polygons are completely within a county; others cross county boundaries. I would like to say, at the end of the day, "County X has 2,000 acres of disturbed land while County Y has 5 acres." (This is somewhat similar to this, except I am attempting to sum thousands of polygons within dozens of larger ones ).

[ATTACH=CONFIG]19157[/ATTACH]

Here is what I have done:
-Add county layer to ArcGIS
-Add land disturbance layer
-Spatially join them (Analysis Tools > Overlay > Spatial Join)
        Target features: counties
        Join features: land disturbance layer
        Join operation: one to many
        Join type: Intersects

I get a spreadsheet with a list of all of the polygons and their areas for each county. Some counties have 0, which is accurate. Other counties have several thousand entries, which is also accurate. The problem: The total area I come up with for land disturbance (if I sum everything by county) is greater than the total area of land disturbance in the original land-disturbance .dbf file.

If "intersect" over-counts, I figured using "contains" for the join type might be accurate. However, this undercounts the amount of total land disturbance. How do I get the right amount of land disturbance per county?

I would appreciate any help or advice. Thank you so much!
0 Kudos
8 Replies
RichardFairhurst
MVP Honored Contributor
Hello,

I am trying to sum small polygons (land disturbance) that are within larger ones (counties). Some polygons are completely within a county; others cross county boundaries. I would like to say, at the end of the day, "County X has 2,000 acres of disturbed land while County Y has 5 acres." (This is somewhat similar to this, except I am attempting to sum thousands of polygons within dozens of larger ones ).

[ATTACH=CONFIG]19157[/ATTACH]

Here is what I have done:
-Add county layer to ArcGIS
-Add land disturbance layer
-Spatially join them (Analysis Tools > Overlay > Spatial Join)
        Target features: counties
        Join features: land disturbance layer
        Join operation: one to many
        Join type: Intersects

I get a spreadsheet with a list of all of the polygons and their areas for each county. Some counties have 0, which is accurate. Other counties have several thousand entries, which is also accurate. The problem: The total area I come up with for land disturbance (if I sum everything by county) is greater than the total area of land disturbance in the original land-disturbance .dbf file.

If "intersect" over-counts, I figured using "contains" for the join type might be accurate. However, this undercounts the amount of total land disturbance. How do I get the right amount of land disturbance per county?

I would appreciate any help or advice. Thank you so much!


A Spatial Join will not work, because it duplicates the entire feature.  It only overlaps shapes in memory, but outputs just the intersection of the attributes.  I think you want to use the Intersect tool.  This tool will phyically intersect the two feature classes together.  It will only output polygons that cover areas that exist in both feature classes.  The Union tool will cut the features and output the complete areas covered in both feature classes.  From there you should be able to do your summaries or dissolves.
0 Kudos
DE1
by
New Contributor
Richard, thank you so much for your help. I've just followed your directions, and unfortunately, I get a very similar result to the spatial join process.

Spatial join with intersect: 542,635 acres
Merge, then union: 542,543 acres
Original dbf: 412,435 acres

Here is what I did:
-Used Intersect tool to merge two feature classes together
-Used Union tool:
Input features: intersect1
Output Feature Class: intersect_union
0 Kudos
RichardFairhurst
MVP Honored Contributor
Richard, thank you so much for your help. I've just followed your directions, and unfortunately, I get a very similar result to the spatial join process.

Spatial join with intersect: 542,635 acres
Merge, then union: 542,543 acres
Original dbf: 412,435 acres

Here is what I did:
-Used Intersect tool to merge two feature classes together
-Used Union tool:
Input features: intersect1
Output Feature Class: intersect_union


Probably there is a lot of overlap within your land disturbance layer and it is multiplying areas that overlap.  If just the total area of disturbance is important and not the attributes associated each individual distubance, first use the Dissolve Tool on the land disturbance polygons to really merge them into a single shape.  Then use just the Union of the couties with the single land disturbance shape.  Unless the Counties overlap each other this should result in a consitent area output.

I also did not mean to use both Intersect and Union, just use one or the other.  So if you did a two step process somehow that used both tools, just do one of those tools.  You are not reporting the total area of all polyons in the Union, just those with attributes from the land disturbance layer, correct?  Make sure you first do a selection before summarizing if used the Union tool and retained portions of the Counties that are not part of the land disturbance areas.

Are you positive both your County layer and your land disturbance layer are in the same Spatial Reference projection?  They must be in order to get consistent summary area results.
0 Kudos
DE1
by
New Contributor
Richard, I apologize for the delay in responding. I tried your suggestions, and here's what happened:

-I think you may be right about overlap in the land disturbance layer. I used the Dissolve tool, and then used the Union of the counties with the dissolved land disturbance shape. That gave me the correct area output for the *total* disturbed land - not the amount of land disturbance per county. I keep playing around with this, because I think you're onto something, but I can't make it work yet.

-Previously, I did use both Intersect and Union. Per your recent directions, I did just of them (Intersect) and got an inflated amount of acres (542,543). I also tried Union and got the higher amount, too. You are correct: with Union, I am just reporting the area of polygons in the land disturbance layer.

-You were right about my projection being wrong. In my haste to follow your prior directions, I had used the wrong (i.e., non-projected) shapefile.

Thank you again for your help. If you have any other advice, I would love to hear it.

Gratefully,
Daniel
0 Kudos
RichardFairhurst
MVP Honored Contributor
-I think you may be right about overlap in the land disturbance layer. I used the Dissolve tool, and then used the Union of the counties with the dissolved land disturbance shape. That gave me the correct area output for the *total* disturbed land - not the amount of land disturbance per county. I keep playing around with this, because I think you're onto something, but I can't make it work yet.


This is the correct approach.  The final step is to Dissolve the output of the Union you described above, but this time be sure to use County Name or County FID and the Dissolved land distrubance FID as Dissolve Fields.  This should create two shapes per County, one that has a positive or 0 land disturbance FID value that represents the total disturbed land in the County and the other with a -1 or null land disturbance FID value that represents the total undisturbed land in the County.  Selecting the ones from this second Dissolve with the positive or 0 land disturbance FID values should give you the disturbed land area for each of the Counties.
0 Kudos
DE1
by
New Contributor
Unfortunately, I still can't get it to work. I must be doing something wrong! Here's what I'm doing:

1. Load Tigerline county file (Census) and land disturbance file. Check they are in same projection.
2. Dissolve land_disturbance
Dissolve fields: Type
3. Union:
input files: land_disturbance_Dissolve, Tigerline
4. Dissolve:
input files: land_disturbance_Dissolve_Union
dissolve fields: Area, Type, GEOID10, NAME10
5. Check results: 508,492 acres


I also tried this:
Union:
input: land_disturbance, Tigerline
Dissolve:
input: land_disturbance_Union
dissolve field: Type, GEOID10, NAME10
statistics: Area (sum)
3. Check results: 542,543 acres
0 Kudos
DE1
by
New Contributor
Update: I installed Hawth's Analysis Tools for GIS. Using the Polygon in Polygon Analysis tool (http://www.spatialecology.com/htools/polypolyanalysis.php), I was able to get the correct total number of acres (and acres per county).

I'd still like to use ArcGIS if possible though.
0 Kudos
RichardFairhurst
MVP Honored Contributor
Unfortunately, I still can't get it to work. I must be doing something wrong! Here's what I'm doing:

1. Load Tigerline county file (Census) and land disturbance file. Check they are in same projection.
2. Dissolve land_disturbance
Dissolve fields: Type
3. Union:
input files: land_disturbance_Dissolve, Tigerline
4. Dissolve:
input files: land_disturbance_Dissolve_Union
dissolve fields: Area, Type, GEOID10, NAME10
5. Check results: 508,492 acres


I also tried this:
Union:
input: land_disturbance, Tigerline
Dissolve:
input: land_disturbance_Union
dissolve field: Type, GEOID10, NAME10
statistics: Area (sum)
3. Check results: 542,543 acres


You are getting too fancy.  You simply cannot retain Type or Area in your dissolves, because these overlap.  You need a land disturbance dissolve that has no attributes and is just a single shape with no overlapping polygons to get a true area report of land disturbance.  That is your most important statistic and will provide the baseline for comparing any other fancier output.

So do these steps:

1. Load Tigerline county file (Census) and land disturbance file. Check they are in same projection.
2. Dissolve land_disturbance
Dissolve fields: None
3. Union:
input files: land_disturbance_Dissolve, Tigerline
4. Dissolve:
input files: land_disturbance_Dissolve_Union
dissolve fields: GEOID10, NAME10
5. Recalculate area of each shape using the Geometry Calculator.  Report that value.

You cannot not rely on the original areas of your land disturbance layer to create summaries during the process, because the original shape areas will be added together not the cut up shape area values.  This is probably why you get widely varying results.  If you create a summary of the original areas during the process, you can compare its result to the geometry calculator results to find the shapes that were affected by overlaps.

Once you get non-overlappinng shapes that show the true areas disturbed relative to the Counties, then you can worry about getting shapes that deal with overlapping types and summarizing them into a single non-overlapping shape.  For that I assume that if you had three overlapping shapes of Type A, Type B and Type C you would want them to collapse into a single shape with a field containing the list of types contained in the shape, i.e., "Type A, Type B, Type C".

Retaining the type values would require a much longer multi-step process that is much more complex.  I would have to do it myself to break it out step by step, because at every step you risk multiplying the number of polygons that interconnect.

Without having tested this, I would probably say you would have to Intersect the original land disturbance layer with itself first to fully cut it up at every overlapping shape boundary. The Spatial Join tool would come into play to Spatially join this output with itself using the one-to-one option to create a Summary list field output (i.e., a field containing values like "Type A, Type B, Type C"). The Spatial Join would have to use a negative intersecting buffer to avoid cross-over of attributes.  I then would probably Dissolve on the Summary list field of combined overlapping types to get back to a single non-overlapping shape for each complete overlapping Type combination.  Then Union that output with the Counties.  Finally use the geometry calculator at the end to get areas by County for all combined types with no overlapping area multiplication.

Any attempt to summarize the full area of a single type and add it together with the full area of any other type that fully or partially overlaps it will give incorrect area summary results if the sums of the areas of the two types are evaluated in independent operations.  The evaluation of area is a dependent operation through out the process.
0 Kudos