[File] [PATCH] of Magdir/map for Garmin map subfiles

Christos Zoulas christos at zoulas.com
Tue Apr 30 04:02:18 UTC 2019


Committed, thanks!

christos

> On Apr 28, 2019, at 10:54 PM, Jörg Jenderek <joerg.jen.der.ek at gmx.net> wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> 
> Hello,
> 
> some days ago i run out of disc space on my Windows System. About
> 16 GB at c:\ProgramData\Garmin are occupied by Garmin Express, a
> software to update Garmin gps navigation devices. When i run file
> version 5.36 on downloaded maps are only described as "data".
> 
> So i add lines to Magdir/map. Unfortunately there exist no official
> documentation by Garmin, but some people have reverse engineered many
> aspects of that file format. This is information is found on wiki of
> street map. So add comment line like
> #https://wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin/IMG_File_Format
> 
> Many maps contain a 7 byte sequence containing the creation date. So i
> add a sub function to display this date in form like
> "yyyy-mm-dd h:mm:ss". This start with year and looks like
> 0	name				garmin-date
> # year like 2018
> ...
> # second (0-59)
>> 6	ubyte		x		\b:%.2u
> Then i replace in Magdir/map already existing garmin dates showing lines
> by call of sub routine like
>> 0x39	use		garmin-date
> 
> Characteristic for such Garmin sub file maps is the up cased phrase
> "GARMIN " near the beginning. That is first test line like
> 2	string	GARMIN\
> 
> At the beginning the header length is stored. That information is shown
> at the end by line like
>>> 0	uleshort	x		\b, header length 0x%x
> Because the size of the header is not large, this info can be used to
> distinguish maps from ASCII text file with GARMIN phrase by second test
> line like
>> 0	uleshort <0x1000	Garmin map,
> 
> After the Garmin phrase 3 up case letters are stored for different
> sub file. So according to
> wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin/GMP_Subfile_Format
> subtile of the larger area is indicated by GMP phrase. This is
> expressed by line
>>> 9	string	GMP				subtile
> File named extension is same as 3 character phrase. This is expressed
> by line
> !:ext			gmp
> Furthermore use this phrase as last part of user defined mime type,
> shown by line like
> !:mime			application/x-garmin-gpm
> 
> Often after the header something like a copyright message is stored.
> When available show this by line like
>>>> (0.s)		string		x	%s
> 
> Often offset and length of other section is stored inside sub maps, But
> that information is only of interest for developers and not normal
> users. So add such information lines as comment like for region one by
> lines like
> #>>>0x15			ulelong	       x	\b, at 0x%x
> #>>>0x19			ulelong	       x	0x%x bytes RGN1
> 
> After applying the above mentioned modifications by patch
> file-5.36-map-garmin-subs.diff then all such garmin sub map files are
> described by Magdir/map like:
> 
> 12EE3.TYP:                 Garmin map, types,
> 	created 2008-08-01 16:24:43, code page 1252, header length 0x5b
> CNEURONT.LBL:              Garmin map, labels UTF8,
> 	coding type 0x9, header length 0x2a9
> CNEURONT.MDR:              Garmin map, address table,
> 	header length 0x310
> CNEURONT.NET:              Garmin map, highways,
> 	header length 0x64
> CNEURONT.NOD:              Garmin map, routing,
> 	created 2018-07-23 21:43:57,
> 	header length 0x7f
> CNEURONT.RGN:              Garmin map, region,
> 	header length 0x7d
> CNEURONT.SRT:              Garmin map, sort table,
> 	created 2018-07-24 17:07:11,
> 	header length 0x25
> CNEURONT.TRE:              Garmin map, tree
> 	City Nav Europe NTU 2019.2
> 	Basemap Copyright 1995-2018 by GARMIN Corporation.,
> 	created 2018-07-23 21:43:57, ID 0x18a5df7,
> 	header length 0x135
> CNEuroNTU_2019_30_trf.trf: Garmin map, traffic,
> 	1st Preitenegg L606/L148,
> 	header length 0x5a
> I0001EA4.TYP:              Garmin map, types,
> 	created 2018-11-01 16:12:12, code page 65001,
> 	header length 0xae
> I18A600F.GMP:              Garmin map, subtile
> 	Copyright Garmin Ltd. or its subsidiaries.  All rights reserved.,
> 	created 2018-07-24 3:44:39,
> 	header length 0x3d
> garmin.txt:                ASCII text, with CRLF line terminators
> 
> 
> I hope my diff file can be applied in future version of
> file utility.
> 
> With best wishes
> Jörg Jenderek
> - --
> Jörg Jenderek
> 
> 
> 
> 
> 
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/
> 
> iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCXMZnSQAKCRCv8rHJQhrU
> 1q6CAJ48WMbnUjSQvlDxkSzZxYFcUpA2WgCg17iQPpgC6l/5hncGSQ73/MgH1oc=
> =RcCt
> -----END PGP SIGNATURE-----
> <file-5_36-map-garmin-subs_diff.DEFANGED-244><file-5_36-map-garmin-subs_diff_sig.DEFANGED-245>-- 
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file
> <sanitizer.log>



More information about the File mailing list