Commit b2062a0c authored by Benjamin Pillot's avatar Benjamin Pillot
Browse files

Update _raster_mask function

* Use pyrasta built-in functions and methods
parent 9471622d
......@@ -20,7 +20,8 @@ def _mask(arrays, no_data):
return src
def _raster_mask(raster, geodataframe, driver, output_type, no_data, all_touched):
def _raster_mask(raster, geodataframe, driver, output_type, no_data, all_touched,
window_size, nb_processes, chunksize):
""" Apply mask into raster
"""
......@@ -33,11 +34,14 @@ def _raster_mask(raster, geodataframe, driver, output_type, no_data, all_touched
all_touched=all_touched)
return raster.__class__.raster_calculation([raster, mask],
partial(_mask, no_data=-1),
partial(_mask, no_data=no_data),
gdal_driver=driver,
data_type=output_type,
no_data=no_data,
description="Compute mask")
description="Compute mask",
window_size=window_size,
nb_processes=nb_processes,
chunksize=chunksize)
# with ShapeTempFile() as shp_file, \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment