Mkgmap - different map base color for different elevations?

I’m looking to enhance my maps I generate for the Garmin Zumo motorcycle GPS systems - https://motomap.org/ to include hillshading, contour lines and hopefully some kind of differentiation in land elevation. Ultimately I would like to have some kind of land cover overlay like Gaia:

But I’d settle for now for different colors between elevations like OpenCycleMap has:

Am I right in understanding that if I generate contour lines with an application like phyghtmap that the resulting output is just lines, not polygons? I can only control the color, size, etc. of the lines?

If not, can anyone point me in a direction I can dig into to find a method for doing this? Appreciation in advance!

As an aside, I’ve started containerizing mkgmap using Docker and running these images on Azure. Repos are below if there is any interest in copying this method.

https://github.com/markcushman/motomap
https://github.com/markcushman/motomap_mapupload

I don’t know where you are getting your contour lines from. But if you are generating them from digital elevation model (DEM) data files, you can also generate hypsometric tints based on elevation from DEM data. Slope and hill shading can also be done with that same data. I am not up to speed on vector based map generation, but you can use tools from the gdal project to create contour, hill shade, slope shade, hypsometric and hypsometric backgrounds for raster based maps. I imagine you can do the same for vector based.

I was going to use phyghtmap (Man page of PHYGHTMAP) which downloads the STRM data from NASA. More details are in that link. Basically this takes the STRM data and outputs OSM vector based data (lines) that can be used by mkgmap to draw contour lines.

My question is really how to style the AREAS in between the contour lines based on the elevation, I’m wondering if that is even possible with mkgmap.

This might be a question for @GerdP

Sorry, I only know the rules in the default style, see inc\contour_lines
Maybe you mean the so called hill shading instead? For this you have to calculate the DEM subfile. Search for DEM here Command line
to find the details.

Read again the first post and maybe you “simply” want to render different colours like a dark green for land area at 1-100 m elevation and a dark brown for 2000+ m?
I think that requires to have complete (closed) polygons with ele data. I don’t know if phyghtmap has an option to output them, but I seem to remember that a user tried to use exactly such output for the lines rules and that the huge amount of nodes in the ways caused problems. You would probably just need some rules in the polygons file to output specific types for a given range of ele values and a typ file which gives them the proper colour and draw order.
Obvious problem: The map would contain many overlaping polygons for an area in the mountains and thus a lot more data.

2 Likes

Thanks so much for the reply - I thought that would be the case (I’d have to generate polygons from the elevation data). Even if I did that I’m not sure the Garmin devices would be able to handle the size of the output.

Now looking into a raster underlay option instead, at least to get some kind of ground cover colors.

Search the web for “goal hypsometric”. The sites and examples I found and used years ago are hard to find now, but this newer one looks like a place to start for both slope shading and for elevation based colors: A Gentle Introduction to GDAL Part 5: Shaded Relief | by Robert Simmon | Medium

1 Like

I put together a tool for generating hillshade/elevation coloring. You might take a look. It doesn’t generate contour lines but that’s fairly easy with GDAL. ColorReliefEditor · PyPI

2 Likes

Oh, this looks super cool - I will for sure try this!

1 Like

I added support for contour shapefiles in v 0.3.0

1 Like

Really beautiful graphics, really beautiful collaboration. Go, OSM!