[gdal-dev] NITF DES

Even Rouault even.rouault at spatialys.com
Tue Aug 24 09:50:14 PDT 2021


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
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210824/a5f0f63f/attachment.html>


More information about the gdal-dev mailing list