Skip to content
Snippets Groups Projects
Commit c1e5e54c authored by pascal.mouquet_ird.fr's avatar pascal.mouquet_ird.fr
Browse files

setting wright NoData value for JPEG2000

parent 941944c0
No related branches found
No related tags found
No related merge requests found
......@@ -159,6 +159,8 @@ def index_tiff_2_jp2(img_path: Union[str, pathlib.PosixPath],
logger.info("converting raw indice to JPEG2000")
src_ds = gdal.Open(str(img_path))
driver = gdal.GetDriverByName("JP2OpenJPEG")
for i in range(src_ds.RasterCount):
src_ds.GetRasterBand(i+1).SetNoDataValue(float(16383))
dst_ds = driver.CreateCopy(str(out_path), src_ds, options=['NBITS=15', 'CODEC=JP2', 'QUALITY=20'])
dst_ds = None
src_ds = None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment