Created
March 1, 2020 13:52
-
-
Save tastatham/f21520a5f6dcb1e67ced8fe93d79d5cb to your computer and use it in GitHub Desktop.
Zonal statistics using dask_geomodeling
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import modules | |
from dask_geomodeling.raster import RasterBlock | |
from dask_geomodeling.raster import base | |
from dask_geomodeling.geometry import base | |
# Define paths | |
arg_rast_path = 'raster.tif' | |
arg_vec_path = 'vector.shp' | |
""" | |
# How do we define the blocks? | |
arg_ras = base.RasterBlock(arg_rast_path) | |
arg_vec = base.GeometryBlock(arg_vec_path) | |
""" | |
# Apply zonal statistics | |
geometry.aggregate.AggregateRaster(source=arg_vec,raster=arg_rast, column_name='sum', statistic='sum') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment