logo separator

[mkgmap-dev] Text format for TYP files

From Marko Mäkelä marko.makela at iki.fi on Sun Jan 17 10:40:11 GMT 2010

Hi Greg,

Last night, I wrote:
>> We could do that, but I just got another idea: I will create a simple
>> TYP file with http://ati.land.cz/gps/typdecomp/ and try to decompile
>> it by hand into source file(s) that would be compiled with GNU Assembler
>> to the TYP file.  That should be enough for my immediate needs, to define
>> some line styles.  I will probably need a couple of weeks for that.

On Sat, Jan 16, 2010 at 07:47:30PM -0500, Greg Troxel wrote:
> That might work, if the format is regular enough.  You're writing the
> code, but my first inclination is to define xml for the TYP file and
> write something that uses an xml parser to an in-memory structure and
> the write out the bits.

That is of course a possibility.  Using XML and Java would have the benefit
that mkgmap is are already using them.

Would XSLT be able to cut the mustard?  According to
http://www.oreillynet.com/xml/blog/2008/06/xslt_and_binary_file_formats_1.html
it might be.

I would rather choose a well-known tool that can represent the TYP file
with minimum hassle.  The assembler could be replaced with something
else later.  Well, you will see once I have some code to present.

On Sat, Jan 16, 2010 at 07:48:57PM -0500, Greg Troxel wrote:
> That compiler is now under a BSD license, so I wonder about just making
> it into a regular program instead of a cgi.

Have you tried using the source code?  I tried, but failed.  It does not
even claim to be the entire program.  The web interface is deliberately
missing.  The code seems to implement a transformation from in-memory
data structures to textual and binary TYP formats, in the methods as_string
and as_binary.  The constructors seem to be taking the binary TYP in the
$raw_data parameter.  I have done some Perl programming in the past, but
I have never written object-oriented Perl.  It would be easier to work with
the code if there were more comments or if I knew some Chech.

Best regards,

	Marko



More information about the mkgmap-dev mailing list