logo separator

[mkgmap-dev] Combining img files to a single map

From Felix Herwegh mlmmduk at herwegh.de on Thu Nov 3 09:47:35 GMT 2022


to keep your workflow you could possibly generate the .imgs with overlay 
info --transparent and give them increasingly higher --draw-priority to 
control, which is painted on top of which. Modern devices allow to 
enable and use multiple map layers this way, although heritage devices 
may not.

 > Combine attempts with like "java -jar mkgmap/mkgmap.jar --gmapsupp 
basemap.img fixme.img oneway.img"
Wouldn't the mkgmap syntax treat at least the last file named on the 
command line as typfile?

But: In an old shellscript I do successfully merge multiple .imgs into 
one final .img using mkgmap with an args-file for the final map 
(including --gmapsupp) and several --input-file=....img lines for the 
individual .imgs. The individual .img's typfiles all are given 
individual names during the individual maps creation, although they 
typically (but not enforced) where just copies of the same source 
typfile in my usecase. No typfile named for the final map. The outcome 
works on Garmin Edge devices as well as QMapShack on Linux.

    # concatenate maps from subregions (if any) to main region
    # create options.arg file
    echo "overview-mapname=${MAPNAME}" > ${ARGS}
    echo "overview-mapnumber=${MFID}0000" >> ${ARGS}
    echo "draw-priority=30" >> ${ARGS}
    echo "transparent" >> ${ARGS}
    echo "gmapsupp" >> ${ARGS}
    for SUBDIR in $(ls -d "${PROJDIR}/${MREGION}/"*/)
       if ! [ ${SUBDIR: -5} == ".bak/" ] 2> /dev/null
          # ${SUBDIR} is subregion not .bak dir
          for IMGFILE in $(ls -d "${SUBDIR}"*.img 2> /dev/null)
             echo "input-file=${IMGFILE}" >> ${ARGS}
    echo "output-dir=${PROJDIR}/tmp/" >> ${ARGS}
    echo "verbose" >> ${ARGS}

    # run mkgmap to tmp
    mkgmap -c ${ARGS}

Cheers Felix
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20221103/e1eae1bc/attachment.html>

More information about the mkgmap-dev mailing list