[GIS] Using ArcGIS Tabulate Intersection to determine maximum land cover within polygon area

arcgis-desktoppolygontabulate

I have a shapefile (layer A) containing different polygons – each polygon representing an ecoregion. I have another layer of polygons (layer B) – each polygon representing a watershed boundary. I want to determine the ecoregion (layer A) with the greatest footprint within each watershed (layer B).

The Tabulate Intersection tool allows me to calculate the percent of each ecoregion in layer A in each watershed in layer B, and I can then join this table to layer B – but what if I only want the max value?

Meaning the ecoregion, and the associated percent, that is the largest ecoregion within the watershed. Is there a simple way to direct the Tabulate Intersection tool to only produce a table with the largest ecoregion footprint in each watershed?

I can do this by hand when working with small datasets but would prefer it is automated for larger ones.

Best Answer

Assuming you want to use it in Model Builder, I suggest you a "Calculate Value" script as follows:

def LargestEcoregion(tabulate_intersection_result):
    rows=arcpy.SearchCursor(tabulate_intersection_result,sort_fields="PERCENTAGE D")
    row=rows.next()
    arcpy.AddMessage("%s--%s" %(row.getValue("EcoRegion_Field_Name_To_Report"),row.getValue("PERCENTAGE")))

Here you need to specify field name for your bioecoregions (i.e.,EcoRegion_Field_Name_To_Report) and your result will appear in the progress window.