OSM Tools
dutch german en francais spanish spanish polish russian

Tricks & Tips with mkgmap styles 5

Large Town Names

Many of us may have been frustrated by the fact that town names appear large in Basecamp or Mapsource but NOT on one's GPS.

There is one solution that will always work:

Check out on your GPS for any labels that are large.

You may have used different type numbers to distinguish towns from cities,villages and suburbs.

There is a whole range of type numbers between 0x100 and 0x1F1F.

I discovered that the 64GPS uses 0x1F00 to display large names.

How to show islands in a lake using mkgmap?

multipolygon: no lakes & islands multipolygon: with lakes & islands

a) Click on your Lake then create a new multipolygon relation - ways of doing this depends on your editor.

b) Make sure you have selected your lake , now add the new relation. Check the number id.

c) Make sure the 'role' is 'outer' : add outer to the role

d) Click on an island then add the relation with THE SAME NUMBER ID and call the 'role' inner.

e) Do this for all the islands

That's it ? NO!

mkgmap will not render multipolygons unless

1) the natural=water tag has been REMOVED from the original polygon

2) natural=water tag is added to the relation

In fact, transfer all tags from the original polygon and add them to the relation!

Please note , Mapnik will render multipolygons without having to do steps 1 & 2!

When you parse your osm you will notice blank islands

You can change this by clicking on each island and adding , say natural=wood

Problems with multiple tags:boundaries

Today, many rivers,highways have an added 'boundary' tag. This saves space but can also lead to unexpected results.

boundary no river boundary & river

As I had all my boundary tags at the beginning of my lines file, I forgot to add 'continue'

boundary=administrative [0x1c resolution 24 continue]

Problems with multiple polygon tags:tourism

Again , be prepared for unexpected tagging. Loch Ness is tagged as natural=water AND tourism=attraction

I had both tags as solid polygons and tourism had a higher draworder in my TYP file.

In my case, I'm not too bothered about showing tourism polygons so added:

natural=water & tourism=attraction {delete tourism}

Elevation:Showing contours in different intervals,50,100,150,200 etc

If you are able to convert STRM .hgt files to .osm then you can use the ele tag to control your contours.

Multiples of numbers can be parsed using \d

example: ~ '\d*[013579]00' # this means ' if elevation = 100 or 300 or 500 or 700 etc

Using three contour type numbers, 0x20 , 0x21 and 0x22

Use 0x22 for multiple of 200

# start with resolution=18

contour=elevation & ele ~ '\d*[02468]00' # ie for 200 400 600 800
{ name '${ele|conv:m=>ft}'; } [0x22 resolution 18]

Use 0x21 for multiples of 50

#start with resolution=21

You may want to use one colour for multiples of 50 : 50 100 , 150, 200 etc

contour=elevation & ele ~ '\d+[05]0' # match 1 or more repetition digits 100 150 200 250
{ name '${ele|conv:m=>ft}'; } [0x21 resolution 21]

Use 0x20 for the rest

'# only show with resolution=24

contour=elevation { name '${ele|conv:m=>ft}'; } [0x20 resolution 23]