DEM Index

Long name PCI DEM Index file
Short name index.txt
File extension(s) .txt

The DEM Index file is a text-format file that lists all DEM files or tiles in a source directory to be used for DEM processing. The DEM Index file is treated as a single virtual DEM, eliminating the need to merge the DEM tiles into a single file.

The GDB library supports the DEM Index file in text format for input only; GDB does not write to this format.

The DEM Index file (index.txt) and all the DEM tiles must meet the following conditions:
  • the first seven characters in the first line of the index file must be 'MAPUNITS'
  • all tiles must be in the same coordinate system
  • all tiles must be raster-aligned; that is, the geocoding for all tiles is defined so that all pixels fall on a common raster grid
  • all tiles must have the same size listed in the Column and Row numbers
  • all tiles must use the same data type
  • all tiles must be based on the same height datum
  • all tiles must use the same No Data value
  • all tiles must use the same elevation factor (ELFACTOR) value
Note: The current implementation supports only 8U, 16S, 16U, and 32R datatypes.

The following text shows an example of a DEM index file.

MAPUNITS       LONG/LAT D000
DATATYPE       16S
DBEC           1
BACKELEV       -32768.000
ELEVREF        MSL
ELEVUNIT       METER
ELFACTOR       0.000 1.000000000000
RES_XY         0.0008333333333333 0.0008333333333333
#Filename                ULX                    ULY                     LRX                   LRY
srtm_01_02.tif   -180.000416666676760    55.000416618227803   -174.999583333343420    49.999583284894470
srtm_01_07.tif   -180.000416690891140    30.000417247801863   -174.999583357557810    24.999583914468531
srtm_01_12.tif   -180.000416690891140     5.000416642442191   -174.999583357557810    -0.000416690891143
srtm_01_15.tif   -180.000416666676760    -9.999582994342006   -174.999583333343420   -15.000416327675339
srtm_01_16.tif   -180.000416666676760   -14.999583115413941   -174.999583333343420   -20.000416448747274
srtm_01_17.tif   -180.000416666676760   -19.999583236485876   -174.999583333343420   -25.000416569819208
srtm_01_18.tif   -180.000416666676760   -24.999583357557810   -174.999583333343420   -30.000416690891143
		  

The first eight lines of the file describe common values that apply to all images; they must be in the order shown in the example with no comments or blank lines between them. The remaining lines describe the image boundary records for all the images in the DEM tile data set. Comments (lines beginning with a #) are allowed in the DEM tile file list.

The format of the eight header lines is:
  • MAPUNITS: Specifies the EPSG projection code or PCI map units string for the coordinate system
  • DATATYPE: Specifies the data type of the files.

    Acceptable values are:
    • 8U
    • 8S
    • 16U
    • 16S
    • 32U
    • 32S
    • 32R
    • 64U
    • 64S
    • 64R
    Note: The current implementation supports only 8U, 16S, 16U, and 32R datatypes.
  • DBEC: Specifies the channel number for the input digital elevation model (DEM) elevation channel to be processed.

  • BACKELEV: Specifies the background elevation (NoData) value in the input DEM elevation layer.

  • ELEVREF: Specifies the vertical reference for the elevation values contained in the source DEM, or for the constant ELFACTOR value, if it is used.

  • ELEVUNIT: Specifies the units of the elevation values that are stored as pixel values in the input DEM, as specified either by FILEDEM or by the first entry in ELFACTOR.

  • ELFACTOR: If an input digital elevation model (FILEDEM) is specified, the value of this parameter is used to shift and scale the DEM pixel values to values in the units indicated by the value of the ELEVUNIT parameter.

  • RES_XY: Specifies the X and Y image resolution values.

Each line following the header lines is treated as either a comment line or as a raster tile description. Empty lines or those beginning with a # character are treated as comment lines. Each raster tile description line contains four parameters separated by white space:
  • DEM raster file name: path to the DEM raster file. This may be an absolute path or a relative path. A relative path is relative to the DEM index file itself.
  • Upper left X-coordinate: the x-coordinate at raster column location 0.0, raster row location 0.0
  • Upper left Y-coordinate: the y-coordinate at raster column location 0.0, raster row location 0.0
  • Lower right X-coordinate: the x-coordinate at raster column location 'numPixels', raster row location 'numLines', where numPixels and numLines are the dimensions of the raster.
  • Lower right Y-coordinate: the y-coordinate at raster column location 'numPixels', raster row location 'numLines', where numPixels and numLines are the dimensions of the raster.
Note: This description of the raster boundary provides coordinates at the outer extents of the pixels; in the case of butt-joined tiles, the tile records should indicate gap-free coverage.

As individual raster tiles are accessed, their properties are compared with the values listed in the DEM index file. If they do not conform to the indicated values, an error message appears in the log.

© PCI Geomatics Enterprises, Inc.®, 2024. All rights reserved.