logo separator

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

From Harri Suomalainen hsuomal at welho.com on Thu Nov 24 16:36:27 GMT 2022

Thanks for all the tips everyone.

I've been thinking the choises for a while and it seems probably the 
best way is to include all the symbols I need in a common TYP file and 
convert it all to overlays.

The reason I would have liked to combine different files was it was very 
convinient to make something like one-way arrows separately in all roads 
(no need to include continue in every road statement). Separate files 
have worked fine with newer devices but I still use some older one that 
does not allow many img-files. Perhaps I just need to retire it finally.

Thanks for the help everyone! A combination of different suggestions 
(and tinkering with the styles a bit) should do what I need. (at least 
with accepting it will hurt some older device).


On 3.11.2022 11.47, Felix Herwegh wrote:
> Harri,
> 
> 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?
> <https://wiki.openstreetmap.org/wiki/Mkgmap/help/TYP_files>(https://wiki.openstreetmap.org/wiki/Mkgmap/help/TYP_files <https://wiki.openstreetmap.org/wiki/Mkgmap/help/TYP_files>)
> 
> 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}/"*/)
>     do
>        if ! [ ${SUBDIR: -5} == ".bak/" ] 2> /dev/null
>        then
>           # ${SUBDIR} is subregion not .bak dir
>           for IMGFILE in $(ls -d "${SUBDIR}"*.img 2> /dev/null)
>           do
>              echo "input-file=${IMGFILE}" >> ${ARGS}
>           done
>        fi
>     done
>     echo "output-dir=${PROJDIR}/tmp/" >> ${ARGS}
>     echo "verbose" >> ${ARGS}
> 
>     # run mkgmap to tmp
>     mkgmap -c ${ARGS}
>     ...
> 
> Cheers Felix
> 
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


More information about the mkgmap-dev mailing list