I have a shapefile composed of fire scar polygons identifiable as unique categories based on year of fire.

I am interested in measuring the area of overlapping fire scars from different years.

Is it possible to perform an intersect of categories within a shapefiles or will I have to split each category into a separate shapefile first?


The short answer is yes, but the way you go about this differs with the software you're using (QGIS, GDAL & OGR, SAGA, etc). I'll assume you're using ArcGIS 10.x:

If you load the shapefile twice in the same session (i.e., two Layers, both reading from the same shapefile datasource), and you set different Definition Queries on them for different fire years, you can then perform Intersection on these two layers. You can do that all via the GUI, of course, or in Python it might look something like the following:

import arcpy

# Two layers from the same shapefile
lyr1 = arcpy.mapping.Layer("test_lyr1")
lyr2 = arcpy.mapping.Layer("test_lyr2")

# Name the layers
lyr1.name = "lyr1"
lyr2.name = "lyr2"

# Set definition queries for each layer
lyr1.definitionQuery = '"FIREYEAR" = ' + "'2010'"
lyr2.definitionQuery = '"FIREYEAR" = ' + "'2011'"

# Perform the intersection on the named layers
# You can intersect among more than two layers at a time if 
# you've got the full ArcGIS license.
arcpy.Intersect_analysis(["lyr1", "lyr2"], r"c:\aDir\Intersection.shp")
| improve this answer | |

You can also just use the Intersect tool with one dataset as input as explained in How Intersect works:

Intersect can run with a single input. In this case, instead of discovering intersections between the features from the different feature classes or layers, it will discover the intersections between features within the single input. This can be useful to discover polygon overlap and line intersections (as points or lines).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.