[Gdal-dev] gdal_merge: merge/mosaic NITF files

Even Rouault even.rouault at mines-paris.org
Fri Jan 9 13:41:45 EST 2009


Charles,

from the dimensions and size of your NITF tiles, I suppose they belong to a 
CADRG or CIB dataset. You will certainly find a file named A.TOC in an upper 
directory of your tiles. GDAL contains a driver called RPFTOC that is able to 
deal with such files. You can do a gdalinfo on it and it will report a list 
of subdatasets. (see http://gdal.org/frmt_various.html#RPFTOC). Each 
subdataset can be seen as the mosaicing of a subset of the NITF tile and can 
be used easily to mosaic them into a GeoTIFF like

gdal_translate NITF_TOC_ENTRY:CADRG_GNC_5M_1_1:GNCJNCN/rpf/a.toc dest.tif

CADRG products use a very particular compression scheme, named vector 
quantization, that is very efficient (a block of 4x4 pixels is compressed 
into 12 bits) but at the expense of the usual poor quality of CADRG products.
It is not supported by the GDAL NITF driver in creation mode.

With GeoTIFF DEFLATE compression, you will get images about 4 times larger 
than the NITF original tile.

Best regards,
Even

Le Friday 09 January 2009 00:31:41 Charles Chung, vous avez écrit :
> Hi all, I am new using GDAL and raster format. Here is my situation.
>
> With GDAL 1.6.0dev, I want to merge or mosaic many NITF files into one NITF
> or GeoTIFF file.
>
> Each NITF file is about 284 KB and its characterists are:
>
> Driver: NITF/National Imagery Transmission Format
> Files: ???????.???
> Size is 1536, 1536
> ...
> Pixel Size = (0.000059486040609,-0.000044956841432)
> ...
> Band 1 Block=256x256 Type=Byte, ColorInterp=Palette
>
> If I use "gdal_merge" with one NITF input file and default settings, the
> default output is GeoTIFF and the size is 2,316 KB.  That's 8 times bigger
> in size even though I used only one input file.  If I output to NITF
> format, the size is also 8 times bigger.  If I merge two NITF files the
> output is about 16 times bigger.
>
> Why the output file size is so much bigger than the input file?  Is there
> settings to make it smaller?
> Basically I want the size of merged files to be about the same size as the
> sum of input file size.
>
> Thank you.
>
> Charles




More information about the gdal-dev mailing list