[GIS] Selecting raster data by location: for raster and feature class data

arcgis-10.2arcgis-desktoparcpyoverlayraster

I have rasters covering certain spots in my environment, I'm looking for a way to extract the values which occur at locations which are defined by a selection of feature layers. I've tried with the SelectLayerbyLocation tool (from ArcMap 10.2 (advanced license)), which seems to do the right thing, but not for this type of data. Does anybody have experience with this or recommendations for tools to use?

Currently it is set up like this:

arcpy.SelectLayerByLocation_manager('codist_{0}'.format(FIDa), "INTERSECT", out_flab).save(overlap) #find out if villages overlap with cost layers

where 'codist_{0}'.format(FIDa) is the raster (FIDa a list of values), and out_flab is the feature layer extracted from a table using a cursor in previous steps. Ultimately I need to find the minimum value within the rasters at the zones defined by the feature classe (so the values of the raster cannot be altered by this operation)

Best Answer

The Zonal Statistics tool should allow you to 'mix' raster and vector data. You can define your zones based on feature layer polygons to get the statistics of the raster.

There is also the Zonal Statistics as Table tool which outputs a table instead of a raster.