You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I am translating a NITF file to NITF file I except the TRE information to be maintained.
It was noticed then anytime a run this translation I will lose my TRE information if I specify a -ot flag.
Even if I translate the NITF file to the same -ot of the original, the TRE information is still removed. If I specify no -ot flag the TRE information is maintained.
Steps to reproduce the issue
.\gdal_translate.exe .\input.ntf .\output.ntf -co IC=C8 -co JPEG2000_DRIVER=JP2OpenJPEG -ot Byte -> TRE information lost
.\gdal_translate.exe .\input.ntf .\out.ntf -co IC=C8 -co JPEG2000_DRIVER=JP2OpenJPEG -> TRE information maintained
Versions and provenance
Windows/Linux
GDAL 3.10
Additional context
No response
The text was updated successfully, but these errors were encountered:
Changing the output data type might invalidate metadata.
When you just do direct NITF -> NITF without options (but driver creation options), the NITF driver is able to retrieve information directly from the source NITF dataset.
When you use -ot, gdal_translate uses internally a VRT dataset, and out of caution doesn't preserve metadata, but a few safe metadata domains. You must keep in mind that gdal_translate is a generic tool that has no particular knowledge of NITF specificities.
For your use case, for the time being, you'd better use the Python/C++ API and manually se the metadata
Perhaps gdal_translate could have a new switch where the user could specify which metadata domains to preserve or all
rouault
changed the title
NITF losing all its TRE information when specifying an output type (-ot)
Adding an option to gdal_translate to preserve selected metadata domains (for example when changing data types)
Oct 8, 2024
I figured it had something to do with that, but yes the gdal_translate switch would be a nice addition.
Currently using the TRE creation options to pass in all the original TRE information to the gdal_translate call as a possible work around.
What is the bug?
When I am translating a NITF file to NITF file I except the TRE information to be maintained.
It was noticed then anytime a run this translation I will lose my TRE information if I specify a -ot flag.
Even if I translate the NITF file to the same -ot of the original, the TRE information is still removed. If I specify no -ot flag the TRE information is maintained.
Steps to reproduce the issue
.\gdal_translate.exe .\input.ntf .\output.ntf -co IC=C8 -co JPEG2000_DRIVER=JP2OpenJPEG -ot Byte -> TRE information lost
.\gdal_translate.exe .\input.ntf .\out.ntf -co IC=C8 -co JPEG2000_DRIVER=JP2OpenJPEG -> TRE information maintained
Versions and provenance
Windows/Linux
GDAL 3.10
Additional context
No response
The text was updated successfully, but these errors were encountered: