Complicated intersect tool analysis

2668
5
07-07-2012 01:32 PM
NathanEmery
New Contributor
Hello,

I have a layer of multiple overlapping polygons of fire perimeters with the same field attributes. I'm looking to create smaller polygons of all of the intersections while preserving all of the field information. I want to have polygons that represent their fire history. Every attempt with the intersect tool produces separate polygons for each intersection (if three polygons overlap, three separate polygons are created with the intersecting spatial extent).

My question is whether I can alter the coding (in python) of the intersect analysis to combine the field attribute information. For example: If three polygons overlap and they all have the field "Year", when they combine the new field ID's will be preserved in the single intersection feature with "Year_1", "Year_2" and "Year 3". This way I might preserve the information from all of the overlapping polygons into the smaller intersections.

OR

Whether I may perform a second process upon the intersect output that combines the field attributes of intersections that are of the same extent. Basically have 3 polygons melded into one based on the same spatial extent. I've attempted using the Spatial Join tool and Dissolve to no success.

Thank you for your help and insight. I have the latest version of ArcGIS.
0 Kudos
5 Replies
RichardFairhurst
MVP Honored Contributor
Hello,

I have a layer of multiple overlapping polygons of fire perimeters with the same field attributes. I'm looking to create smaller polygons of all of the intersections while preserving all of the field information. I want to have polygons that represent their fire history. Every attempt with the intersect tool produces separate polygons for each intersection (if three polygons overlap, three separate polygons are created with the intersecting spatial extent).

My question is whether I can alter the coding (in python) of the intersect analysis to combine the field attribute information. For example: If three polygons overlap and they all have the field "Year", when they combine the new field ID's will be preserved in the single intersection feature with "Year_1", "Year_2" and "Year 3". This way I might preserve the information from all of the overlapping polygons into the smaller intersections.

OR

Whether I may perform a second process upon the intersect output that combines the field attributes of intersections that are of the same extent. Basically have 3 polygons melded into one based on the same spatial extent. I've attempted using the Spatial Join tool and Dissolve to no success.

Thank you for your help and insight. I have the latest version of ArcGIS.


Combine the spatial extend after the Intersect with the Dissolve tool.  Then perform a Spatial Join and use the one-to-one option.  Play with the summary options to get a comma separated list field.  Then parse that field out to separate fields.

If that doesn't work and you have an ArcInfo license you can use the Pivot Table tool in combination with the Summary tool to create separate numbered fields that converts columns to rows.  Takes a few steps and has to be done for each field transposition from column to row.  Done this many times to get exactly what you want.
0 Kudos
NathanEmery
New Contributor
It seems like it would work but I'm still stuck on the specifics of using the tools.

I can create shapefiles by year using the dissolve tool and generate complicated polygons representing the union of all fires from a given year.

Using the Spatial Join tool, I join the dissolved shapefile to itself using One to One, keeping all target features and using the merge rule of Join for the Year field (with a "," as a delimiter). My Match option is Intersect. To my knowledge this should merge polygons by their spatial overlap and have the year field combined and comma-delimited.

What it actually produces is a similar file to the dissolve shapefile but with an additional year1 field that has one of the earliest fire years as the attribute information. I'm not quite sure what I did or where I went wrong.
0 Kudos
JohnSobetzer
Frequent Contributor
If you split your parent shapefile by attributes for each year (Split tool, split layer script or ETGeowizards split wizard will do that for you), then union them together, will that work?  It's not a finished product, it holds all the information but you do have to find a way to get the year data from different year fields back into one field and that may hinge on how you want to store that information.  A simple concatenate in the calculator may work.  If there are overlaps within a year, however, then you have to split them out into separate layers as well.
0 Kudos
DaleHoneycutt
Regular Contributor
This is a perfect application of "spaghetti and meatballs". 

1. Use the Feature To Polygon tool, using your polygon feature class as input.  This will create a new feature class of polygons, but with no overlaps.  Hint:  For the label features parameter (the last parameter), input an empty point feature class with no attributes.  You can use the Create Feature Class tool for this -- just create a new, empty point feature class w/o any attributes, and use it as the label features input.  This prevents the output polygon feature class from having bogus attributes.  This is the "spaghetti" part -- you're creating single non-overlapping polygons from 'cartographic spaghetti' (any collection of lines and polygons).

2. Using the output of the Feature To Polygon tool as the input to the Feature To Point tool.  For the Inside parameter (point_location), set it to true (checked on) ("INSIDE" in python).  This will create a centroid point for each polygon in the input features.  This is the "meatballs".  Note that the output point feature class has the object ID of the input polygon it was generated from.

3. Overlay (using Intersect or Identity) the point feature class (meatballs) with your original feature class containing the overlapping polygons.  You'll get another point feature class. This new point feature class will have one point feature for each overlapping polygon.  So, if the meatball is overlain by 5 polygons, you'll get 5 points out.  If your original overlapping feature class was BURNAREAS with a single attribute named YEAR, and the point centroids was named MEATBALLS, the result of Intersect or Identity will be:
FID_BURNAREAS : the feature id of the overlapping polygon feature class
YEAR: the burn year
FID_MEATBALLS : the ID of the centroid
ORIG_FID: the ID of the non-overlapping polygon (the output of Feature To Polygon)

Note that FID_MEATBALLS and ORIG_FID are equal.

There will be multiple entries for the same FID_MEATBALLS where ever there are overlapping polygons.  So, you could end up with something like this (excuse the formatting-I need a table here)):

FID_BURNAREAS | YEAR |  FID_MEATBALLS | ORIG_FID
1         |                2001   |   15           |           15
2         |                2005   |   15           |           15
200     |                2012    |  15           |            15
198      |               2001   |    88           |           88
198       |              2001   |   72            |          72

So, polygon 15 -- the polygon in the output of Feature To Polygon -- has been burned 3 times: 2001, 2005, and 2012.

Now that you have the info you need, there are a number of approaches you can take.  For example, you could use the Summary Statistics tool to return the number of times a polygon has been burned.  (Use FID_MEATBALLS as the Case Item).  The Pivot Table tool is a favorite of mine in this case -- use YEAR as the Pivot Field.  I always have a hard time with the Pivot Table tool and end up experimenting with a small representative subset of the input table until I get it right.  The one problem with this approach is if a polygon gets burned twice in a single year.  But you can catch that with Summary Statistics. 

I hope this helps -- I can send an example model and data if you need.

BTW: Spaghetti and Meatballs is a technique that's been around since the earliest days of GIS.  It's the most elemental way to discover relationships in overlapping data.  It's only necessary for cases like this.  It's not a technique for the faint-hearted since one has to really paw through and understand the results.
0 Kudos
NathanEmery1
New Contributor
dmhoneycutt,

Thank you for your help. Creating the flat non-overlapping shapefile was very helpful. I ended up manipulating the attribute table in excel because it was easier to manipulate formulas and sort columns. I then exported it back into Arc by joining the .csv file with the flattened shapefile. Looks fantastic!

-Nate
0 Kudos