Handling of Garmin magic label codes (highwayshields etc.) differs from mp-format input to osm-format ?

Hi, i have already asked( "Problem with special Garmin label codes"). I try to use the Garmin magic label codes in the form ~[0x06]B51~[0x1f]Hauptstrasse If i pass this inside a mp-format file mkgmap could handle it. If i triy it with input in osm-format i can't get it to work. I have made an entry in stylefile like highway=* {name '${ref|highway-symbol:oval} ${name|highway-symbol:ele}' | '${ref|highway-symbol:oval}' | '${name}' } where i expect as result: ~[0x06]B51~[0x1f]Hauptstrasse if ref=B51 and name=Hauptstrasse But always the second magic codes is ignored by mkgamp. Is the format of my stylefile entry correct or false.? Or simply will mp-format and osm-format be treaten different by mkgamp in this case? Or what else i have to do to get it working also with osm-input. TIA Gert

A line in my style file looks like this highway=secondary {name '${ref|highway-symbol:oval} ${name}' | '${ref|highway-symbol:oval}' | '${name}' } Difference between your line and above example is that you are using ${name|<symbol>} while above example uses only ${ref|<symbol>}. It might have to do with 'magic' of name = ${name} processing. Hope this helps. On Mon, Oct 5, 2009 at 4:48 PM, Gert Münzel <Gert.Muenzel@netcologne.de>wrote:
Hi, i have already asked( "Problem with special Garmin label codes"). I try to use the Garmin magic label codes in the form ~[0x06]B51~[0x1f]Hauptstrasse If i pass this inside a mp-format file mkgmap could handle it. If i triy it with input in osm-format i can't get it to work. I have made an entry in stylefile like highway=* {name '${ref|highway-symbol:oval} ${name|highway-symbol:ele}' | '${ref|highway-symbol:oval}' | '${name}' } where i expect as result: ~[0x06]B51~[0x1f]Hauptstrasse if ref=B51 and name=Hauptstrasse
But always the second magic codes is ignored by mkgamp. Is the format of my stylefile entry correct or false.? Or simply will mp-format and osm-format be treaten different by mkgamp in this case? Or what else i have to do to get it working also with osm-input.
TIA Gert
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi On 05/10/09 15:48, Gert Münzel wrote:
I try to use the Garmin magic label codes in the form ~[0x06]B51~[0x1f]Hauptstrasse
I have made an entry in stylefile like highway=* {name '${ref|highway-symbol:oval} ${name|highway-symbol:ele}' | '${ref|highway-symbol:oval}' | '${name}' } where i expect as result: ~[0x06]B51~[0x1f]Hauptstrasse if ref=B51 and name=Hauptstrasse
highway-symbol is special and designed to clean up a road reference and then prepend the symbol only if it does contain a number. As the 0x1f separator is not a highway symbol it is not supported by the highway-symbol modifier. In this case, since you don't want to modify the string it would be best to just insert the symbol where you want it to be, however mkgmap does not support that. I don't paricularly like the ~[0x1f] notation since it gives no clue as to what it does, but as it is well known we could just support something like the following: highway=* {name '${ref|highway-symbol:oval}~[0x1f]${name}' ..Steve

On Mon, Oct 5, 2009 at 5:59 PM, Steve Ratcliffe <steve@parabola.me.uk> wrote:
As the 0x1f separator is not a highway symbol it is not supported by the highway-symbol modifier. In this case, since you don't want to modify the string it would be best to just insert the symbol where you want it to be, however mkgmap does not support that.
If I recall, when we were first working on getting the highway symbols to function, we used a hex editor to directly insert the hex codes into the style file entry. Thus, as a work around, it should be theoretically possible to do something like this: highway=* {name '${ref|highway-symbol:oval}<0x1f>${name}' Where "<0x1f>" is the actual hex code 1f, inserted with a hex editor. This might be enough for Gert to test this out without requiring any modifications to mkgmap. Cheers.

@ Steve and @ Clinton Steve wrote:
As the 0x1f separator is not a highway symbol it is not supported by the highway-symbol modifier. In this case, since you don't want to modify the string it would be best to just insert the symbol where you want it to be, however mkgmap does not support that. But mkgmap support it if you take mp-format as input. Only with osm-input it doesn't work. Also i saw entrys for 0x1f in the PrependFilter.java and HighwayshieldFilter.java.
Steve wrote:
I don't paricularly like the ~[0x1f] notation since it gives no clue as to what it does,
Depending on the zoom level, only the first part is visible. By wiping over the object you always can the see the whole label(limited by gps display). The problem with a ~[0x6]B51 Mainstreet is, that normally the whole Label is visible on the description page of the object in GPS e.g. for the case if it is not fully visible on the map page. But with ~[0x6]B51 Mainstreet, only "B51" will be shown on the description page. You need a ~[0x6]B51~[0x1f]Mainstreet construct, so that it can work proper.
but as it is well known we could just support something like the following: highway=* {name '${ref|highway-symbol:oval}~[0x1f]${name}' Sorry, but this only writes "~[0x1f]" in the img and this will be shown as plain text in the label.
Clinton wrote:
highway=* {name '${ref|highway-symbol:oval}<0x1f>${name}' Where "<0x1f>" is the actual hex code 1f, inserted with a hex editor. This might be enough for Gert to test this out without requiring any modifications to mkgmap. Maybe i missunderstood you, but you really mean that i should insert/modiy single bytes with a hex editor in the imgfile?
Your highway=* {name '${ref|highway-symbol:oval}<0x1f>${name}' simply writes "<0x1f>" in the img and this will be shown as plain text in the label. cheers Gert

On 05/10/09 19:02, Gert Münzel wrote:
But mkgmap support it if you take mp-format as input. Only with osm-input it doesn't work. Also i saw entrys for 0x1f in the PrependFilter.java and HighwayshieldFilter.java.
Itsn't it commented out in the HighwayShieldFilter? It may well work with the PrependFilter, try: ${name|prefix:ele}
but as it is well known we could just support something like the following: highway=* {name '${ref|highway-symbol:oval}~[0x1f]${name}' Sorry, but this only writes "~[0x1f]" in the img and this will be shown as plain text in the label.
Yes, exactly it is not currently supported in a style file, but it could be rather easily if that is what people wanted. ..Steve

Steve wrotes on /Mon Oct 5 22:59:50 BST 2009 /
Itsn't it commented out in the HighwayShieldFilter? It may well work with the PrependFilter, try: ${name|prefix:ele} Yes, it's commented out. ${name|prefix:ele} , i have already tried before. Yes it works. BUT ONLY if you use it as single magic code. Actually it seems to be impossible to use more than a single code in style definition.
/ but as it is well known we could just support something like the following: />>>/ highway=* {name '${ref|highway-symbol:oval}~[0x1f]${name}' />>/ Sorry, but this only writes "~[0x1f]" in the img and this will be shown as plain text in the label. / Yes, exactly it is not currently supported in a style file, but it could be rather easily if that is what people wanted. It's surely only a small step closer to a perfect garmin img file out of osm-data, but maybe people will find it a little nice enhancement if they can use the full magic garmin codes. And if its really rather easily to implement it ...
Anyway thanx for your support. .. Gert

On Mon, Oct 5, 2009 at 8:02 PM, Gert Münzel <Gert.Muenzel@netcologne.de> wrote:
Clinton wrote:
highway=* {name '${ref|highway-symbol:oval}<0x1f>${name}' Where "<0x1f>" is the actual hex code 1f, inserted with a hex editor. This might be enough for Gert to test this out without requiring any modifications to mkgmap. Maybe i missunderstood you, but you really mean that i should insert/modiy single bytes with a hex editor in the imgfile?
Yes, you did misunderstand (or I provided an inappropriate explanation): you need to insert the hex code directly into the style file. That means you need to open the style file with a hex editor, find the byte between ${ref|highway-symbol:oval} and ${name}, and change the byte to the hex equivalent of 1f. I don't know if it will work properly here, but it might be worth trying. As I said, this is how we initially tested out the highway symbols function. Cheers

Clinton Gladstone wrotes on /Tue Oct 6 10:06:35 BST 2009:/
Yes, you did misunderstand (or I provided an inappropriate explanation): you need to insert the hex code directly into the stylefile. That means you need to open the style file with a hex editor, find the byte between ${ref|highway-symbol:oval} and ${name}, and change the byte to the hex equivalent of 1f.
Yes, i simply misunderstood. I tried it and it was successfull. I got a 06<highwayshield>1f<streetname> in the img-file. cheers Gert
participants (4)
-
Clinton Gladstone
-
Gert Münzel
-
Ivan Kostoski
-
Steve Ratcliffe