Hi Even, Thank you for your reply. Is there a simpler example to remove DES (say DES ID = 1) from an existing NITF, or replace DES with a null string?
________________________________ From: Even Rouault <[email protected]> Sent: August 24, 2021 1:50 PM To: ni hao <[email protected]>; [email protected] <[email protected]> Subject: Re: [gdal-dev] NITF DES Hello, yes, first look: - at the doc of the DES creation option in https://gdal.org/drivers/raster/nitf.html#creation-issues - at https://gdal.org/drivers/raster/nitf_advanced.html#data-extension-segments-xml-des you will need to compose the DES segment in a relatively low level. Look at examples in : - https://github.com/OSGeo/gdal/blob/de6a6b44302be5c6a294d86f6ca35ebcdce563ff/autotest/gdrivers/nitf.py#L3728 - https://github.com/OSGeo/gdal/blob/de6a6b44302be5c6a294d86f6ca35ebcdce563ff/autotest/gdrivers/nitf.py#L3795 Note: gdal.EscapeString(des_data, gdal.CPLES_BackslashQuotable) with binary data only works since a commit done yesterday in GDAL master! If using an older version, backslash escaping can be done with : escaped_data = data.replace(b'\\', b'\\\\').replace(b'\0', b'\\0') \ .replace(b'\"', b'\\"').replace(b'\n', b'\\n') Best regards, Even Le 24/08/2021 à 18:45, ni hao a écrit : Hi List, Is there a GDAL utility or Python code to delete/alter/write to NITF Data Extension Segments (DES) ? Thanks. _______________________________________________ gdal-dev mailing list [email protected]<mailto:[email protected]> https://lists.osgeo.org/mailman/listinfo/gdal-dev -- http://www.spatialys.com My software is free, but my time generally not.
_______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev
