You are not logged in.

#1 2021-06-07 18:17:53

Registered: 2021-06-07
Posts: 3

mkgmap - problem with contour lines

Hello smile

My goal is to create my own map for my Garmin and for planning in BaseCamp.
I've come a long way, but I can't get the matter with the contour lines straight!

What I have and what I do is as follows:

OSM data via Geofabrik
Splitter version 602 (05/07/2021)
Mkgmap Version 4760 (06/06/2021)
hgt data from viewfinderpanoramas

mkgmap command (among others): --dem=../res/hgt --dem-dists=9942,19884,29826,39768,49710,59652,69594,79536 --overview-dem-dist=59652

style - lines: include 'inc/contour_lines';

style - inc/contour_lines:
contour=elevation & contour_ext=elevation_minor  { name '${ele|conv:m=>ft}'; } [0x20 resolution 22]
contour=elevation & contour_ext=elevation_medium { name '${ele|conv:m=>ft}'; } [0x21 resolution 21]
contour=elevation & contour_ext=elevation_major  { name '${ele|conv:m=>ft}'; } [0x22 resolution 20]
contour=elevation | contour_ext=elevation        { name '${ele|conv:m=>ft}'; } [0x21 resolution 20]

typ (0x21 und 0x22 analog 0x20):
;GRMN_TYPE: Contour Lines/MINOR_CONTOUR/Minor land-based contour line/Non NT
Xpm="32 1 2 1"
"! c #DBB793"
"  c none"
String3=0x04,Contour (20 m)
FontStyle=NoLabel (invisible)

Result in BaseCamp:
The 'hill-shading' is visible, that's OK and works fine.
But no contour lines are visible.

What am I doing wrong? roll


#2 2021-06-08 08:01:02

Registered: 2008-10-09
Posts: 5,353

Re: mkgmap - problem with contour lines

OSM data does not contain land elevation data, you have to generate them from hgt data ( or download it from another source, I use See for more info.

Last edited by ligfietser (2021-06-08 08:02:27)


#3 2021-06-08 18:05:04

Registered: 2021-06-07
Posts: 3

Re: mkgmap - problem with contour lines

Thank you for pointing the way. smile

I installed Python and Phyghtmap (Windows).
Python works but Phyghtmap only throws error messages.

Then I tried Srtm2Osm.
So I was able to create a map with only contour lines. That looks nice. So far so good.

Then I tried to convert the contour lines with osmconvert, that works.
But merging the data from Geofabrik with the contour lines is not possible. osmconvert does not recognize the previously self-created file format!

Then I sorted and merged the data with osmosis, split with splitter and rendered with mkgmap.
It works, but the result is refreshing ;-)

A funny spider web made of lines.
I'm assuming that merging the data doesn't work that well. roll

An idea?


#4 2021-06-08 19:11:25

Registered: 2015-12-18
Posts: 1,939

Re: mkgmap - problem with contour lines

You probably did not use the options to make sure that the contour lines have different node ids and way ids. See


#5 2021-06-09 15:54:10

Registered: 2021-06-07
Posts: 3

Re: mkgmap - problem with contour lines

Thanks for the hint. smile

At first I thought it might have something to do with the borders.
The reason for the spider web was actually the node-id.
I have defined the node-id but not high enough.

Phyghtmap's error messages didn't leave me in peace, so I was able to fix the errors here. A few additional Python modules were still missing.
Now it also works with Phyghtmap. smile

I was still wondering whether it is possible to differentiate the contour lines over meadow/forest or rock or glacier by color (element type).
But I do not think this is possible because a contour line (line) does not allow a relationship to e.g. a glacier (polygone). Correct? roll

Thanks again for the pointers. smile


Board footer

Powered by FluxBB