mkgmap and styles

I try to create style files of my own, but the documentation is not really clear enuf imho (at least for me :slight_smile: )

  • First I would like to know, if I create a polygon file with just two of three items, example, amenity college, hospital and school are not the colors I would like them to be displayed, is it possible for mkgmap to use the whole default style file, but to use my style file for the 3 items?

  • Second, style files used a hexa code for colors, but I can’t find an equivalence table that would give me : 0x16 is green for example.

  • Last question : mkgmap uses an “options” file.
    In it I have just :
    levels = 0:24, 1:22, 2:20, 3:18, 4:16
    Is it possible to use more levels. What mean those “0”, 1, 2, 3. and 4?
    Does someone has an example of a more complicated options file (to help me to understand how it works)? Thanks. Francois

I have to agree the document isn’t as clear as it could be. Based on my testing this is how I understand it:

No. mkgmap either uses your style file or its default. The easiest way is to copy over the whole of the default style and then edit the the polygon file to add/remove the items you want

Not sure I understand this. Mkgmap creates IMG file. This IMG files contain details of the items (eg. where a road is and at what zoom levels they are displayed.

Colours are handled in the TYP file. You need to combine a TYP file with an IMG file to get something to show in a particular color. Mkgmap doesn’t create TYP files - you need something like http://ati.land.cz/gps/typdecomp/editor.cgi

There are two things going on here. The Garmin itself has 24 zoom levels. Number 24 is the most zoomed in (going any further and you see ‘overzoom’ on the screen), the number decreases as you zoom out. Although the minimum zoom level would be 1, in practice 12 is about as far out as most garmins go.

A map file doesn’t hold information on how to draw things at each zoom level. Instead a map contains at most about 10 levels.

The levels option in an option file links the levels in the map file to zoom levels on the garmin. So in your example the map doesn’t contain information on zoom level 23, instead the garmin will scale up/down either the 22 or 24 zoom level (I don’t know which).

When using Mkgmap the most levels I have got it to handle is 8 using the following line:

levels = 0:23, 1:22, 2:21, 3:20, 4:19, 5:18, 6:16, 7:12

One thing to watch out for is that as well as using the levels in the options file mkgmap also seems to create extra levels if the style file specifies a different zoom level (labeled as resolution in the style file) which isn’t in the options file. For example (using my options line) if the style file has a resolution of say 24 defined then mkgmap seems to create an extra level (making the total 9) which means when you fully zoom out things don’t disappear because the maximum number of levels in the map file has been exceeded (I believe the default style file for mkgmap may be guilty of this). The trick is to decide what zoom levels you want to use, set those up in the options file and then make sure the lines/polygons /points files only use the corresponding resolutions.

Note: This is all based on my current understanding, which isn’t necessarily complete.

Hello,
Your message should be copied/pasted to the wiki. Much clearer. Thank you. My mistake was that I thought the hexa code was a color, but no, it’s the representation of the POI. I found a list on a web site where the hexa codes are given for all POIs used by Garmin. As I saw different stuff of my OSM files which are not displayed, I can add them to the points/polygons files and give them the same hexa codes that other well displayed items. Then I will have to do exactly what you said : I’m gonna take your range of zoom levels (maybe the first one will be 0:24 :wink: ) and check each lines/polygons /points files to use the corresponding resolutions. Then I will have to find out a way to create that TYP file with Linux. Thank you again Mark_S for your message. Francois

Hello,

I’m trying to do a similar customisation of a map. Could you tell which site is giving the hexa codes for all POIs used by Garmin?

Beside this, assuming that I want to modify only the color of some polylines (with a new typ file), will it still be possible to use Garmin POI definitions? Or will I have to redefine all those icons in the typ file?

When I played around with it I also discovered that the zoom level at which the base map is displayed
instead of the detail map is depending from the level-resolution setting.

With default setting I think base map is diplayed on 50km zoom and above on a Etrex/Vista.

Chris

See the section titled '“What are these type codes you keep going on about?” at the bottom of
http://www.cferrero.net/maps/guide_to_mkgmap_style_files.html

Assuming I’ve understood what you mean: if you want to mix Garmin defaults with TYP customisations, you can do this. Any Garmin element (POI, way or polygon) that is not re-defined in a TYP file will default to the…default.

Hi to all,

I’m using an Etrex 30:
in my img.files (created with osmosis0.39, mkgmap-r2309 → gpsmapedit1.1.74.3 >- cgpsmapper0100.d) there are 2 types, which I want to change, but don’t know how:

  1. religion-place of worship → is displayed only with a tiny dot (0x2c0b) instead of a white chapel (displayed so in my old VistaHCx)
  2. building-man-made area - displayed in mapedit brown (0x0013) - >in my etrex30 only displayed in a light shaded grey, nearly unvisible.

I tried to change it in gpsmapedit → no way, I changed the codes of the .mp-file within an editor…no way. Have I to do this within the mkgmap-code, what will be the parameters? I don’t really understand the wiki of mkgmap:/
Is there a way to change it anyway, or do I have to take the Garmindefaults?

Thx for any hints…Michelinho :sunglasses:

Yes, you need a typ fle, see http://www.cferrero.net/maps/guide_to_TYPs.html