Skip to content

Switch to gdal_translate() #4

@kaimorquecho

Description

@kaimorquecho

I'm currently testing the output from the cog conversion when changing compression, predictor, overview_sampling etc. I ran into an issue that will likely change our current cog conversion script. Current script prints out:

Warning in x@cpp$writeRaster(opt) :
GDAL Message 6: driver MEM does not support creation option COMPRESS
Warning in x@cpp$writeRaster(opt) :
GDAL Message 6: driver MEM does not support creation option PREDICTOR
Warning in x@cpp$writeRaster(opt) :
GDAL Message 6: driver MEM does not support creation option BLOCKSIZE

So the creation options are ignored. Using gdal_translate() solved the warning.

gdal_translate( src_dataset = "/home/shares/wwri-wildfire/MEDS-2026/wri-data-processing/data/WRI_score.tif", dst_dataset = "/home/shares/wwri-wildfire/MEDS-2026/wri-data-processing/data/WRI_score_cog.tif", of = "COG", co = c( "COMPRESS=DEFLATE", "PREDICTOR=3", "BLOCKSIZE=512", "RESAMPLING=AVERAGE" ))
@rellimylime @FlukeAndFeather

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions