<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">Le 11/06/2024 à 12:11, Marek Setnik via
gdal-dev a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:47eef5f8504341f1b12c67a60f049585@obrum.pl">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
<div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;"
dir="ltr">
<p
style="font-family: Calibri, Helvetica, sans-serif, serif, EmojiFont; font-size: 16px;">
Hello!<br>
<br>
I'm having trouble with adding multiple TREs to a NITF file
(using C++ API), the documentation mentions that the TRE
creation options allows for that but I can't figure out the
syntax, how do I achieve something like this:
TRE=NAME1=VALUES1,NAME2=VALUES2 ? (I also tried to use TRE
creation option twice like so: -co TRE=NAME1=VALUES1 -co
TRE=NAME2=VALUES2, but the second TRE gets ignored)</p>
</div>
</blockquote>
<p>You need to specify the TRE=NAME=VALUE several times</p>
<p><br>
</p>
<p>$ gdal_translate byte.tif test.ntf -co TRE=NAME1=VALUES1 -co
TRE=NAME2=VALUES2</p>
<p>$ gdalinfo test.ntf</p>
<p>[...]<br>
</p>
<p>Metadata (TRE):<br>
NAME1=VALUES1<br>
NAME2=VALUES2<br>
</p>
<p><br>
</p>
<p>Using the C++ API, this would be something like:</p>
<p>char** options = NULL;</p>
<p>options = CSLAddString(options, "TRE=NAME1=VALUES1"); // Do not
use CSLSetNameValue() otherwise the second TRE would override the
first one<br>
options = CSLAddString(options, "TRE=NAME2=VALUES2");</p>
<p>GDALCreateCopy(hDrv, "out.ntf", src_ds, false, options, nullptr,
nullptr);</p>
<p><br>
</p>
<p>Even</p>
<span style="white-space: pre-wrap">
</span>
<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>