Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python zonale statictics on raster

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}
Source by pythonhosted.org #
 
PREVIOUS NEXT
Tagged: #Python #zonale #statictics #raster
ADD COMMENT
Topic
Name
8+4 =