Hi everybody, I hope you are all well!

I have an issue that I would need help about if possible.
I would like to use the GDAL Python bindings to reproject a TIFF that has an 
external nodata mask stored in a separate .msk file. Also, this is important to 
me to keep the jpeg compression.
After some tests, I found out that gdal.Warp does not reproject the .msk
Is there  a way to acheive what I am trying to do?

import os
from osgeo import gdal

IN_RASTER = os.path.join(r"C:\\", "data", "Ortho", 
"Ortho2024_32187_10cm_mask.tif")
OUT_RASTER = os.path.join(r"C:\\", "data", "Ortho", 
"Ortho2024_3857_10cm_mask.tif")

src = gdal.Open(IN_RASTER)

dst = gdal.Warp(
    OUT_RASTER,
    src,
    format="GTiff",
    dstSRS="EPSG:3857",
    creationOptions=["COMPRESS=JPEG", "PHOTOMETRIC=YCBCR", "TILED=YES", 
"BIGTIFF=YES"],
    callback=gdal.TermProgress_nocb
)

dst = None




[cid:ee2bb6c6-c1e9-4d52-95f5-652a02f428c8]



Maxime Demers

Analyste en géomatique

Service de la planification

et de la gestion du territoire

Tél. : 819 823-8000 poste 2360




_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to