<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Gerd</p>
<p>I think all the dem files from the very old GBTopo can only be
parsed up to a certain point</p>
<p>I've included 3 excmples with tre <br>
</p>
<p><span style="color: rgb(0, 0, 0); font-family: monospace;
font-size: 15px; font-style: normal; font-variant-ligatures:
normal; font-variant-caps: normal; font-weight: 400;
letter-spacing: normal; orphans: 2; text-align: start;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
text-decoration-style: initial; text-decoration-color: initial;
display: inline !important; float: none;"><a class="moz-txt-link-freetext" href="http://files.mkgmap.org.uk/download/362/00145336.zip">http://files.mkgmap.org.uk/download/362/00145336.zip</a></span></p>
<p><span style="color: rgb(0, 0, 0); font-family: monospace;
font-size: 15px; font-style: normal; font-variant-ligatures:
normal; font-variant-caps: normal; font-weight: 400;
letter-spacing: normal; orphans: 2; text-align: start;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
text-decoration-style: initial; text-decoration-color: initial;
display: inline !important; float: none;">Nick<br>
</span></p>
<br>
<div class="moz-cite-prefix">On 04/12/2017 15:02, osm@pinns wrote:<br>
</div>
<blockquote type="cite"
cite="mid:000fcdbc-5895-e000-26c7-941d94171762@pinns.co.uk">Hi
Gerd
<br>
<br>
Thanks for letting me know
<br>
<br>
That is probably why eventually it stopped with repeated plateau
len 64 messages on one of the dems builddemfile created
<br>
<br>
I have some 'old' non nt Garmin Topo maps with dem and will have a
go using your display.jar
<br>
<br>
r
<br>
<br>
Nick
<br>
<br>
<br>
<br>
On 04/12/2017 13:49, Gerd Petermann wrote:
<br>
<blockquote type="cite">Hi Nick,
<br>
<br>
I just found out that display tool can not yet read DEM tiles
with multiple zoom levels. Working on it now...
<br>
<br>
Gerd
<br>
<br>
________________________________________
<br>
Von: mkgmap-dev <a class="moz-txt-link-rfc2396E" href="mailto:mkgmap-dev-bounces@lists.mkgmap.org.uk"><mkgmap-dev-bounces@lists.mkgmap.org.uk></a>
im Auftrag von osm@pinns <a class="moz-txt-link-rfc2396E" href="mailto:osm@pinns.co.uk"><osm@pinns.co.uk></a>
<br>
Gesendet: Montag, 4. Dezember 2017 14:35:15
<br>
An: <a class="moz-txt-link-abbreviated" href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a>
<br>
Betreff: Re: [mkgmap-dev] DEM File Format and mkgmap
<br>
<br>
Many thanks Gerd
<br>
<br>
Will have a go at it today and let you know my findings, if any
!
<br>
<br>
Nick
<br>
<br>
<br>
On 04/12/2017 13:27, Gerd Petermann wrote:
<br>
<blockquote type="cite">Hi Nick,
<br>
<br>
My understanding is that the prediction starts with the values
from the header (min and max height in the tile)
<br>
The first row is indeed rather easy to decode. Frank has
described many more details in his pdf, and his program
<br>
seems to create valid DEM data since Basecamp displays it, I
just try to reduce the number of special cases now.
<br>
<br>
A compiled display.jar r505 is here:
<br>
<a class="moz-txt-link-freetext" href="http://files.mkgmap.org.uk/download/361/display.jar">http://files.mkgmap.org.uk/download/361/display.jar</a>
<br>
If you also download and unzip this mkgmap package
<a class="moz-txt-link-freetext" href="http://www.mkgmap.org.uk/download/mkgmap-r3997.zip">http://www.mkgmap.org.uk/download/mkgmap-r3997.zip</a>
<br>
you can run e.g.
<br>
java -cp display.jar;mkgmap-r3997\mkgmap.jar
test.display.DemDisplay 12345678.DEM > log.txt
<br>
<br>
I am interested in those files created by BuildDemFile which
create a run time exception. If you find one or more, I need
the original *.TRE file(s)
<br>
which were the input for BuildDemFile .
<br>
<br>
Gerd
<br>
________________________________________
<br>
Von: mkgmap-dev <a class="moz-txt-link-rfc2396E" href="mailto:mkgmap-dev-bounces@lists.mkgmap.org.uk"><mkgmap-dev-bounces@lists.mkgmap.org.uk></a>
im Auftrag von osm@pinns <a class="moz-txt-link-rfc2396E" href="mailto:osm@pinns.co.uk"><osm@pinns.co.uk></a>
<br>
Gesendet: Montag, 4. Dezember 2017 13:00:27
<br>
An: <a class="moz-txt-link-abbreviated" href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a>
<br>
Betreff: Re: [mkgmap-dev] DEM File Format and mkgmap
<br>
<br>
Hi Gerd
<br>
<br>
Presumably some hgt data gets stored in a tile from which
other data is
<br>
predicted? Perhaps the first 'row'?
<br>
<br>
Would be great if you could compile the DemDisplay.java so we
can do
<br>
ome testing as well.
<br>
<br>
I'm glad you are almost 'getting there'!
<br>
<br>
r
<br>
<br>
Nick
<br>
<br>
<br>
On 03/12/2017 11:16, Gerd Petermann wrote:
<br>
<blockquote type="cite">Hi all,
<br>
<br>
I think I understand now much more about this format. I used
Frank Stinners code for BuildDEMFile and his pdf to write a
decoder in the display tool.
<br>
I still fails to read some Garmin DEM files but seems to
work with the files produced by BuildDEMFile.
<br>
My current work flow is to generate DEM files with
BuildDEMFile and read them with my decoder. If the decoder
fails I can find out why because I can trace step by step
what BuildDEMFile does.
<br>
I guess that I did not yet hit all special cases identified
by Frank, but I am making good progress now, so I hope I'll
be able to start implementing a DEM encoder in mkgmap soon.
<br>
<br>
Reg. the format:
<br>
It is quite different to those used in other GARMIN sub
files like NOD, NET, RGN etc. In short: The data is
organized in tiles, typically 64*64 values. Instead of
storing each value
<br>
Garmin uses some statistics to predict the next value based
on the already processed values. This predicted value is
subtracted from the real value and only the delta is stored.
<br>
The better the prediction, the closer to 0 is the delta. The
prediction also calculates the error-probability of the
prediction and uses this to select the number of bits which
are
<br>
needed to store the value. If the delta is larger than
expected the so called BigBin encoding is used.
<br>
The format to store the delta is optimized for values close
to 0, so that many deltas are stored with only 1 or 2 bits.
<br>
A 2nd trick to save space is to use run length encoding for
repeated values.
<br>
So, the tricky part is to find out exactly how the
prediction algo by Garmin works.
<br>
Frank has done really great work here.
<br>
<br>
For those who want to try the display tool:
<br>
You have to compile on your own and you also need an
installed mgkmap.jar.
<br>
If that is available a command like this (replace d:\...
with your paths) should produce a large txt file:
<br>
java -ea -Xmx1000m -cp
d:\display\dist\display.jar;d:\mkgmap\dist\mkgmap.jar
test.display.DemDisplay test.DEM > dem_decode.txt
<br>
<br>
I am now searching for DEM files produced by BuildDEMFile
which are not properly processed by display tool. When it
fails you'll see a traceback like this
<br>
Exception in thread "main" java.lang.RuntimeException: did
not read all avalaible bytes
<br>
at
test.display.DemDisplay$DemTile.decodeBitStreamData(DemDisplay.java:532)
<br>
at
test.display.DemDisplay$DemSection.decodeBitstream(DemDisplay.java:831)
<br>
at
test.display.DemDisplay.readFileHeader(DemDisplay.java:887)
<br>
at
test.display.DemDisplay.print(DemDisplay.java:845)
<br>
at
test.display.CommonDisplay.display(CommonDisplay.java:171)
<br>
at
test.display.CommonDisplay.display(CommonDisplay.java:196)
<br>
at
test.display.DemDisplay.main(DemDisplay.java:903)
<br>
<br>
Gerd
<br>
_______________________________________________
<br>
mkgmap-dev mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a>
<br>
<a class="moz-txt-link-freetext" href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev">http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</a>
<br>
</blockquote>
_______________________________________________
<br>
mkgmap-dev mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a>
<br>
<a class="moz-txt-link-freetext" href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev">http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</a>
<br>
_______________________________________________
<br>
mkgmap-dev mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a>
<br>
<a class="moz-txt-link-freetext" href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev">http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</a>
<br>
</blockquote>
_______________________________________________
<br>
mkgmap-dev mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a>
<br>
<a class="moz-txt-link-freetext" href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev">http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</a>
<br>
_______________________________________________
<br>
mkgmap-dev mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a>
<br>
<a class="moz-txt-link-freetext" href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev">http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</a>
<br>
</blockquote>
<br>
_______________________________________________
<br>
mkgmap-dev mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a>
<br>
<a class="moz-txt-link-freetext" href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev">http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</a><br>
</blockquote>
<br>
</body>
</html>