logo separator

[mkgmap-dev] Short mkgmap HowTo

From WanMil wmgcnfg at web.de on Mon Aug 1 20:58:24 BST 2011

> On 07/31/2011 11:37 AM, WanMil wrote:
>>
>>> I am embarrassed for not doing that much recently, and do not really
>>> feel entitled to ask this: How difficult would it be to write the
>>> address index information in the device format, eliminating the need for
>>> MapSource?
>> I don't know. Steve might be able to estimate how much work it will be
>> to fix that.
>> The work to do is to create a map including gmapsupp.img, install it in
>> Mapsource, upload it to the device and compare the mkgmap created
>> gmapsupp.img and the MapSource created gmapsupp.img. Probably that's
>> easy but the non easy part is to understand the differences...
>>
>>
>
> This should IMHO be the overall goal of the whole mkgmap project.

Agreed!

>
> I made a partial start on this last year. Steve supplied me with a pair
> of maps as described above: one straight from mkgmap and one after
> MapSource had been at it. Unfortunately, I just ended up too busy at
> work to be able to put any work into it. So as Marco said, I too am
> "embarrassed at not having done that much recently" :-(

Yes. I have started with the same procedure today.
The main work is to get the toolchain running:
1. Create a map with 2 small tiles using splitter and mkgmap
2. Install the map in MapSource
3. Create an environment so that it is easily possible to work with the 
display project

Once that has been done the work can start.

>
> However, as WanMil points out - understanding what MapSource does is
> tricky. Basically, MapSource changes some of the tables in the MDR
> files, shortening some and extending others. It creates a few new MDR
> tables of its own.
>
> There is a wiki recording the known format of the MDR file on
> "http://wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin/MDR_Subfile_Format" ,
> but Steve has done tons of work on MDR files over the last year or so
> that have not been documented in that wiki.
>
> It would be helpful if someone (not Steve - he's busy!) could get the
> documentation updated. I was doing my best on it before I got swamped
> last year. Not much has changed since then.

That's quite important although it's very much work to sort out the 
format from the source code and from the display outputs.

>
> The trouble is that it *seems* as if the header "flags" bytes in the MDR
> file tell the parser which options to expect on the matching data table.
> We don't know exactly what the flags are saying. When MapSource changes
> tables from what Steve's mkgmap had generated, it changes the flags, but
> we need to do some detective work to understand how the flags reflect
> the edits.
>
> We probably could get away in many case just copying the flags and
> structures that we see from MapSource, true understanding may not be
> needed immediately. But documentation *will* be needed (unless one sole
> enthusiast goes it alone) and a fair bit of experimentation will be
> inevitable.

I am not sure if the MDR description in the wiki is enough for 
development work. During development you need a lot of "maybe" variants 
where you can just guess parameters. We should find a common markup for 
such variants in the wiki.

>
> It's possible that MapSource makes changes to the other subfiles in the
> .img - I don't remember what I saw of that (if anything) last year.

I haven't seen that so far.
But MapSource creates a new .md2 file that does not have the common img 
format.

 From my point of view we should start with a better understanding and 
description of the MDR17 section. It's a section which is created by 
MapSource and has a tricky but manageable format.

Then start to code a simple MDR17 for small maps and the changes to 
other MDR sections for quite small maps (max 2 tiles, < 100 street 
names, < 10 cities, one country). Once we have a small map running we 
might be better able to expand the map size and the changes to the MDR 
sections.


I am not sure at the moment if we should create a MapSource MDR file and 
then convert it by mkgmap to the device MDR or should we directly create 
the GPS device MDRs? What do you think?

>
> Steve Hosgood.

WanMil



More information about the mkgmap-dev mailing list