logo separator

[mkgmap-dev] Distributing TYP files with mkgmap

From Marko Mäkelä marko.makela at iki.fi on Thu Nov 10 06:57:13 GMT 2011

First, I fully agree with you that frequently edited binary files are 
not suitable to be put under version control. There should be some 
textual source format that can contain comments (which will not make its 
way to the binary) and can be diffed.

On Wed, Nov 09, 2011 at 08:34:36AM -0500, Greg Troxel wrote:
>There isn't open source code to create TYP files from representations 
>that are reasonable to edit with free tools and store in version 
>control systems (and be diffable, etc.).

Depending what you mean by "reasonable to edit", it might be possible to 
use widely available general-purpose tools for this. Three alternatives 
spring to my mind: high-level scripting languages such as Perl, some 
assembler (NASM or gas), and rolling our own text-to-TYP converter in 

Perl is reasonably multi-platform, and it has awesome support for 
parsing and fiddling with binary data. Unfortunately, it is not 
installed on every platform by default. Assemblers are probably even 
less likely to be installed already (except on Unix-like systems), and 
an assembler source file would probably be too low-level. A custom 
converter could also allow icons to be read from some NetPBM-style 
textual representation (or separate image files, if desired).

Given that most OSM tools are based on Java, that probably leaves the 
Java text-to-TYP approach. It is not necessarily that hard to do. There 
exist free parser generator tools such as JFlex and ANTLR. It might be 
good to be compatible with some existing text file syntax, but it might 
also be sufficient if we maintain a matching TYP-to-text tool for 
importing existing TYP files and for diagnostics purposes.

>Have a style file that is aimed at this checked-in TYP, and use the 
>various perl programs (or probably easy to redo in java) to poke the 
>family id into the TYP.

In my opinion, the text-to-TYP converter should take the family-id as a 
command-line parameter.


More information about the mkgmap-dev mailing list