Subsections

General File Formats

If your file format is not supported by InfoPACK, but you can describe how the data is laid out within the file, then GDAL supports two different methods for reading the data.

Using a .aux file

The first method is a partial implementation of the PCI .aux labelled format. For this, a text file with the file extension aux is created which describes the image layout, for example:

AuxilaryTarget: out.raw
RawDefinition: 512 512 1
ChanDefinition-1: 8U 0 1 512 Swapped
UpLeftX: 440720.000
UpLeftY: 3751320.000
LoRightX: 471440.000
LoRightY: 3720600.000

All PCI data types (8U, 16U, 16S, and 32R) are supported. Currently georeferencing, projections, and other metadata is ignored.

The implementation of GDAL allows for read, write and creation. To open a PCI labelled file, select the raw data file itself. The .aux file (which must have a common base name) will be checked for automatically.

For more details of the PCI aux format see
http://www.remotesensing.org/gdal/frmt_various.html

Using a virtual file

A second approach to describing your file format would be to create a virtual file. For example a vrt file with two bands that happen to both come from band one of another file would be:
<VRTDataset rasterXSize="512" rasterYSize="512">
   <VRTRasterBand dataType="Byte" band="1">
     <SimpleSource>
       <SourceFilename>utm.tif</SourceFilename>
       <SourceBand>1</SourceBand>
       <SrcRect xOff="0" yOff="0" xSize="512" ySize="512"/>
       <DstRect xOff="0" yOff="0" xSize="512" ySize="512"/>
     </SimpleSource>
   </VRTRasterBand>
   <VRTRasterBand dataType="Byte" band="2">
     <SimpleSource>
       <SourceFilename>utm.tif</SourceFilename>
       <SourceBand>1</SourceBand>
       <SrcRect xOff="0" yOff="0" xSize="512" ySize="512"/>
       <DstRect xOff="0" yOff="0" xSize="512" ySize="512"/>
     </SimpleSource>
   </VRTRasterBand>
</VRTDataset>

File Import Utility

If the built-in import facilities do not cover your file format you can use the general conversion routine raw2nc.py provided to convert your images into NetCDF format. This routine is described in detail in Section B.3.14. There is also an export routine nc2raw.py. To use raw2nc.py you will need to specify:

-l n
The number of image layers (default 1)
-tC
the type of data in the raster file There are eight recognised types:
option -t l
default integers (signed)
option -t 1
Int0, Int8 (signed)
option -t s
2-byte integers Int16 (signed)
option -t i
4-byte integers Int32 (signed)
option -t d
Float, Float64
option -t f
Float0, Float8, Float16, Float32
option -t F
Complex0, Complex8, Complex16, Complex32
option -t D
Complex, Complex64
-b
Byteswap.

Depending on how your images are constructed, it is possible that you will need to reverse the order of the bytes. To see whether this is the case, we suggest you load the converted image into the viewer and use the Image Statistics menu button to check that the values it reports look sensible; if not, you probably need to swap the byte order.

If you do need to swap the byte order, include the -b flag.

option -s
reverse the byte order.
-width=nw -height=nh
The image size.

The dimensions in the image are measured in pixels.

option -width
the number of pixels per row of the image

option -height
number of rows in the subimage (you can import only some of the rows)

InfoSAR Ltd