Hi,
Do you suppose that the result would be two files:
"Ortho2024_3857_10cm_mask.tif"
"Ortho2024_3857_10cm_mask.tif.msk"

What the result is now? One file "Ortho2024_3857_10cm_mask.tif" with an 
internal mast band, or what?

-Jukka Rahkonen-

Lähettäjä: gdal-dev <gdal-dev-boun...@lists.osgeo.org> Puolesta Maxime Demers 
via gdal-dev
Lähetetty: maanantai 27. tammikuuta 2025 17.58
Vastaanottaja: gdal-dev@lists.osgeo.org
Aihe: [gdal-dev] using gdal.Warp to reproject a GTiff with an external nodata 
mask (.msk)

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:image001.png@01DB70E5.9C908420]



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