Solved! Go to Solution.
buffers_path = "path\to\buffers" clipped_land_use = "path\to\clipped\land\use" land_use_fl = arcpy.MakeFeatureLayer(clipped_land_use,"lu") for row1 in arcpy.SearchCursor(buffers_path): oid = str(row1.getValue("OBJECTID")) area1 = row1.getValue("SHAPE_area") #presumably, this will be the same for each feature, because you have a standard buffer distance name = #get a name value from one of the fields if you want print name if arcpy.Exists("fl"): arcpy.management.Delete("fl") fl = arcpy.management.MakeFeatureLayer(buffers_path,"fl",'"OBJECTID" = "+oid) arcpy.management.SelectLayerByLocation(land_use_fl,"INTERSECT",fl,"","NEW_SELECTION") #now iterate through the selected clipped features and print the info for row2 in arcpy.SearchCursor(land_use_fl): area2 = row2.getValue("SHAPE_area") use = #get the land use type from whatever field it's in percent = area2*100/area1 print " {0}: {1}%".format(use,str(percent))
Here's the first strategy that comes to mind:
1. Use feature classes in a file geodatabase so every feature has its area automatically calculated
2. Make sure the data is in a projection with a meaningful unit of measure (e.g. meters, not degrees).
3. Clip the land use polygons to the buffer feature class.
4. Iterate through the features in the buffer feature class, selecting each one and using that selection to select the overlapping, clipped landuse polygons in order to get the area values from them and calculate the percentages. Ok, something like:buffers_path = "path\to\buffers" clipped_land_use = "path\to\clipped\land\use" land_use_fl = arcpy.MakeFeatureLayer(clipped_land_use,"lu") for row1 in arcpy.SearchCursor(buffers_path): oid = str(row1.getValue("OBJECTID")) area1 = row1.getValue("SHAPE_area") #presumably, this will be the same for each feature, because you have a standard buffer distance name = #get a name value from one of the fields if you want print name if arcpy.Exists("fl"): arcpy.management.Delete("fl") fl = arcpy.management.MakeFeatureLayer(buffers_path,"fl",'"OBJECTID" = "+oid) arcpy.management.SelectLayerByLocation(land_use_fl,"INTERSECT",fl,"","NEW_SELECTION") #now iterate through the selected clipped features and print the info for row2 in arcpy.SearchCursor(land_use_fl): area2 = row2.getValue("SHAPE_area") use = #get the land use type from whatever field it's in percent = area2*100/area1 print " {0}: {1}%".format(use,str(percent))
I haven't tested this code, so there may be a bit of trouble shooting and configuring to do, but it should serve as a decent outline.
I only have 10.0, which is why I'm not using da.SearchCursor(), but this should work fine in 10.1/10.2 as well.
Glad to hear that was helpful! Be sure to mark the question as answered if you are satisfied. Good luck!