<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<p>Hello,</p>
<p>yes, first look:</p>
<p>- at the doc of the DES creation option in
<a class="moz-txt-link-freetext" href="https://gdal.org/drivers/raster/nitf.html#creation-issues">https://gdal.org/drivers/raster/nitf.html#creation-issues</a></p>
<p>- at
<a class="moz-txt-link-freetext" href="https://gdal.org/drivers/raster/nitf_advanced.html#data-extension-segments-xml-des">https://gdal.org/drivers/raster/nitf_advanced.html#data-extension-segments-xml-des</a></p>
<p>you will need to compose the DES segment in a relatively low
level.</p>
<p>Look at examples in :</p>
<p>-
<a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/blob/de6a6b44302be5c6a294d86f6ca35ebcdce563ff/autotest/gdrivers/nitf.py#L3728">https://github.com/OSGeo/gdal/blob/de6a6b44302be5c6a294d86f6ca35ebcdce563ff/autotest/gdrivers/nitf.py#L3728</a></p>
<p>-
<a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/blob/de6a6b44302be5c6a294d86f6ca35ebcdce563ff/autotest/gdrivers/nitf.py#L3795">https://github.com/OSGeo/gdal/blob/de6a6b44302be5c6a294d86f6ca35ebcdce563ff/autotest/gdrivers/nitf.py#L3795</a><br>
</p>
<p>Note: <span class="pl-s1">gdal</span>.<span class="pl-v"><span
class="pl-token"
data-hydro-click="{"event_type":"code_navigation.click_on_symbol","payload":{"action":"click_on_symbol","repository_id":6148317,"ref":"master","language":"Python","originating_url":"https://github.com/OSGeo/gdal/blob/master/autotest/gdrivers/nitf.py","user_id":1192433}}"
data-hydro-click-hmac="c60df112426765d60ee767c9bdce35f6a3497e54a9c8da54f36af7226b7aa64a">EscapeString</span></span>(<span
class="pl-s1">des_data</span>, <span class="pl-s1">gdal</span>.<span
class="pl-v">CPLES_BackslashQuotable</span>) with binary data
only works since a commit done yesterday in GDAL master!</p>
<p>If using an older version, backslash escaping can be done with :</p>
<pre>escaped_data = data.replace(b'\\', b'\\\\').replace(b'\0', b'\\0') \
.replace(b'\"', b'\\"').replace(b'\n', b'\\n')</pre>
<p>Best regards,<br>
</p>
<p>Even<br>
</p>
<div class="moz-cite-prefix">Le 24/08/2021 à 18:45, ni hao a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:DM5PR02MB3862B5625E13D88631E88486F1C59@DM5PR02MB3862.namprd02.prod.outlook.com">
<div>
Hi List,</div>
<div>
<br>
</div>
<div>
Is there a GDAL utility or Python code to delete/alter/write
to NITF Data Extension Segments (DES) ?<span></span></div>
<div>
<br>
</div>
<div>
Thanks.</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>