logo separator

[mkgmap-dev] UK Contours

From Ralf Kleineisel ralf at kleineisel.de on Fri Mar 18 07:34:47 GMT 2011

On 17.03.2011 14:24, Stuart Poulton wrote:

> Has anyone got a quick recipe for STRM contours to garmin for the UK, preferably on Linux ?

To make 1 degree square tiles with groundtruth:

Download SRTM data and make an IBF:
GroundTruth.sh contours -o 21000001.ibf --bounds="47,15,48,16" --int 10
--gridlat=10 --gridlon=10

Convert to OSM in subdirectory 21000001:
GroundTruth.sh ibf2osm -i 21000001.ibf --tagce --cat="100,20" --od 21000001

mkgmap can't read bz2, can it?
bzip2 -cd 21000001/Contours1.osm.bz2 | gzip -c > 21000001/Contours1.osm.gz

Make IMG:
mkgmap -c template_srtm.args --mapname=22000001 21000001/Contours1.osm.gz

My template_srtm.args is basically this:
description=SRTM
country-name=Germany
country-abbr=DE
region-name=Germany
region-abbr=DE
overview-mapname=SRTM
overview-mapnumber=10000000
latin1
code-page=1252
family-id=1234
product-id=1
series-name=SRTM
family-name=SRTM
area-name=Germany
style-file=mkgmap-style-srtm/
transparent=yes
draw-priority=28

The style has rules for lines only:
contour=elevation & contour_ext=elevation_minor
        { name '${ele|conv:m=>ft}'; }
        [0x20 resolution 23]
contour=elevation & contour_ext=elevation_medium
        { name '${ele|conv:m=>ft}'; }
        [0x21 resolution 22]
contour=elevation & contour_ext=elevation_major
        { name '${ele|conv:m=>ft}'; }
        [0x22 resolution 20]

I use separate transparent SRTM layers with a different family-ID. These
can be switched off independently from the OSM layer in the GPS. For
this the tile must be transparent, the draw-priority must be higher than
that of the non-transparent layer and the map-id number must be higher.
Mapsource can't deal with more than one family-ID at a time, so you have
to make a special TDB file and overview-map with only one family for
mapsource.

All tiles must have the same code-page.

In the gmapsupp.img the SRTM tiles can have a different family-id and
their own typ file. In mapsource all tiles must have the same family-id.
To achieve this I build the gmapsupp.img in a seperate step.

In flat areas you can make bigger tiles (e.g. 2x2 degrees), but not in
mountain regions.

If you want perfect tile borders in the overview map you have to make
sure that the borders in garmin units are rounded to the nearest
multiple of 2048. Garmin unit is degrees * 46603. That means: instead of
47 degrees (2190341) use 2190341 - 1029 = 2189312 = 46.9779198764 degrees.

Groundtruth does a very good jobs at matching the lines of adjacent
tiles at the borders. If you use exactly the same numbers for the
eastern border of one tile and for the western border of the next tile
the lines will match exactly.



More information about the mkgmap-dev mailing list