logo separator

[mkgmap-dev] 28 bit prec in DEM section header ?

From Gerd Petermann GPetermann_muenchen at hotmail.com on Sat Jan 20 09:11:57 GMT 2018

Hi DEM experts,

as Andrzej pointed out here [1] the Garmin maps seem to use 28 bit precision for some 32 bit values in DEM.

I tried to find out if that means that MapSource actually ignores the lower 4 bits of the values.
I've compiled two maps using --dem-dists=9942 for a tile created with split-file containing 
29000000: 2291022,918105 to 2297489,946049
OSM data contains
	<bounds minlat="49.1599988" minlon="19.700396" maxlat="49.2987657" maxlon="20.3000093"/>

One with original r4071, one with a change so that 9936 (0x26D0) instead of 9942 (0x26d6) is written to the DEM section header,
If MapSource would ignore the lower 4 bits all should produce the same results, but that is not the case.
Instead, the rectangle that contains DEM data is smaller with 9936, no height values are shown on the bottom and right side.
The effect is clearly visible when I change the value in the header to 9000 instead of 9942, hill shading ara shrinks.
Again: I only changed the value in the DEM header.

I tried something similar with the location of the top left corner. The results are not that clear. I change both top and left by 
the same value. It seems that Garmin ignores rather small changes.
-1000 : no effect 
-2000 : A large part of the map looks unchanged but there is a move of hill shading left from ~ E 19.75
-4000:  Like with -2000 I see the same changes on the left but also a small change at the very top.
-8000: all hill shading moves left and just a little bit up (!)
-16000: all hill shading moves left and down , no obvious change near E 19.75

+1000 :no visible change
+2000: all hill shading moves up
+4000: again there is a boundary near E 19.75, data to the left moves up and maybe a little bit to the left, data on the right moves up and more to the right
+8000: almost like with +4000, but small change on the bottom
+16000: all hill shading moves up+right, but maybe not exactly by the same amount 
+32000: all hill shading moves up+right, no obvious change near E 19.75

To be continued. With very large values parts of the map have no hill shading.
It is not that obvious to me how Garmin interprets the position values in the DEM header. Maybe one sees completely different results in other parts of the world or with larger maps
containing more tiles.
I guess that MapSources uses the position info to check if bbox of DEM data intersects bbox of tile, but there seems to be a complex rule
how it determines where to place the calculated hill shading data.
Maybe someone else finds a rule? 

[1] http://www.mkgmap.org.uk/pipermail/mkgmap-dev/2018q1/027818.html

ciao
Gerd


More information about the mkgmap-dev mailing list