I'm using jp2 with no problem for reading and can create a copy with createcopy, but when I try to create jp2, it fails.
driver = gdal.GetDriverByName("JP2OpenJPEG") dst_ds = driver.Create("test.jp2",xsize=img.RasterXSize, ysize=img.RasterYSize,bands=1,eType=gdal.GDT_UInt16)
Same code but using GTiff driver works ok:
driver = gdal.GetDriverByName("GTiff") dst_ds = driver.Create("test.jp2",xsize=img.RasterXSize, ysize=img.RasterYSize,bands=1,eType=gdal.GDT_UInt16)
In the first case dst_ds is none, in the second one I get a correctly created dataset.
Note: img is another JP2 file opened without problem for reading.
Originally I was doing a createcopy, update some pixel values, doing a WriteArray, and flushing but I can see the changes reflected in de destination file, so I decide to create from scratch.
Is there a write limitation in the driver? I'm doing something wrong?
adding the code:
if(dst_ds is None): print(gdal.GetLastErrorMsg())
I'm getting the message: GDALDriver::Create() ... no create method implemented for this format.
It does not look good....