Re: [mkgmap-dev] [mkgmap-svn] Commit r572: MDR16 is some kind of codebook.

2021-12-26 Thread Gerd Petermann
Hi Ticker,

a few more patterns:
byte 4 seems to relate to the highest stat value in the rows with even stat 
values.
I see e.g 0x0f  and 0x1c or 0x0a and 0x1b. The formula: byte at 4 = highest /2 
+ 1

byte 6 (x) is related to the number of bytes (y) in the last block. (x = y * 2+ 
1)
I see e.g. 0x6b (107) and 53 bytes or 0x6d (109) with 54 bytes or 0x5d (93) and 
46 bytes.

Gerd


Von: mkgmap-dev  im Auftrag von Gerd 
Petermann 
Gesendet: Donnerstag, 23. Dezember 2021 20:53
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev]   [mkgmap-svn]Commit  r572:   MDR16   is  
somekindof  codebook.

Hi Ticker,

reg. "stat": my rule is a bit different but the result is the same:
for all odd values:
depth = usedBits = stat >> 1;

val is the 2nd byte.
for even stat values and rows where stat == val << 1 the decoder
has to read  exactly 1 more bit to decide which character was encoded.
I've not yet understood how the stat or the val field can be used to find the 
correct entry
in the byte array with the characters.

So, maybe the stat value should be shifted to the right to make some sense.

Gerd


Von: mkgmap-dev  im Auftrag von Ticker 
Berkin 
Gesendet: Donnerstag, 23. Dezember 2021 15:56
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev]   [mkgmap-svn]Commit  r572:   MDR16   is  
somekindof  codebook.

Hi Gerd

Maybe the "is always 8" is the character width.

I think I understand parts of it.

Read 5 bits and look up, giving 2 bytes.
if first 3/5/6/9/b the final char in the second byte and return (b-
first)/2 to the bit stream. Otherwise the combination somehow indicate
a minimum number of more bits to read and where to start searching.
maybe the 'struct for level' 1 or 2 bytes is a bit flag of which levels
to look in. I notice (in topo_fr) it is normally a single or adjacent
bits except for 0xa, but there are no chars at level 19

prefix 0 doesn't quite follow the rules

Ticker


On Thu, 2021-12-23 at 09:40 +, Gerd Petermann wrote:
> Hi Ticker,
>
> ouch, didn't even read that one :(  Would have saved me a lot
> of time as my first idea was a "jump table".
> Attached is the new patch and the corrected mdr16 outputs produced
> with this patch.
>
> So, besides the fields with ??? the only open question is the meaning
> of the struct bytes in the first table.
> I guess it will become clear when I try to use the lookup table in
> the decoder.
>
> Gerd
>
>
> 
> Von: mkgmap-dev  im Auftrag
> von Ticker Berkin 
> Gesendet: Donnerstag, 23. Dezember 2021 09:31
> An: Development list for mkgmap
> Betreff: Re: [mkgmap-dev]   [mkgmap-svn]    Commit  r572:
> MDR16   is  somekindof  codebook.
>
> Hi Gerd
>
> I guessed that it was the \0 that cut the file off.
>
> You mean something like answer 5 here:
>
> https://stackoverflow.com/questions/759707/efficient-way-of-storing-huffman-tree
>
>
> I looked at this earlier trying to work out if it was relevant but
> didn't make it fit - I should have tried harder.
>
> I still haven't spotted anything to determine the length of the 2 /3
> byte in before and in the struct for {length}
>
> Ticker
>
> On Thu, 2021-12-23 at 01:17 +, Gerd Petermann wrote:
> > Hi Ticker,
> >
> > sorry, just noticed that something went wrong with copy
> > because
> > of the \0 character.
> > Anyway, I think I understand the meaning of the part with the
> > prefixes.
> > I assume that Garmin reads the first 5 bits and uses this value as
> > an
> > index into a table
> > which directly follows the first array. This 2nd table is a 32x2
> > lookup
> > table, where the 2nd byte gives the value
> > and the first byte some kind of status info which is used to
> > position
> > the bit reader.
> > This would explain the repeating characters. Something like this:
> >
> > - MDR 16 (decompression codebook Huffman tree) 
> > 
> > -
> > 02b6 | 00 | 4a  | ???
>
>
> ___
> mkgmap-dev mailing list
> mkgmap-dev@lists.mkgmap.org.uk
> https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> ___
> mkgmap-dev mailing list
> mkgmap-dev@lists.mkgmap.org.uk
> https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] generated gmapsupp incompatible (?) with eTrex Legend

2021-12-26 Thread Gerd Petermann
Hi Jose,

sorry, I don't know how to help here. Maybe you can upload the two files to 
files.mkgmap.org.uk/
and we can check what the difference is.

Gerd


Von: mkgmap-dev  im Auftrag von 
jose1711 
Gesendet: Samstag, 25. Dezember 2021 23:34
An: mkgmap-dev@lists.mkgmap.org.uk
Betreff: [mkgmap-dev] generated gmapsupp incompatible (?) with eTrex Legend

hello,

i am using mkgmap to generate gmapsupp img from an osm file, then uploading it 
via serial connection to eTrex legend (b/w version). i noticed the following 
behaviour:

- gmapsupp file created by mkgmap does not always show in the device (sometimes 
even the map metadata is missing) or there are glitches (lines across the whole 
screen on some zoom levels)

- same file opens just fine in gpxsee (https://www.gpxsee.org/)

- if i open tdb and matching .img file in qlandkarte (no longer being 
developed), select submap and export to gmapsupp, the new file is larger and 
the issues after uploading to garmin device are gone

what sometimes helps (with file coming out of mkgmap) is uploading with a speed 
of 9600 bauds (as opposed to 115200).

here's an example:

- mkgmap gmapsupp.img - 302592 bytes

- qlandkarte gmapsupp.img (same map) - 786432 bytes

i was checking a diff but could not make out anything (too many differences). 
haven't tried older versions of mkgmap or checking out other tools yet.

could you please advise?

thank you,

jose


ps: i can share both map files if it helps in any way.
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] blank zoom levels - how to avoid?

2021-12-26 Thread Gerd Petermann
Hi Carlos,

not sure if I understand what you want to achive. The file mapset.mp contains 
only a few rectangles for the tiles in the map,
it typically contains no map data. So, there is nothing to display.
If you compute the map tiles with mkgmap you can also compute an overview map.

Gerd


Von: mkgmap-dev  im Auftrag von Carlos 
BJ 
Gesendet: Sonntag, 26. Dezember 2021 00:52
An: mkgmap-dev@lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] blank zoom levels - how to avoid?

Bear my slight knowledge of map formats and mkgmap...
Besides, I do not know where other place to write to ask for help...
Tried to find answers in the documentation but could not.

I have an IMG file that wish to "cut" to an specific region. My best
choice is to do it using Basecamp. So, I need to be able to load the
map in Basecamp.

I do it using GMaptool. Select the starting IMG, In Split I select
files for mapsource, compile preview map, create tdb v3 if possible.
GMaptools makes its magic, then calls mkgmap using:
"java -jar "C:\folder\mkgmap.jar" --no-tdbfile --mapname=29067263
--output-dir="G:/Outfolder" "G:/Workfolder/mapset.mp""

Now, I can instal the map and basecamp can show it but
a watermark with "Gmaptool preview" can be seen at the lowest left
corner - not an issue
no contents is shown at 500km zoom, neither 300, 200, 150, 100, nor
70; then, at 50kms, all is shown

So, I am ready to run from CMD the command
"java -jar "C:\folder\mkgmap.jar" --no-tdbfile --mapname=29067263
--output-dir="G:/Outfolder" "G:/Workfolder/mapset.mp"" but ... what
can I change so that all content is shown from the 500kms scale?
50kms is too close to be workable 

TIA
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev