logo separator

[mkgmap-dev] some findings about NT format

From Gerd Petermann gpetermann_muenchen at hotmail.com on Wed Feb 23 08:45:40 GMT 2022

Hi all,

I've identified a few more bytes following the road labels.
If there are labels there is always an additional byte array.
This starts with a length field (varying number of bytes).
First byte in the array is a flag byte, the lower 4 bits each indicate the existance of another byte array with length prefix.
Example:
buf=[1d, 07, 07, 04, 01, 39, 07, 04, 01, 5b, 09, 2a, f1, 46, 66]
1d == 29 -> length 14
07 flag byte
07 1st array length -> 3
array1=[04, 01, 39]
07 2nd array length -> 3
array2=[04, 01, 5b]
09 3rd array length -> 4
array3=[2a, f1, 46, 66]

The top 4 bits are probably also flags. I've not yet understood what they mean, each seems to flag the existence of further bytes, but the number of those bytes vary.
The flag byte might be 0:
buf=[03, 00]

array1 and array2 are more often found for major roads, but also on some minor ones. No idea yet what they mean.
I am pretty sure that array3 contains the house numbers, because this array never shows up on motorways.
Our code to read them doesn't (always) work. It seems to extract the base number correctly but then often fails.
So I guess Garmin has extended the format. Maybe Numbers like 1a,1b are supported now?
Another example:
buf=[11, 84, 09, 2a, 30, 00, 27, 02, 57]
11 (=17) -> length 8
84 flag byte : (only) array4 exists, and 0x80 is set
09 array4 length -> 4
array4=[2a, 30, 00, 27]
The remaining bytes x02,x57 are probably a flag and a counter (or id). The flag probably indicates if the counter fits into one or two bytes.
The counter itself simply increases for all roads with labels and the 0x80 bit in the flag byte set. No idea yet where this is used.

I'll soon have access to a Garmin Nüvi. I hope that allows me to load the map in Mapsource or Basecamp. Maybe this will tell me what
additional data we can find.

Gerd

________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Gerd Petermann <GPetermann_muenchen at hotmail.com>
Gesendet: Mittwoch, 16. Februar 2022 17:45
An: mkgmap-dev at lists.mkgmap.org.uk
Betreff: [mkgmap-dev] some findings about NT format

Hi all,

my findings so far which are not used / needed in GPXSee. Maybe it helps someone else:
- method linkLabel() could extract further road labels, bit 0x800000 flags the last of up to 4 labels.
- method linkLabel()  extracts a flag, the bit 0x08 in this flag seems to signal a tunnel. No idea yet what the other bits mean.
- the flags field in struct LinkInfo is used like this (netfile.cpp)
        bool firstIsShape = (linkInfo.flags >> 10) & 1;
        bool singleTopology = (linkInfo.flags >> 9) & 1;
        bool hasLevels = (linkInfo.flags >> 11) & 1;
My guesses about the meaning of the lower bits:
        //      int     road_speed = linkInfo.flags  & 7;
        //      bool oneway = (linkInfo.flags >> 3) & 1;
        //      int     road_class = (linkInfo.flags >> 4) & 7;

- The NET header can have two more sections, e.g. I see
00000684 | f6 cb 13 00             | NET5 ???, offset 13cbf6
00000688 | 96 0a 01 00             | NET5 ???, length 68246
0000068c | 23 00                   | ???
0000068e | 8c d6 14 00             | NET6 ???, offset 14d68c
00000692 | 28 05 00 00             | NET6 ???, length 1320
00000696 | 03 00                   | NET6 ??? record size 3
00000698 | 02 00 00 00             | ???

NET6 contains a list of offsets into NET4, they are in sorted order
and each offset points to the byte following the flag byte that is read in  linkLabel()
I see 440 recrods here, and 441 NOD6 records in the corresponding NOD file,
so they are obviously related (field blockIndexId).

I've not yet found where the address info like city name, zip name, and house numbers are
stored. Maybe that's in NET5.

I think in the old non-NT format there is no need to know NOD data to be able to read NET, so
I woulld expect that this is also possible with NT maps.

Gerd
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev at lists.mkgmap.org.uk
https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


More information about the mkgmap-dev mailing list