mkgmap multiple input file

mkgmap documentation states:
–input-file=filename
Read input data from the give file. This option (or just a filename) may be given more than once.

Since I have a lot of problems to split Europe data I have tried to create a map from 2 layers - OSM data and contours. I have prepared temlate.args looking like this:


mapname: 08900000
description: CZ-Prague
input-file: osm\08900000.osm.pbf
input-file: contours\08900000.osm.pbf

mapname: 08900001
description: CZ-Brno
input-file: osm\08900001.osm.pbf
input-file: contours\08900001.osm.pbf

It nearly worked. I got img files consisted of data form both layers. Unfortunately it didn’t worked correctly for index, tdb and preview map. These files had doubled records. And for last map in a set mkgmap created additional img from last input file, containing contours only.

I’d like the idea to create single img from multiple sources. Would be great if I could mix osm and mp files, maybe this is possible but I haven’t tested yet.

I have used mkgmap version 2654

I produce a map “Karte_xxx.img” and another map with contourlines “Hoeheyyy.img” and combine both as follows:
(%1=xxx , %2=yyy):

echo Param1=Karte (ohne Karte- bzw Hoehe_ und .img) Param2=Höhe Param3=FID der Karte
java -ea -Xmx3000m -jar q:\prog_2589\mkgmap.jar --gmapsupp --family-name=beide --description=%1_mitHoehe q:\karten\karte_%1.img q:\karten\hoehe_%2.img q:\stile\meinTyp%3.TYP

rename gmapsupp.img KarteundHoehe_%1.img
del osmmap.*
cd …\a2

you just need to run all input files at the end of the same mkgmap command. Don’t think you can mix mp and osm though. I would even make sure to not mix osm and pbf but stick to either or.
If you are sure there are problems, have a look in my maps, if there are bugs too (I dot this on all maps) - and then report it on the mkgmap mailinglist. Could well be that there are bugs.

However it’s normal that for every input file, mkgmap creates an output .img file. But the index/tdb/preview maps are fine for what I know. If you want to have a single output file, you need to merge with osmconvert or osmosis beforehand.

In my example mkgmap has created an img for every “mapname” (plus a one duplicate). I think this behavior is logical but maybe not intended :wink:

And there is a bug, since this mapset is unusable, Mapsource doesn’t start with this map installed. As I have written, img are correct but additional files - index, tdb, preview - are created for every “input-file”, not for every “mapname” like img.

I have succeeded to create my map, but it took me a week to find a procedure that works. My most attempt failed at splitter stage. The behavior of mkgmap was quite interesting, so I decided to post it.

I’m not having any problems with the mapset* files created - I don’t know if they are 100% correct - but I couldn’t notice a difference to single input files anywhere. So you must be doing something wrong. Make sure to use --latin1 on all .img (or use another charset, but --index is only supported for --latin1).

Also actually I don’t feed to .pbf files to mkgmap, but the readymade contourlines .img files, after the .pbf file.

I know, that I can add contours as an overlay and that I can merge osm data with osmosis. But overlay won’t work for polygons and osmosis won’t take data in mp format. Both could be done with minor tweaks in mkgmap, and I’m quite interested in it.

Well that would be perfect - patch it and send a patch to the ML. For me best would be, if readymade .img files could be added into the .img. So no additional processing time of rendering contourlines (or 2 steps - 1.st merging with osmosis, then rendering the contourlines each map update - instead of once only).

I don’t know code of mkgmap. I can only see that it work for a specific case. I will ask about this feature on mailing list.

I doubt if merging img would be easy. This would need decompiling of img. I think mkgmap programmers have code for this task but not included in mkgmap directly.

I have my contours saved as a mp files created using gpsmapedit .
I then add them at the end before xxx.osm.pbf
or in an args file: ie

mapname: 85933649
description: K:\osmosis\bin\devon-latest.osm.pbf
input-file: 85933649.osm.pbf

mapname:85933650
description:map0
input-file:C:\a_mapuploaderexe\devoncontours\22222223.mp

This works without fail

Thanks for advice. Contours was an example only. What I’d really like to have is more flexibility in mkgmap.