Grid File Name Decorations

A considerable strength of Geosoft and Oasis montaj are the great number of supported grid file formats.  The IMG class in the GX API handles the creation, reading and writing of these formats.  Because different formats have different capabilities, the IMG class supports the use of decorations appended (in braces) to the actual grid file name.  Developers using the GX API can use these decorations to get the behaviour intended.

This appendix documents the grid file name decorations.

Each supported grid file type has a 3-letter identifier and a number or parameters that can be used to decorate the file name when accessing a file.  For example, to access the third band of a TM image in an ER Mapper image named "City.ers", you would decorate the name as follows:

                City.ers(ERM;band=3)

The first parameter in the decoration block is always the 3-letter grid type identifier, which must be supplied any time decorations are used.  If decorations are not used, the default grid type is taken from the DEFAULT_XGD parameter in the [MONTAJ] block of GEOSOFT.INI.

Each grid type also has a default input (BROWSE_IN) and output (BROWSE_OUT) decoration which is used by the browse tool in montaj to create default decorations.  If you always work with specific settings for a certain DAT type, you may wish to set the appropriate decoration in the INI file.  The BROWSE_IN and BROWSE_OUT options are specified for each DAT.



ARC   ArcView Binary Raster grid file

//--------------------------------------------------------------------------
// ARC   ArcView Binary Raster grid file (default file type .flt)
//
//    DUMMY       Dummy value used in the ArcView grid. By default this is
//                -9999.
//    BYTEORDER   =0 Most significant byte first
//                =1 Least significant byte first (default)
//    ORIGIN      Origin specification in the output header (.hdr) file.
//                =0 Use "xllcorner" and "yllcorner" : bottom left corner
//                   of the lower left cell (default)
//                =1 Use "xllcenter" and "yllcenter" : center of the lower
//                   left cell. (This is the normal Geosoft definition)
//                (This option ignored on input, as these values are read
//                  from the header file).
//    PIXEL=0     Continuous function data (default), displays smoothly
//    PIXEL=1     Pixel data, displays as grid cells.
//
// GEOSOFT.INI section
//
//    [DAT_ARC]
//    BROWSE_IN="ARC"
//    BROWSE_OUT="ARC"


ERM   Earth Resource Mapper

//--------------------------------------------------------------------------
// ERM   Earth Resource Mapper
//
//    BAND=      band to read/write, default band 0.  If band requested
//               is larger than bands contained in the file, the highest
//               band will be used.
//
//               If an image CellType is "Unsigned8BitInteger", and image
//               has exactly three bands, it is assumed to be an RGB
//               colour image.  To read individual bands, use the BAND=
//               parameter.
// 
//
//    COORDTYPE= RAW      - unknown right-handed cartesian.
//               EN       - eastings and northings.
//               LATLONG  - latitude, longitude.
//             
//               This parameter is only used if the ers file does not contain
//               a coordinate block.
//
//    TYPE=      COLOR     Colour output, with dummies.  This
//                         This is much slower that the PlugIn, but the
//                         BRT parameter is supported.
//
//               RGB       RGB only, no dummies.  Same as COLOR except that
//                         dummy areas will be white.
//   
//    BRT=       Brightness, 0.0 -> 2.0 (black -> white), default is BRT=1.0.
//
// GEOSOFT.INI section
//
//    [DAT_ERM]
//    BROWSE_IN="ERM"
//    BROWSE_OUT="ERM"


GRD   Geosoft grid file

//--------------------------------------------------------------------------
// GRD   Geosoft grid file
//
//    TYPE=    data type for new files: SHORT   2-byte signed integer
//                                      LONG    4-byte signed integer
//                                      FLOAT   4-byte floating point
//                                      DOUBLE  8-byte floating point
//                                      COLOR   4-byte RGBd colour
//                                      RGB     4-byte RGB, no dummy
//
//             If not specified, the TYPE parameter in the [DAT_GRD]
//             section of "DAT Setting" in the global settings is used.
//
//    For color grids, each grid element is 4-bytes, first byte red, second
//    byte green, third byte blue, and the fourth byte is a dummy flag.  If
//    the dummy flag is 0, the cell is transparent, otherwise the cell
//    should be coloured.  The following parameters are also meaningful
//    for color grids:
//
//    BAND=R      Red    band only
//    BAND=G      Green  band only
//    BAND=B      Yellow band only
//    BRT=        Brightness, 0.0 -> 2.0 (black -> white), default is BRT=1.0
//                This only works for colour grids.
//    DUMMY=r,g,b Dummy colour. Default is DUMMY=255,255,255 (white).
//                To disable dummy colour, enter "DUMMY=".
//    PIXEL=0     Continuous function data (default), displays smoothly
//    PIXEL=1     Pixel data, displays as grid cells.
//
// Compression:
//
//    COMP=NONE   Default - no compression of data.
//    COMP=SPEED  Compress grid data. Faster compression than "SIZE", but
//                produces a larger grid file.
//    COMP=SIZE   Compress grid data. Compresses better than "SPEED", but
//                takes longer.
//
//                Compression ratios can be improved by stripping insignificant
//                bits from the floating-point mantisa.  You can control this
//                by appending the numver of mantisa bits required to the
//                COMP=SIZE string.  For example, COMP=SIZE12 will produce
//                data to between 3 and 4 significant figures and achieve
//                much better compression.
//
//                  Mantisa   Significant   
//                  Bits      Figures    
//                  4         1          
//                  7         2          
//                  10        3          
//                  14        4          
//                  17        5          
//                  20        6          
//                  23        almost 7  (this is the maximum)
//                                  
//
// GEOSOFT.INI section
//
//    [DAT_GRD]
//    BROWSE_IN="GRD"
//    BROWSE_OUT="GRD"
//               "GRD;Type=Byte"
//               "GRD;Type=Short"
//               "GRD;Type=Long"
//               "GRD;Type=Float"
//               "GRD;Type=Color"


GPK   Geopak grid file

//--------------------------------------------------------------------------
// GPK   Geopak grid file
//
//    No other qualifiers.
//
// GEOSOFT.INI section
//
//    [DAT_GPK]
//    BROWSE_IN="GPK"
//    BROWSE_OUT="GPK"


GXF Grid eXchange file

//--------------------------------------------------------------------------
// GXF   Grid exchange file
//
//    COMP=    compression level:  -1 ASCII floating point (default)
//                                  0 ASCII integer
//                                  1 4   -bit data
//                                  2 8   -bit data
//                                  3 16  -bit data
//                                  4 32  -bit data
//                                  5 all data precision
//
//    DUMMY=   dummy value to use to represent dummy points in the grid.
//
// GEOSOFT.INI section
//
//    [DAT_GXF]
//    BROWSE_IN="GXF"
//    BROWSE_OUT="GXF;COMP=-1"
//               "GXF;COMP=0"
//               "GXF;COMP=3"
//               "GXF;COMP=4"
//               "GXF;COMP=5"


IMG   Image format files

//--------------------------------------------------------------------------
// IMG   Image format files (BMP,PCX,JPG,TIF,EPS,GIF,TGA etc...)
//
//    BAND=R      Red    band only
//    BAND=G      Green  band only
//    BAND=B      Yellow band only
//    BRT=        Brightness, 0 -> 2.0 (black -> white), default is BRT=1.0
//    PAGE=       Page number from a multi-page image.
//    SMOOTH=     0 - not smoothed, 1 - smoothed (default)
//    DUMMY=r,g,b Dummy colour. Default is DUMMY=255,255,255 (white).
//                To disable dummy colour, enter "DUMMY=".
//    T=          Image type: T=bmp   Bitmap
//                            T=eps   GeoTiffBitmap
//                            T=gif   GIFGeoTiff
//                            T=img   IMG
//                            T=jpg   JPEG
//                            T=pcx   PCX
//							  T=png	  PNG
//                            T=tga   Targa
//                            T=tif   Tiff
//
// GEOTIFF files are supported, but you should use the TIF DAT for GeoTIF files.
//
// If an ArcInfo world file (*.*w or .wld) is found in the same directory as the
// image file, the coordinate registration is read from that file.
//
// Coordinate registration can also be entered into an INI file with the same name
// as the image, but extension "ini".  The INI parameters are:
//
//    Image_Dat.X_Seperation=
//    Image_Dat.Y_Seperation=
//    Image_Dat.X_Origin=
//    Image_Dat.Y_Origin=
//    Image_Dat.Rotation
//
// GEOSOFT.INI section
//
//    [DAT_IMG]
//    BROWSE_IN="IMG;T=bmp"  Bitmap
//                   T=eps   GeoTiffBitmap
//                   T=gif   GIFGeoTiff
//                   T=img   IMG
//                   T=jpg   JPEG
//                   T=pcx   PCX
//				     T=png	 PNG
//                   T=tga   Targa
//                   T=tif   Tiff


SRF   Surfer grids

//--------------------------------------------------------------------------
//
// SRF   Surfer grids.
//
//    no parameters
//
// GEOSOFT.INI section
//
//    [DAT_SRF]
//    BROWSE_IN="SRF"
//    BROWSE_OUT="SRF"


TIF   GeoTIF images

//--------------------------------------------------------------------------
//
// TIF   GeoTIF images.
//
//    BAND=      band to read/write, default band 0.  If band requested
//               is larger than bands contained in the file, the highest
//               band will be used.
//
//    GEO=       0        - Standard TIFF
//               1        - GeoTIFF (default)
//
//    TYPE=      DATA     - if set, data is stored in the GeoTIF rather
//                          than colour.
//
//    COMP=      NONE     - Uncompressed
//               PACKBITS - Packbits compression
//               LZW      - LZW compresssion.
//                          This DAT can read LZW compressed grids, but it cannot
//                          write LZW compressed grids due to LZW license
//                          restrictions.
//
//    BRT=       Brightness, 0 -> 2.0 (black -> white), default is BRT=1.0
//
//    DUMMY=     r,g,b Dummy colour. Default is DUMMY=255,255,255 (white).
//               To disable dummy colour, enter "DUMMY=".
//
// GEOSOFT.INI section
//
//    [DAT_TIF]
//    BROWSE_IN="TIF"
//    BROWSE_OUT="TIF"


USG   USGS grids

//--------------------------------------------------------------------------
//
// USG   USGS grids.
//
//    DUMMY=   dummy value to use to represent dummy points in the grid.
//
// GEOSOFT.INI section
//
//    [DAT_USG]
//    BROWSE_IN="USG"
//    BROWSE_OUT="USG"


SAT   Binary satellite data 

//--------------------------------------------------------------------------
//
// SAT   Binary satellite data (BIP, BIL, BSQ)
//
//    Files of this type generally have a data file (with no extension)
//    and an accompanying header file.  Normally, you will choose the
//    header file and the data file is assumed to have the same name
//    without the extension.  If the data file has a different name,
//    you can use DATA= to specify the data file.
//
//    T=    Binary file type:
//
//    T=0   BIL with INI header (*.ini) (see below for INI doc)
//    T=1   EOSAT Fast Format (*.*)
//    T=2   EOSAT MSS (old 4 band BIL) (*.*).
//    T=3   Landsat MSS (4 band BSQ) (*.*)
//    T=4   BIL with *.hdr header (*.*)
//    T=5   ETOPO5 5' DEM (etopo5.*)
//    T=6   GTOPO30 30\" DEM (*.dem) and GLOBE 30\"DEM (*10*.)
//
//    DATA= to specify the name of the data file if it is not the same as
//          the header file without the extension.
//
//
//  The following is an example of an INI header file
//
//    [Sat_Dat]
//    COLUMNS=100             / Mandatory
//    LINES=100               / Mandatory
//    DATATYPE=IEEE4ByteReal  / Mandatory
//                            / one of:
//                            / Unsigned8BitInteger
//                            / Signed8BitInteger
//                            / Unsigned16BitInteger
//                            / Signed16BitInteger
//                            / Unsigned32BitInteger
//                            / Signed32BitInteger
//                            / IEEE4ByteReal
//                            / IEEE8ByteReal
//                            /
//    BANDS=1                 / Number of bands
//    HEADERSIZE=0            /
//    BANDLAYOUT=BIL          / BIP, BIL, or BSQ
//    BYTEORDER=LSBFirst      / LSBFirst (Intel) or MSBFirst (Motorola)
//    X_ORIGIN=0.0            /
//    Y_ORIGIN=0.0            /
//    X_SEPARATION=1.0        /
//    Y_SEPARATION=1.0        /
//    ROTATION=0.0            /
//    DUMMY=-1E+32            / dummy value
//    KX=1                    / 1  for bottom left origin
//                            / -2 for upper left origin
//                            / POSC Coordinate System:
//    CS_Name                 / name as "datum / transform"
//    CS_Datum                / datum_name[,major_axis,eccentricity,pm]
//    CS_Projection           / method,parameter1,parameter2,...
//    CS_Units                / unit_abbr,m/units
//    CS_Locdatum"            / local_datun,dx,dy,dz,rx,ry,rz,scale
//


DEM   USGS Digital Elevation Models

//--------------------------------------------------------------------------
//
// DEM   USGS Digital Elevation Models.
//  
//          This DAT id used for reading (not writing) USGS DEM (Digital Elevation Model)
//       files.
//
//       The "DATUM" decoration comes into play only in "old" format files, where
//       fields 16-29 are left blank. (Fields 16-29 provide the full datum definition
//       in newer format DEM files). If these fields are defined, then this decoration
//       is ignored.
//
//          DATUM=0 (default) Use NAD27 datum if elements 16-29 are blank (old format)
//                                     All USGS DEMs lacking elements 16-29.
//       DATUM=1           Use WGS 72 datum. (All NIMA and DTED DEMs where fields
//                                     16-29 are blank)


SDT   USGS SDTS 

//--------------------------------------------------------------------------
// SDT   USGS SDTS (Spatial Data Transfer Standard Mapping) DEM grids.
//
//    DUMMY       Dummy value used in the SDTS grid. By default this is
//                -32767, but we have seen an instance where it was -14593 (!?)
//                The SDTS standard also uses a fill value to pad grids to a
//                rectangle. This value is -32766, and is also replaced with
//                dummies on the import.