How to make a scale-dependent TYP style?

Hi to all, I'm trying to create a map for an old eTrex 10 Garmin device. Everything works fine, but I don't understand how to make a custom TYP file that will render roads differently at different scales. This is my mkgmap invokation: mkgmap \ --reduce-point-density=4 --unicode \ --description="$DESCRIPTION" \ --style-file='./styles/default/' \ --country-name='Italy' --country-abbr='I' \ --region-name='Toscana' \ --family-id=9999 \ --gmapsupp 63240*.osm.pbf \ ./typ/my_etrex10.txt as you can see I have customized the default style and I have provided a custom TYP file to override only _line Type=0x006 and Type=0x016 rendering. My style defines four levels: levels = 0:24, 1:20, 2:19, 3:18 The problem is that my custom TYPs are applied the same at any level (scale), whereas the default TYP are scale-dependant (e.g. secondary roads are rendered gradually thicker when zooming in). This is my TYP file, indeed there are no scale-dependant rules! Am I missing something in the TYP syntax? [_line] Type=0x006 ;GRMN_TYPE: UseOrientation=Y LineWidth=2 BorderWidth=0 Xpm="0 0 2 0" "1 c #BD9541" "2 c #000000" String1=0x04,Way ExtendedLabels=N [end] [_line] Type=0x016 ;GRMN_TYPE: Roads/TRAIL/Walkway or trail/Non NT, NT UseOrientation=Y Xpm="32 1 2 1" "! c #808080" " c none" "!!!! !!!! !!!! !!!! !!!! !!" ;12345678901234567890123456789012 String1=0x04,Path ExtendedLabels=N [end] -- Niccolo Rigacci - http://www.rigacci.net/ Campi Bisenzio - Firenze - Italy Tel. Mobile: +39-327-5619352

On Sat, Apr 04, 2020 at 03:30:05PM +0200, Arndt Röhrig wrote:
you must create an own type for each zoom-level.
highway=motorway [0x1 resolution 24 continue] highway=motorway [0x10101 resolution 23-20 continue] highway=motorway [0x10102 resolution 19-18]
Thanks Arndt, this make sense! But if I read the source file for the default style (resources/styles/default/lines) I see only one definition for (e.g.) highway=secondary: highway=secondary [0x04 road_class=2 road_speed=3 resolution 20] there are not other definitions for other resolutions! However secondary roads are rendered with increasing sizes, starting from resolution 20 to greather ones. B.t.w. where can I find the default TYP file used by mkgmap? -- Niccolo Rigacci - http://www.rigacci.net/ Campi Bisenzio - Firenze - Italy Tel. Mobile: +39-327-5619352

Hi You'd have to do the same trick with all highway types and set a representation for all of them in your TYP file mkgmap doesn't have a default TYP, but there are a couple of examples in {distribution}/examples/typ-files I find it best not to have any highway _lines in my personal TYP file for the reasons you are seeing - it looks much better on my device to let it represent them using its default mechanism. Ticker On Sat, 2020-04-04 at 19:55 +0200, Niccolo Rigacci wrote:
On Sat, Apr 04, 2020 at 03:30:05PM +0200, Arndt Röhrig wrote:
you must create an own type for each zoom-level.
highway=motorway [0x1 resolution 24 continue] highway=motorway [0x10101 resolution 23-20 continue] highway=motorway [0x10102 resolution 19-18]
Thanks Arndt, this make sense!
But if I read the source file for the default style (resources/styles/default/lines) I see only one definition for (e.g.) highway=secondary:
highway=secondary [0x04 road_class=2 road_speed=3 resolution 20]
there are not other definitions for other resolutions! However secondary roads are rendered with increasing sizes, starting from resolution 20 to greather ones.
B.t.w. where can I find the default TYP file used by mkgmap?

On Sat, Apr 04, 2020 at 07:05:09PM +0100, Ticker Berkin wrote:
mkgmap doesn't have a default TYP, but there are a couple of examples in {distribution}/examples/typ-files
I find it best not to have any highway _lines in my personal TYP file for the reasons you are seeing - it looks much better on my device to let it represent them using its default mechanism.
So, if I understand well what are you saying, the default mechanism used by mkgmap is not based on TYP rules, but on algorithmic procedures. Is it possible to browse the native rendering types known by mkgmap? Something like TYPViewer. So that I can use them instead of creating new ones via TYP files. -- Niccolo Rigacci - http://www.rigacci.net/ Campi Bisenzio - Firenze - Italy Tel. Mobile: +39-327-5619352

Hi Without an override from a TYP file, Garmin devices have their own, inbuilt, rules about how to render each object (point/line/polygon) and these vary from device to device, so no, there isn't and cannot be a tool to do what you asked. If you are making a map just for your particular device, the best thing to do is generate a map without a TYP and see how it looks, then tweak just the minimum with specific TYP [_xxx] entries. For my eTrex HCx, not having a TYP works really well for points and lines. My eTrex 30x doesn't show some non-road lines, or shows them in white which was almost impossible to see, so I have these in my TYP. There are problems in the way they renders overlapping polygon and the order in which they overwrite each other as the device is finding them, but this is another topic. For both, apart from the above, I much prefer their default rendering rather than, say, {distribution}/examples/typ-files/mapnik.txt which also slows down the devices to an almost unusable speed. Ticker On Sat, 2020-04-04 at 21:24 +0200, Niccolo Rigacci wrote:
On Sat, Apr 04, 2020 at 07:05:09PM +0100, Ticker Berkin wrote:
mkgmap doesn't have a default TYP, but there are a couple of examples in {distribution}/examples/typ-files
I find it best not to have any highway _lines in my personal TYP file for the reasons you are seeing - it looks much better on my device to let it represent them using its default mechanism.
So, if I understand well what are you saying, the default mechanism used by mkgmap is not based on TYP rules, but on algorithmic procedures.
Is it possible to browse the native rendering types known by mkgmap? Something like TYPViewer. So that I can use them instead of creating new ones via TYP files.

Ticker Berkin <rwb-mkgmap@jagit.co.uk> writes:
For both, apart from the above, I much prefer their default rendering rather than, say, {distribution}/examples/typ-files/mapnik.txt which also slows down the devices to an almost unusable speed.
Is your preferred approach part of mkgmap now? I didn't find it alongside the mapnik typ, and I think it would be useful to share, as an example, or for use. I have been using mkgmap for a very long time and concur that less is better. I did use to use cferrero's typfile and style, which was mostly about adding stoplights and some other things not usually shown. I'd like to see towers/masts as well, survey markers, and various other things that I'm not sure render without typ. (I admit to being a little distant from what's going on as I mainly use OsmAnd, but I carry my etrex 30 as well, so I have two functioning devices in the woods.) Thanks, Greg

Hi Greg For a long time, with my old eTrex HCx, all I used was: - my style based on mkgmap-default - the option --order-by-decreasing-area - TYP sameOrder.txt which is in the distribution, alongside mapnik.txt Whenever I notice a problem, see a good idea or someone reports difficulties that could be resolved by a style change, I tweak my style, and, every now and again, I submit patches to the default style that brings it closer to my version. Recently I've been having to add a few _lines and _polygons to my TYP because of differences between devices. I've also changed a few type codes that make it incompatible with mkgmap-default & mapnik.txt, but I plan to start a dialog on these as well. Once the styles are compatible again, I'll look at submitting another example typ-file. I've attached my style and typ anyway, feel free to take whatever bits you want. Ticker On Tue, 2020-04-07 at 11:03 -0400, Greg Troxel wrote:
Ticker Berkin <rwb-mkgmap@jagit.co.uk> writes:
For both, apart from the above, I much prefer their default rendering rather than, say, {distribution}/examples/typ-files/mapnik.txt which also slows down the devices to an almost unusable speed.
Is your preferred approach part of mkgmap now? I didn't find it alongside the mapnik typ, and I think it would be useful to share, as an example, or for use. I have been using mkgmap for a very long time and concur that less is better. I did use to use cferrero's typfile and style, which was mostly about adding stoplights and some other things not usually shown. I'd like to see towers/masts as well, survey markers, and various other things that I'm not sure render without typ.
(I admit to being a little distant from what's going on as I mainly use OsmAnd, but I carry my etrex 30 as well, so I have two functioning devices in the woods.)
Thanks, Greg
participants (4)
-
Arndt Röhrig
-
Greg Troxel
-
Niccolo Rigacci
-
Ticker Berkin