KAS Software

Suppliers of map viewing and coordinate conversion software, bespoke digital maps, height data and gazetteers

gdf format

The gdf (gridded-data-file) format was initially developed by KAS Software as a means of storing raster map data in a manner that allows for quick determination of the file contents, easy access to any part of the map data, and the ability to store large volumes of data in a flexible manner. It was later expanded to allow for the storage of gazetteer and coordinate transformation tabular data, and then further extended to allow the storage of maps in a format suitable for LOD (Level of Detail) 3D display.

The genesis of gdf was in 2006 after the inherent problems of using a purely binary map header became too troublesome to perservere with. In brief, when a fixed length header format is used, it is a laborious pain to add new functionality and it becomes hard to maintain backwards compatibility. In 2006 then gdf was first introduced, but only on a small-scale and entirely in-house at a time when little mapping work was being undertaken. The first public release was in 2011, since which time it has been the sole map data format employed by KAS Software Ltd.

Example - Elevation Data File

To reiterate, the requirements of gdf were:

  • quick determination of the file contents
  • easy access to any part of the stored map/whatever data
  • support various data formats - JFIF, PNG, 8-bit colour map, elevation data, gazetteer data & other tabular or gridded data
  • ability to store large volumes of data

To determine quickly what the file contains, the first part of the file is an ASCII header which can be quickly studied using tools such as the Unix® more (or less) command. Without going into detail about the meanings of each field, the header consists of a few thousand characters of data that can be easily parsed and has similarities in layout to Windows INF and INI files (though comments are handled differently).

gdf V1.1

# ***********************************************************************
# File:    
#
# Copyright (c) 2016 KAS Software Ltd, Highland, Scotland.
#  (Gridded-data file format v1.1 - 7th March 2012)
#
# Contains Ordnance Survey data (OS_OpenData)
#     (c) Crown copyright and database right 2015.
# Use of OS OpenData is subject to the terms at:
#     http://www.ordnancesurvey.co.uk/opendata/licence
#
# File Created: 25/06/2016 11:44:43
#
hdrTextLen = 3328
hdrLen = 70784

#
# Tiled height data
#
fileType = gridded_height:tiled

[GENERAL]
  fileSize = 129650882
  description = "OS Terrain 50 (2015)"
  fileCreator = KAS Software Ltd, Scotland. June 2016
  origFileName = osgb_terrain50_2015.ksd
  dataOriginator = OS_OpenData
  dataInfo = OS OpenData (c) Crown copyright and database right 2015.
  dataRelease = OS_OpenData/os_terrain,Jul 2015
  timeStamp = x576e5fda              # 25/06/2016 11:41:30 (193s)
  seqNo = x295252b0


[RASTER HEIGHT MAP]
  hgtType = OSGB Hgt 50m
  crsId = EPSG:27700                 # British National Grid
  hgtDataType = LE_16                # Little-endian 16-bit (signed) data
  hgtUnits = Metres
  hgtRange = -119.8/1345.4           # In height units
  hgtScaleFactor = 10                
  hgtNoDataValue = -999

  areaUnits = Km2
  coverage = 285800                  # Approx. (Km2)

  Info:nativeScale = 1:500,000
  Info:centre = NT 40025 20025 (27700: 50.0000 x 50.0000 (0.000%))
  Info:pixelExtent = 13600x24800


[RASTER DATA SEGMENT:1]
  {POSITION CALC INFO}
    posnCalcType = Linear
    tiePointXY = (0,0):(25,25)
    origin = BOTTOM-LEFT
    pixelScaleXY = 50,50
  {/POSITION CALC INFO}

  {TILES}
    blockOrigin = BOTTOM-LEFT;ROW-MAJOR
    blocks = 68x124                  # 8432
    ppb = 200x200                    # 40000
    blockSize = 80000                # 200x200x2
    blockDataType = LE_16            # Little-endian 16-bit (signed) data
    blockDataOrigin = BOTTOM-LEFT;ROW-MAJOR
    blockDataCompression = INFLATE
    blockOffsetsFmt = BIG-ENDIAN,offset:5,size:3
    blockOffsetsStart = 3328         # 0x0d00
    blockOffsetsSize = 67456
    blockDataStart = 70784           # 0x11480
    blockDataSize = 129580098
    Info:maxBlockSize = 69920        # (87.4% of 80000)
    Info:usedBlocks = 2858           # (33.9% of 8432)
  {/TILES}
[/RASTER DATA SEGMENT:1]

[CHECKSUM]
  crcOffset = 2382
  headerCRC = 0x713f5834
  md5Offset = 2426

/***********************************************************************
 *      ( ( (                                                          *
 *       ) ) )                                                         *
 *       ( ( (  -- End of <osgb_terrain50_2015.ksd> header --          *
 *     '. ___ .'                                                       *
 *    '  (> <)  '                                                      *
 *****ooO*(_)*Ooo*******************************************************/
[END]

[ /GDF_HEADER ]

	 

What follows after the header is a series of pointers (file offsets) to the map data as outlined within the gdf header. The map data is itself usually compressed using any of a number of standard compression algorithms (such as bzip2, inflate/deflate, JFIF, RLE, ...). Overall if provides a very flexible means for the storage and retrieval of map-related data.

Have a peek at further examples, such as the sample height file, map file and gazetteer file gdf header info.

For further details, simply contact info@KASsoftware.com

map viewing software

The mapView map viewing software is free for private use and with full searchable gazetteer functionality, GPS connectivity, and full printing support, it's a comprehensive map display application. Please email info@KASsoftware.com with any comments.

gdf format

This open, scaleable, gridded-data-file format developed in-house provides for storage of large volumes of raster data in a single file - easy to read, easy to debug. Have a peek at sample height file, map file and gazetteer file gdf header info.

About KAS Software

KAS Software Ltd provides Mapping consultancy, software development and troubleshooting services, for Linux/Unix and Win32.

Download our free Windows map viewer




(c) KAS Software Ltd, 31st July 2016

Contact us
by Phone:
by Mail: info@kassoftware.com
KAS Software Ltd
Company history

Established 1997
Registered in Scotland

Useful links

Links you may find useful ...
· OS OpenData
· data.gov.uk
· Google Maps
· OS Open Space

Design & Sponsors
template design
mediatac suchmaschinenoptimierung
template sponsored by
schuhe guenstig & stiefel online

Free Visits Counter