mkgmap - problem with contour lines

Hello :slight_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):
[_line]
Type=0x20
;GRMN_TYPE: Contour Lines/MINOR_CONTOUR/Minor land-based contour line/Non NT
UseOrientation=N
Xpm=“32 1 2 1”
“! c #DBB793
" c none"
“!!!”
;12345678901234567890123456789012
String3=0x04,Contour (20 m)
ExtendedLabels=Y
FontStyle=NoLabel (invisible)
CustomColor=No
[end]

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

What am I doing wrong? :roll_eyes:

OSM data does not contain land elevation data, you have to generate them from hgt data (https://wiki.openstreetmap.org/wiki/Phyghtmap) or download it from another source, I use http://develop.freizeitkarte-osm.de/ See http://www.openfietsmap.nl/procedure for more info.

Thank you for pointing the way. :slight_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 :wink:

A funny spider web made of lines.
I’m assuming that merging the data doesn’t work that well. :roll_eyes:

An idea?

You probably did not use the options to make sure that the contour lines have different node ids and way ids. See https://wiki.openstreetmap.org/wiki/Srtm2Osm#Garmin

Thanks for the hint. :slight_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. :slight_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_eyes:

Thanks again for the pointers. :slight_smile: