mask_by_vector.py
def mask_raster(base_raster_path, vector_mask_path, target_raster_path):
    """Mask base by vector to target."""
    base_raster_info = geoprocessing.get_raster_info(base_raster_path)
    geoprocessing.new_raster_from_base(
        base_raster_path, target_raster_path,
        base_raster_info['datatype'], [base_raster_info['nodata'][0]])
    geoprocessing.mask_raster(
        (base_raster_path, 1), vector_mask_path,
        target_raster_path)
Mask base by vector to target.
Mask base by vector to target.
Mask base by vector to target .
def mask_raster(base_raster_path, vector_mask_path, target_raster_path):
    base_raster_info = geoprocessing.get_raster_info(base_raster_path)
    geoprocessing.new_raster_from_base(
        base_raster_path, target_raster_path,
        base_raster_info['datatype'], [base_raster_info['nodata'][0]])
    geoprocessing.mask_raster(
        (base_raster_path, 1), vector_mask_path,
        target_raster_path)
def mask_raster ( base_raster_path , vector_mask_path , target_raster_path ) : base_raster_info = geoprocessing . get_raster_info ( base_raster_path ) geoprocessing . new_raster_from_base ( base_raster_path , target_raster_path , base_raster_info [ 'datatype' ] , [ base_raster_info [ 'nodata' ] [ 0 ] ] ) geoprocessing . mask_raster ( ( base_raster_path , 1 ) , vector_mask_path , target_raster_path )
Mask base by vector to target.
Mask base by vector to target .
"""Mask base by vector to target."""
base_raster_path
vector_mask_path
target_raster_path