(
    input,
    output,
    bidx,
    cogeo_profile,
    nodata,
    dtype,
    add_mask,
    blocksize,
    overview_level,
    overview_resampling,
    overview_blocksize,
    web_optimized,
    zoom_level_strategy,
    aligned_levels,
    resampling,
    in_memory,
    allow_intermediate_compression,
    forward_band_tags,
    threads,
    use_cog_driver,
    creation_options,
    config,
    quiet,
)
Create Cloud Optimized Geotiff.
Create Cloud Optimized Geotiff.
Create Cloud Optimized Geotiff .
def create(
    input,
    output,
    bidx,
    cogeo_profile,
    nodata,
    dtype,
    add_mask,
    blocksize,
    overview_level,
    overview_resampling,
    overview_blocksize,
    web_optimized,
    zoom_level_strategy,
    aligned_levels,
    resampling,
    in_memory,
    allow_intermediate_compression,
    forward_band_tags,
    threads,
    use_cog_driver,
    creation_options,
    config,
    quiet,
):
    """Create Cloud Optimized Geotiff."""
    output_profile = cog_profiles.get(cogeo_profile)
    output_profile.update(dict(BIGTIFF=os.environ.get("BIGTIFF", "IF_SAFER")))
    if creation_options:
        output_profile.update(creation_options)

    if blocksize:
        output_profile["blockxsize"] = blocksize
        output_profile["blockysize"] = blocksize

    if web_optimized:
        overview_blocksize = blocksize or 512

    config.update(
        dict(
            GDAL_NUM_THREADS=threads,
            GDAL_TIFF_INTERNAL_MASK=os.environ.get("GDAL_TIFF_INTERNAL_MASK", True),
            GDAL_TIFF_OVR_BLOCKSIZE=str(overview_blocksize),
        )
    )

    cog_translate(
        input,
        output,
        output_profile,
        indexes=bidx,
        nodata=nodata,
        dtype=dtype,
        add_mask=add_mask,
        overview_level=overview_level,
        overview_resampling=overview_resampling,
        web_optimized=web_optimized,
        zoom_level_strategy=zoom_level_strategy,
        aligned_levels=aligned_levels,
        resampling=resampling,
        in_memory=in_memory,
        config=config,
        allow_intermediate_compression=allow_intermediate_compression,
        forward_band_tags=forward_band_tags,
        use_cog_driver=use_cog_driver,
        quiet=quiet,
    )
def create ( input , output , bidx , cogeo_profile , nodata , dtype , add_mask , blocksize , overview_level , overview_resampling , overview_blocksize , web_optimized , zoom_level_strategy , aligned_levels , resampling , in_memory , allow_intermediate_compression , forward_band_tags , threads , use_cog_driver , creation_options , config , quiet , ) : output_profile = cog_profiles . get ( cogeo_profile ) output_profile . update ( dict ( BIGTIFF = os . environ . get ( "BIGTIFF" , "IF_SAFER" ) ) ) if creation_options : output_profile . update ( creation_options ) if blocksize : output_profile [ "blockxsize" ] = blocksize output_profile [ "blockysize" ] = blocksize if web_optimized : overview_blocksize = blocksize or 512 config . update ( dict ( GDAL_NUM_THREADS = threads , GDAL_TIFF_INTERNAL_MASK = os . environ . get ( "GDAL_TIFF_INTERNAL_MASK" , True ) , GDAL_TIFF_OVR_BLOCKSIZE = str ( overview_blocksize ) , ) ) cog_translate ( input , output , output_profile , indexes = bidx , nodata = nodata , dtype = dtype , add_mask = add_mask , overview_level = overview_level , overview_resampling = overview_resampling , web_optimized = web_optimized , zoom_level_strategy = zoom_level_strategy , aligned_levels = aligned_levels , resampling = resampling , in_memory = in_memory , config = config , allow_intermediate_compression = allow_intermediate_compression , forward_band_tags = forward_band_tags , use_cog_driver = use_cog_driver , quiet = quiet , )