<div dir="ltr"><div class="gmail_default" style="font-family:arial,sans-serif">Patrik,</div><div class="gmail_default" style="font-family:arial,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,sans-serif">I have no objection to such a proposal, but in my experience with specific NITF based product profiles it is often not worth trying to support completely based on write support built into the GDAL drivers themselves. For producing NCDRD compliant NITF files our approach at Planet has been to produce many of the auxilary segments (TREs and DESs) in python code ourselves and then pass via the GDAL NITF TRE= and DES= creation options. We did of course have to have some core header field construction logic supported in the NITF driver, and JPEG2000 write support. </div><div class="gmail_default" style="font-family:arial,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,sans-serif">Anyways, depending on how complex you find your CADRG driver write support gets, you might want to consider doing parts of the work externally --- ideally as an example python or similar script that could be shared, and customized with others without having to implement full generalized write support within the drivers themselves. </div><div class="gmail_default" style="font-family:arial,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,sans-serif">Like Even I was surprised to see CADRG creation capability was still relevant in 2025. </div><div class="gmail_default" style="font-family:arial,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,sans-serif">I am curious if there are many folks out there with an interest in NCDRD compliant NITF production (and also SNIP production -- an upcoming project). I'm wondering if it would be worth a blog post, or perhaps a presentation at FOSS4G one day. I will offer I am happy to chat with folks going through similar projects.</div><div class="gmail_default" style="font-family:arial,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,sans-serif">Best regards,</div><div class="gmail_default" style="font-family:arial,sans-serif">Frank</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Jun 11, 2025 at 8:52 AM Patrik Sylve via gdal-dev <<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg-324597969723205145">
<div dir="ltr">
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi,</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
We are exploring the possibility of adding write support for CADRG format in GDAL and would appreciate some community feedback before starting implementation.</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
There is currently no open-source workflow for creating CADRG. GDAL can already read CADRG via RPFTOC/NITF drivers, so extending that work feels like a good next step.</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Short background on CADRG format:</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
CADRG is a Raster Product Format (RPF) that consists of a TOC file referencing data frames. Each data frame is stored as a National Imagery Transmission Format (NITF) message.</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
GDAL currently supports:</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
* Reading CADRG (a.toc) via the RPFTOC driver</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
* Reading individual CADRG frames via the NITF driver</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
* Writing NITF images, both without and with JPEG compression</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
<br>
</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
To implement a CADRG writer, we could extend the existing NITF and RPFTOC drivers:</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
NITF:</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
* Implement Vector Quantisation compression</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
* Add option to set Frame size</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
** A CADRG frame must be 1536x1536 pixels, so output would be tiled</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
* Add option to set CADRG scale</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
RPFTOC:</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
* Extend with 'write' mode</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
** Internally call NITF driver to generate CADRG compliant data frames</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
** Generate a .toc file per MIL-STD-2411</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Example usage, create a CADRG from a TIF-file:</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="line-height:19px;margin-left:40px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
gdal_translate input.tif ./RPF \</div>
<div style="line-height:19px;margin-left:40px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
-of RPFTOC \</div>
<div style="line-height:19px;margin-left:40px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
-co "PRODUCT=CADRG" \</div>
<div style="line-height:19px;margin-left:40px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<b> # NITF file header options</b></div>
<div style="line-height:19px;margin-left:40px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
-co "FTITLE=My CADRG Product" \</div>
<div style="line-height:19px;margin-left:40px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
-co "FSCLAS=U" \</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
...</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Output:</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
└── RPF/</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt">
<span style="color:rgb(0,0,0)">├─── a.toc</span></div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt">
<span style="color:rgb(0,0,0)">└─── frames/</span></div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt">
<span style="color:rgb(0,0,0)">├──── 00AVL01C.TL6</span></div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt">
<span style="color:rgb(0,0,0)">└──── 00AVM01C.TL6</span></div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
<br>
<br>
</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Drivers:</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
* <a href="https://gdal.org/en/stable/drivers/raster/rpftoc.html" target="_blank">https://gdal.org/en/stable/drivers/raster/rpftoc.html</a></div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
* <a href="https://gdal.org/en/stable/drivers/raster/nitf.html" target="_blank">https://gdal.org/en/stable/drivers/raster/nitf.html</a></div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Standards:</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
* CADRG: <a href="http://everyspec.com/MIL-PRF/MIL-PRF-080000-99999/MIL-PRF-89038_25371/" target="_blank">http://everyspec.com/MIL-PRF/MIL-PRF-080000-99999/MIL-PRF-89038_25371/</a></div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
* RPF: <a href="http://everyspec.com/MIL-STD/MIL-STD-2000-2999/MIL-STD-2411_6903/" target="_blank">http://everyspec.com/MIL-STD/MIL-STD-2000-2999/MIL-STD-2411_6903/</a></div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
<br>
</div>
<div style="line-height:19px;font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Would this be a welcomed addition? Any thoughts or feedback is appreciated.</div>
<div id="m_-324597969723205145Signature">
<div style="font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<p style="text-align:left;text-indent:0px;background-color:rgb(255,255,255);margin:0px">
<span style="font-family:Arial,sans-serif,serif,EmojiFont;font-size:12pt;color:black">Best regards / Vänliga hälsningar</span></p>
<div style="background-color:rgb(255,255,255);margin:0px">
<div style="background-color:rgb(255,255,255);margin:0px">
</div>
<div style="text-align:left;text-indent:0px;background-color:rgb(255,255,255);margin:0px;font-family:Arial,sans-serif,serif,EmojiFont;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<p style="text-align:left;text-indent:0px;line-height:19.2px;background-color:rgb(255,255,255);margin:0px">
<span style="font-family:Arial,Helvetica,sans-serif,serif,EmojiFont;font-size:14pt;color:rgb(0,0,0)"><b>Patrik Sylve</b></span></p>
<p style="text-align:left;text-indent:0px;line-height:19.2px;background-color:rgb(255,255,255);margin:0px">
<span style="font-family:Arial,Helvetica,sans-serif,serif,EmojiFont;font-size:12pt;color:rgb(0,0,0)">Software Developer</span></p>
<p style="text-align:left;text-indent:0px;line-height:19.2px;background-color:rgb(255,255,255);margin:0px">
<span style="font-family:Arial,Helvetica,sans-serif,serif,EmojiFont;font-size:9pt;color:rgb(200,38,19);line-height:17.6px"><b><br>
</b></span></p>
<p style="text-align:left;text-indent:0px;line-height:19.2px;background-color:rgb(255,255,255);margin:0px">
<span style="font-family:Arial,Helvetica,sans-serif,serif,EmojiFont;font-size:9pt;color:rgb(200,38,19);line-height:17.6px"><b>E:</b></span><span style="font-family:Arial,Helvetica,sans-serif,serif,EmojiFont;font-size:9pt;color:rgb(0,0,0);line-height:17.6px"><b> </b><a href="mailto:patrik.sylve@t-kartor.com" target="_blank">patrik.sylve@t-kartor.com</a></span></p>
<p style="text-align:left;text-indent:0px;line-height:19.2px;background-color:rgb(255,255,255);margin:0px">
<span style="font-family:Arial,Helvetica,sans-serif,serif,EmojiFont;font-size:9pt;color:rgb(200,38,19);line-height:17.6px"><br>
</span></p>
<p style="text-align:left;text-indent:0px;line-height:19.2px;background-color:rgb(255,255,255);margin:0px">
<span style="font-family:Arial,Helvetica,sans-serif,serif,EmojiFont;font-size:9pt;color:rgb(0,0,0);line-height:17.6px"><a href="http://www.t-kartor.com/" id="m_-324597969723205145LPlnk967518" title="Original URL: http://www.t-kartor.com/. Click or tap if you trust this link." rel="noopener noreferrer" style="margin-top:0px;margin-bottom:0px" target="_blank">www.t-kartor.com</a></span></p>
<p style="text-align:left;text-indent:0px;line-height:19.2px;background-color:rgb(255,255,255);margin:0px">
<span style="font-size:8pt;color:rgb(36,36,36)"><br>
</span></p>
<p style="text-align:left;text-indent:0px;line-height:19.2px;background-color:rgb(255,255,255);margin:0px">
<span style="font-family:"Open Sans",sans-serif,serif,EmojiFont;font-size:11pt;color:rgb(0,0,0);line-height:17.6px"><img id="m_-324597969723205145x_x_x_x_image_0" style="width: 182px; height: 32px; max-width: 780px; min-width: auto; min-height: auto; margin: 0px;" width="182" height="32" src="cid:ii_1975f5a13b5321473111"></span></p>
<p style="text-align:left;text-indent:0px;line-height:19.2px;background-color:rgb(255,255,255);margin:0px">
<span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:8pt;color:rgb(102,102,102);line-height:17.6px"><i>This e-mail is private and confidential between the sender and the
addressee. In the event of misdirection, the recipient</i></span></p>
<p style="text-align:left;text-indent:0px;line-height:19.2px;background-color:rgb(255,255,255);margin:0px">
<span style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif,serif,EmojiFont;font-size:8pt;color:rgb(102,102,102);line-height:17.6px"><i>is prohibited from using, copying or disseminating it or any information
in it. Please notify the above of any such misdirection.</i></span></p>
</div>
<div style="font-family:Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
</div>
</div>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</div></blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><font face="monospace">---------------------------------------+--------------------------------------<br>I set the clouds in motion - turn up | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a><br>light and sound - activate the windows | USA: +1 650-701-7823<a href="http://voice.google.com/calls?a=nc,%2B16507017823" rel="noopener" title="Call +1 650-701-7823 via Google Voice" target="_blank"></a><br>and watch the world go round - Rush | CAN: +1 343-550-9984</font></div></div></div></div></div>