Garmin Tools

DEM Garmin subfile structure

 
We now know a lot about the pointers and variables in a DEM subfile .
 

Most of the file structure is now understood.:

 

  • Tile Boundaries are taken from TRE
  • min / max heights require to be calculated for each sub tile
  • These are defined in Block 2 generally at 0x29
  • The length of this block is obtained in the last DEM3 block
  • Height is encrypted into a stream ; pointers to the stream are found in DEM2
  • This stream is highly complex ; type of decoding depends on the min max values ;
  • The same value needs to be decoded differently depending on position in your list, ie
    5 can be represented as 00011 or 1111 or 01111 with some bits having a separarate significance, ie last one denotes if number is positive.
  • Height values for each tile are based on the minimum value for that tile .Bitstreams provide values which need to be added or subtracted from the previous height value ; if min value = 56m then the following values produce the following heights ; 2,4,-3,5,2,4 -> 58 62 59 64 66 70
  • Tiles are parsed following various codes 1 - 6 or higher, depending on elevation

You can attach your DEM subfile to the end of your IMG eventhough some of the blocks provide unexpected results.

How to show DEM maps in Basecamp

 

Add DEM sub files to gmap style maps which are placed in c:\programdata\garmin\maps
Basecamp will show 3d maps if it finds .dem files .

In Options,Display change the Elevation Exaggeration to perhaps 200% to make it more dramatic.

 

DEM plugin for Mapuploader 5

 

From ther main Menu click on DEM

 

1) Point to the .tdb file

2) Select the appropriate .hgt folder

3) Click 'Create DEM'

This adds the necessary DEM subfiles to each map, ie

Product1 -> 42182105
42182105.TRE
42182105.RGN
42182105.LBL
42182105.NOD
42182105.DEM

 

    OSM map with DEM on a Garmin GPS