Mapnik layout (TYP file) for Garmin osm maps

Is there any particular reason you want it to look like the Mapnik map?

Simply because it’s the most common osm renderer on the web. I agree it’s not the best when converted to the Garmin format, but for first time users its more recognizable when they see the same map on their garmin unit as on their pc. At the moment Lambertus Garmin world map doesn’t use a TYP file and especially in the Netherlands with all the recently imported topo data the Garmin map looks horrible without a TYP file. So it’s just a start, eventually more alternative TYP files can be designed if there is a demand for them.

Hi ligfietser

thanks for your effort, this is exactly what I always wanted to have, “seeing OSM when using OSM.” The only problem is, that it doesn’t work yet on my nüvi 765.
Unfortunately I’m not really familiar with all the tools around OSM, so I would be thankful for some easy explanation.

Let me first tell what I did so far:

  1. I downloaded OSM data from Geofabrik.de
  2. converted this in .img-format with mkgmap
  3. I tried to combine the .img-file with your mapnik2.typ-file by using “MapSetToolKit_v1.77”
  4. Sent the map with mapsource on my device

Now the problems are the following:

  • In mapsource I have the “Mapnik-Style”, on my nüvi it looks the same as always, no change.
  • The MapSetToolKit tells me, that the Family ID and the Product Code aren’t the same in the .TYP as the ones I entered in MapSetToolKit. Which numbers are the correct ones?

What do I make wrong?

Thanks for your help!

Since you are making your own map with mkgmap I dont know which Family ID and product ID you have set. Those are the ones you need to enter. They are likely to be different than the ones in the TYp file. Does mapset toolkit ask you to correct the Family ID and Product code in the TYP file? If so, just confirm.

Hi

Thanks for your help, now it works! I never set any Family-ID or Product-ID in mkgmap, that was the problem.
I’ll test how the map behaves on the nüvi and report here.

regards M.

Hi, Ligfietser!

Thanks for this link and answering my question about the difference between Garmin OSM maps and maps with Type file layout. I will be back in the Dutch user forum.

Regards O2

I have found a trick to make the spaghetti lines more bearable :wink: by placing two lines on top of each other.
One line is routable and has borders. The other line is non routable and has no borders, only a solid colour.
In the line style file it looks like this:

highway=x [0x060 road_speed=1 road_class=1 resolution 20]

In the overlays file:

0x060: 0x06, 0x10106

In the typ file 0x06 is for instance the line width=3 border=1

[_line]
Type=0x06
UseOrientation=N
LineWidth=3
BorderWidth=1
Xpm=“0 0 2 0”
“1 c #FFFFFF
“2 c #393000
String1=0x04,street
String2=0x03,straat
String3=0x02,Straße
ExtendedLabels=Y
FontStyle=SmallFont
CustomColor=No
[end]

0x10106 can be a line width=3 border=0 or a 3 pixels wide bitmap:

[_line]
Type=0x10106
UseOrientation=N
LineWidth=3
Xpm=“0 0 1 0”
“1 c #FFFFFF
ExtendedLabels=Y
FontStyle=NoLabel (invisible)
CustomColor=No
[end]

The result is looking much better on my old Etrex device:

without overlay

with overlay 0x10106

Of course on a newer generation GPS like the Dakota it looks more pretty, but the differences are not too big:

Clever. I might give this a go…the trouble is I use different thicknesses at different zoom levels so keeping track of things is already a nightmare without then trying to make use of overlays.

I’m using this trick only for the highest zoomlevels. The lower the zoom, the thinner the roads, and on those levels it isnt too much of a problem. The only problem I still have is that I also want to indicate bike routes on top. This is not possible unless I make ‘window’ holes in the 0x10106 bitmap. Disadvantage of those holes is that the roads on my latest map still shows a bit more spaghetti effect. See for an example http://sites.google.com/site/openfietsmap/news/22-04-2011

What you have done here is awesome and it looks really good. However:

On the web, yes and it produces a professional looking map on screen and possibly when printed (haven’t tried that yet). But the requirements on a GPS are a little different. You want to be able to see roads at a glance. The screen is very small, so you don’t want too much clutter. When driving you don’t have much time to look at the screen, you need to get info quickly and make decisions on where to go based on that (unless you are being routed, but even then: the instructions are not always correct).

Personally, I don’t want too much detail apart from roads and rivers, maybe rail lines. What I do want is contrast.

I have experimented a little with typ files myself, because my Zumo 660 displays minor roads almost the same as dirt tracks: a thin grey line on a white background. (This is a motorcycle GPS…) I have found that no matter how I try you cannot have dashed or dotted lines in a typ file on the Zumo. The reason is that any transparent colour appears as non-tranparent black. You may want to bear that in mind.

Regards,
Peter.

I’d like to do a test run for the whole planet and publish it as experimental via the website.

Will this TYP file show the sea polygons when the maps are generated with the default stylesheet or marine stylesheet? And will this commandline you referenced in one of your emails to the Mkgmap dev list work?

--generate-sea=extend-sea-sectors,close-gaps=6000,floodblocker,land-tag=natural=background

And shouldn’t there be another parameter ‘polygons’?

Hi Lambertus,
The default style doesn’t have a land-tag like natural=background or natural=land. And therefore i didnt add it in the mapnik.typ file as well, the typ file does however have a tag for natural=sea. The tag natural=background I have invented myself for the OFM because natural=land is already used to tag islands in a lake or something. If you leave that land-tag out I dont know what the consequences are for the rendering. I dont use a parameter ‘polygons’.

Another option is to adapt the default style and use your own style (you can add a line like natural=land or background, throw away buildings etc and those ugly gsm masts, border lines etc)

I made a small map of the Zeeland province with the default style and --generate-sea=extend-sea-sectors,close-gaps=6000,floodblocker
Without a land-tag it looked ok, after I made some modifications of the typ file. I had to give the sea polygon the lowest draw order.
The new version you can download here: http://mijndev.openstreetmap.nl/~ligfietser/diverse/mapnik.typ_r1946.zip

Cool, thanks!

Looking around through several available styles in order to find what works best for me, I noticed that the definition for 0x08 (minor ramp) is skipped, so these ramps would be displayed whatever the default is on the given device.

The default mkgmap style uses this both for primary and secondary links. I would suggest to set it to the color of secondary highways, as in my opinion a primary road with a “lower class” ramp/link looks more plausible than a secondary with a “higher class” ramp/link.

g0ldfish, I’ve added your suggestion, see
http://mijndev.openstreetmap.nl/~ligfietser/diverse/mapnik.typ_r1946.zip

Another option is to send the maps by default with a typ file (which is empty) like the emtpy.typ in http://mijndev.openstreetmap.nl/~ligfietser/diverse/mapnik.typ_r1946.zip
and a mapnik one (and maybe some others) as well, so someone can simply rename emty.typ (or default.typ) by one of those others.

Now that’s a great idea, although it will mean that you need to maintain several typ files and keep them in sync.

Thats why its good to have several people mainting this. You have several opnions about what’s an optimal typ file, and besides every gps Garmin model seems to behave differently (like your Zumo which doesnt handle dotted lines, the old Etrex that spits out spaghetti lines etc)

Some observations for the mapnik typ:

Shelter shouldn’t be 0x2b,0x5, because that’s tagged as campground in MS and will probably show up in searches. Let’s stick with 0x6 which is Lodging/Park. I think we can live with that. Strangely, there is no entry for this in the mkgmap style, so I don’t know why it’s rendered at all.

2B01 Hostel should be Gîte in French.