I am currently trying to use zonal_stats of the rasterstats package to get zonal statistics of processed satellite images. The data is stored as .img-format and i have a shapefile containing 1 polygon to test things.
from rasterstats import zonal_stats IMG = 'S1A_IW_GRDH_1SDV_20181104T054742_20181104T054807_024434_02AD7C_F5E1_pre.data\\Ratio.img' SHP = 'Lake2.shp' stats = zonal_stats(SHP,IMG,stats = "*")
When I run the code I get the following error message:
AttributeError: 'rasterio._io.RasterReader' object has no attribute 'mask_flag_enums'
Does anyone know how I could work around this? Previously I used ArcPy to get this done but I do not want to use it in further projects since not everyone has access to it.