from rasterstats import zonal_stats
stats = zonal_stats("tests/data/polygons.shp",
"tests/data/slope.tif",
stats=['min', 'max', 'mean', 'majority', 'sum'],
all_touched=False,
)
start
{'min' : 0, 'max' : 5, 'mean' : 2.5, 'majority' : 4, 'sum': 42}