Skip to content

Stacking all bands and saving as COG #202

Answered by remi-braun
guillemc23 asked this question in Q&A
Discussion options

You must be logged in to vote

I didn't know that driver was a used keyword when reading 🤔
I've purged it. It works for me. Could you try again (you may need to install tifffile library) ?

PS : you could also do:

# Create the reader
reader = Reader()

# Open your product
prod = reader.open(product_path, remove_tmp=True)
ok_bands = prod.get_existing_bands()
stack = prod.stack(ok_bands, **{TO_REFLECTANCE: False})

# Sertit (you may need to install `tifffile` library)
rasters.write(stack, "stack_COG.tiff", driver="COG", dtype="float32")
# or using directly 
stack.rio.to_raster("stack_COG.tiff", driver="COG", dtype="float32")

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
2 replies
@guillemc23
Comment options

@guillemc23
Comment options

Comment options

You must be logged in to vote
4 replies
@guillemc23
Comment options

@remi-braun
Comment options

@guillemc23
Comment options

@remi-braun
Comment options

Answer selected by guillemc23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants