<div dir="ltr">When I worked for NGA, I had software that took an input GeoTIFF image and output the RPF files.  A separate program was used to create the a.toc file.<div><br></div><div>The process is not trivial. The vector quantization compression is not simple.</div><div><br></div><div>At one time, ERDAS took the RPF code and incorporated it into their software.</div><div><br></div><div>I retired several years ago, and I am not sure what happened to the software.</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Jun 11, 2025 at 7: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-8265728890323133116">




<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_-8265728890323133116Signature">
<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_-8265728890323133116LPlnk967518" 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_-8265728890323133116x_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_197600519b7321473111"></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>