element type definition as variable

Hi, excuse me, for example if I have this in my lines style: highway=residential [0x01] how can I make "0x01" a variable? I mean, I would to do that: surface=asphalt -> var=0x01 surface=gravel -> var=0x02 highway=residential [var] It's possible? How? Thanks very much. --enrico -- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html

Hi Enrico I think this is not possible and probably not needed. Instead you can use something like highway=* &var=0x01 [0x01 ...] highway=* &var=0x02 [0x02 ...] ciao, Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von demon.box <e.rossini73@alice.it> Gesendet: Donnerstag, 23. November 2017 18:25:26 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: [mkgmap-dev] element type definition as variable Hi, excuse me, for example if I have this in my lines style: highway=residential [0x01] how can I make "0x01" a variable? I mean, I would to do that: surface=asphalt -> var=0x01 surface=gravel -> var=0x02 highway=residential [var] It's possible? How? Thanks very much. --enrico -- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

ok, thanks very much Gerd! excuse me but I have another question for you... ;-) with my style I display before the name tag of the road and then (with the "continue" command) I display the name of the relation on the the same highway but why I have 2 different result in MapSource? <http://gis.19327.n8.nabble.com/file/t339261/1.jpg> <http://gis.19327.n8.nabble.com/file/t339261/2.jpg> I mean why in the image n. 1 the first line is the name of the relation and the second line is the name of the highway but in the image n. 2 the first line is the name of the highway and the second is the name of the relation? what can I make to have always the name of the highway for first line and the name of the relation in the second line? THANKS. --enrico -- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html

Hi Enrico, I guess it depends on how you create the labels. I think the best way to find out what happens is to use echotags, e.g. if you have highway=* & ref=* {name ...} change it to highway=* & ref=* {echotags "before"; name ...; echotags "after"} where "name ..." stands for the action that you use to set mkgmap:label:1 .. mkgmap:label:4. Use this with a small osm input file and check the output of mkgmap. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von demon.box <e.rossini73@alice.it> Gesendet: Samstag, 25. November 2017 19:18:59 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] element type definition as variable ok, thanks very much Gerd! excuse me but I have another question for you... ;-) with my style I display before the name tag of the road and then (with the "continue" command) I display the name of the relation on the the same highway but why I have 2 different result in MapSource? <http://gis.19327.n8.nabble.com/file/t339261/1.jpg> <http://gis.19327.n8.nabble.com/file/t339261/2.jpg> I mean why in the image n. 1 the first line is the name of the relation and the second line is the name of the highway but in the image n. 2 the first line is the name of the highway and the second is the name of the relation? what can I make to have always the name of the highway for first line and the name of the relation in the second line? THANKS. --enrico -- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd, I did a lot of tests but in the end I concluded that it seems to me that mkgmap behaves differently with the same tags. I mean that having the same identical tags that differ only for the tag name, sometimes the tag name is put first and sometimes per second, I do not understand why... is it for the preserve-element-order option? depends on the order of objects id? what do you think about it? thanks --enrico -- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html

Hi Enrico, I am not sure what you mean. Maybe you see different results without --preserve-element-order when a way is member of multiple relations ? I assume you are looking at specific ways. Please let us know the ids. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von demon.box <e.rossini73@alice.it> Gesendet: Montag, 27. November 2017 10:15:16 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] element type definition as variable Hi Gerd, I did a lot of tests but in the end I concluded that it seems to me that mkgmap behaves differently with the same tags. I mean that having the same identical tags that differ only for the tag name, sometimes the tag name is put first and sometimes per second, I do not understand why... is it for the preserve-element-order option? depends on the order of objects id? what do you think about it? thanks --enrico -- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd, thanks very much for your attention and patience... ;-) I'm testing this 3 ways: Via Ermanno Margheriti http://www.openstreetmap.org/way/301439666 Via Maniva http://www.openstreetmap.org/way/304137562 Via Trento http://www.openstreetmap.org/way/304455618 This is my only simply style for this test: lines ===== highway=* & name=* & (route_name=* | ref=*) {name '${name}'} [0x09 road_class=0 road_speed=1 resolution 24 continue] highway=* & route_type ~ '.*hiking.*' {name '${route_ref1|highway-symbol:oval} ${route_name}' | '${route_ref1|highway-symbol:oval}' | '${route_name}'} (highway=secondary | highway=secondary_link) & surface=asphalt {name '${ref|highway-symbol:hbox} ${route_name}' | '${ref|highway-symbol:hbox}'} [0x04 road_class=2 road_speed=2 resolution 22 continue] <finalize> name=* {name '${name}'} relations ===== type=route & (route=hiking) { apply { set route_type='$(route_type), ${route}' | '${route}'; set route_ref1='$(route_ref1), ${ref}' | '${ref}'; set route_name='$(route_name) | ${name}' | '${name} (${alt_name})' | '${name}' } } and this is the result with --preserve-element-order option: Via Ermanno Margheriti <http://gis.19327.n8.nabble.com/file/t339261/1.jpg> Via Maniva <http://gis.19327.n8.nabble.com/file/t339261/2.jpg> Via Trento <http://gis.19327.n8.nabble.com/file/t339261/3.jpg> and this is the result without --preserve-element-order option: Via Ermanno Margheriti <http://gis.19327.n8.nabble.com/file/t339261/1b.jpg> Via Maniva <http://gis.19327.n8.nabble.com/file/t339261/2b.jpg> Via Trento <http://gis.19327.n8.nabble.com/file/t339261/3b.jpg> Finally I mean... how can I display the name always for first? THANKS. --enrico -- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html

Hi Enrico, if you add the echotags statements as I have proposed you'll find that your style doesn't apply the first rule in lines to https://www.openstreetmap.org/way/304455618 because the rules in relations do not match. Attached is the modified lines file and the output using the command java -jar mkgmap.jar --route --style-file=mystyles\test test.osm 2> log.txt Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von demon.box <e.rossini73@alice.it> Gesendet: Montag, 27. November 2017 11:29:16 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] element type definition as variable Hi Gerd, thanks very much for your attention and patience... ;-) I'm testing this 3 ways: Via Ermanno Margheriti http://www.openstreetmap.org/way/301439666 Via Maniva http://www.openstreetmap.org/way/304137562 Via Trento http://www.openstreetmap.org/way/304455618 This is my only simply style for this test: lines ===== highway=* & name=* & (route_name=* | ref=*) {name '${name}'} [0x09 road_class=0 road_speed=1 resolution 24 continue] highway=* & route_type ~ '.*hiking.*' {name '${route_ref1|highway-symbol:oval} ${route_name}' | '${route_ref1|highway-symbol:oval}' | '${route_name}'} (highway=secondary | highway=secondary_link) & surface=asphalt {name '${ref|highway-symbol:hbox} ${route_name}' | '${ref|highway-symbol:hbox}'} [0x04 road_class=2 road_speed=2 resolution 22 continue] <finalize> name=* {name '${name}'} relations ===== type=route & (route=hiking) { apply { set route_type='$(route_type), ${route}' | '${route}'; set route_ref1='$(route_ref1), ${ref}' | '${ref}'; set route_name='$(route_name) | ${name}' | '${name} (${alt_name})' | '${name}' } } and this is the result with --preserve-element-order option: Via Ermanno Margheriti <http://gis.19327.n8.nabble.com/file/t339261/1.jpg> Via Maniva <http://gis.19327.n8.nabble.com/file/t339261/2.jpg> Via Trento <http://gis.19327.n8.nabble.com/file/t339261/3.jpg> and this is the result without --preserve-element-order option: Via Ermanno Margheriti <http://gis.19327.n8.nabble.com/file/t339261/1b.jpg> Via Maniva <http://gis.19327.n8.nabble.com/file/t339261/2b.jpg> Via Trento <http://gis.19327.n8.nabble.com/file/t339261/3b.jpg> Finally I mean... how can I display the name always for first? THANKS. --enrico -- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

ok but this 2 ways: Via Ermanno Margheriti http://www.openstreetmap.org/way/301439666 Via Maniva http://www.openstreetmap.org/way/304137562 are members of the the same 2 relation and I don't understand why the mkgmap (e.g. with --preserve-element-order) put "Via Maniva" for first and "Via Ermanno Margheriti" for second... thanks --enrico -- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html

Hi Enrico, well, I also don't know exactly what happens here. Your style creates 2 lines for each of the two ways (this is probably not a good idea when you use --route) . One has type 0x09 and only the name, the other 0x04 and the label "x7 Sentiero Brigata Fiamme Verdi Ermanno Margheriti" where x7 stands for the symbol:hbox. Why do you create two ways and not two labels for each way? Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von demon.box <e.rossini73@alice.it> Gesendet: Montag, 27. November 2017 12:26:09 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] element type definition as variable ok but this 2 ways: Via Ermanno Margheriti http://www.openstreetmap.org/way/301439666 Via Maniva http://www.openstreetmap.org/way/304137562 are members of the the same 2 relation and I don't understand why the mkgmap (e.g. with --preserve-element-order) put "Via Maniva" for first and "Via Ermanno Margheriti" for second... thanks --enrico -- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

... very interesting!!! Well, I don't mind the --route option... So how would you create 2 labels for each way instead of two ways? Thanks a lot. --enrico -- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html

See addlabel in the style manual Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von demon.box <e.rossini73@alice.it> Gesendet: Montag, 27. November 2017 14:25:48 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] element type definition as variable ... very interesting!!! Well, I don't mind the --route option... So how would you create 2 labels for each way instead of two ways? Thanks a lot. --enrico -- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd but with addlabel fuction the result is label1+label2 etc. I mean if I have this: name1=Via Maniva (name of the way) name2=Sentiero Brigata Fiamme Verdi Ermanno Margheriti (name of the relation) I would have a rendering like this on the way object: line1 Via Maniva line2 Sentiero Brigata Fiamme Verdi Ermanno Margheriti with addlabel function the result is: line1 Via Maniva (Sentiero Brigata Fiamme Verdi Ermanno Margheriti) please, what do you think? thanks --enrico -- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html

Not sure if Garmin supports what you want. Do you know a map that looks like this? If yes, try to find out what the style does. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von demon.box <e.rossini73@alice.it> Gesendet: Montag, 27. November 2017 15:39:50 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] element type definition as variable Hi Gerd but with addlabel fuction the result is label1+label2 etc. I mean if I have this: name1=Via Maniva (name of the way) name2=Sentiero Brigata Fiamme Verdi Ermanno Margheriti (name of the relation) I would have a rendering like this on the way object: line1 Via Maniva line2 Sentiero Brigata Fiamme Verdi Ermanno Margheriti with addlabel function the result is: line1 Via Maniva (Sentiero Brigata Fiamme Verdi Ermanno Margheriti) please, what do you think? thanks --enrico -- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

oh, at this moment only my map looks like that but unfortunately with the strange problem as above... it's strange... what do you thing about this strange problem? I'm really the only one that use 2 lines for labels? thanks. --enrico -- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html

Hi Gerd, I would tell you that Garmin fully and perfectly supports (=display) what I want and MapSource/BaseCamp too and in my opinion, it looks very good ;-) The only problem is the order of display of the 2 lines in some cases but I don't understand why.... I don't understand if this problem depends on the id number of the object... Thanks. --enrico -- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html

Hi Enrico, my understanding is this: The Garmin Renderer collects at all the labels of the ways in the current view, next it starts to calculate possible positions so that labels don't overlap. If that is true, the position of the label depends on the length of the displayed text. I see no way to tell the Garmin software which label has to come first and I would be surprised if the Renderer "understands" that your two lines describe the same object. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von demon.box <e.rossini73@alice.it> Gesendet: Montag, 27. November 2017 17:11:55 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] element type definition as variable Hi Gerd, I would tell you that Garmin fully and perfectly supports (=display) what I want and MapSource/BaseCamp too and in my opinion, it looks very good ;-) The only problem is the order of display of the 2 lines in some cases but I don't understand why.... I don't understand if this problem depends on the id number of the object... Thanks. --enrico -- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

My maps also have multiple labels and the same issues. To me it looks like Garmin is rendering the order totally random, I cant control it either. ________________________________ Van: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> namens Gerd Petermann <gpetermann_muenchen@hotmail.com> Verzonden: maandag 27 november 2017 08:42:16 Aan: Development list for mkgmap Onderwerp: Re: [mkgmap-dev] element type definition as variable Hi Enrico, my understanding is this: The Garmin Renderer collects at all the labels of the ways in the current view, next it starts to calculate possible positions so that labels don't overlap. If that is true, the position of the label depends on the length of the displayed text. I see no way to tell the Garmin software which label has to come first and I would be surprised if the Renderer "understands" that your two lines describe the same object. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von demon.box <e.rossini73@alice.it> Gesendet: Montag, 27. November 2017 17:11:55 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] element type definition as variable Hi Gerd, I would tell you that Garmin fully and perfectly supports (=display) what I want and MapSource/BaseCamp too and in my opinion, it looks very good ;-) The only problem is the order of display of the 2 lines in some cases but I don't understand why.... I don't understand if this problem depends on the id number of the object... Thanks. --enrico -- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

ligfietser wrote
My maps also have multiple labels and the same issues.
-- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html

Hi Enrico, oops, just noticed a typo in my changes. Here are the corrected files Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von demon.box <e.rossini73@alice.it> Gesendet: Montag, 27. November 2017 11:29:16 An: mkgmap-dev@lists.mkgmap.org.uk Betreff: Re: [mkgmap-dev] element type definition as variable Hi Gerd, thanks very much for your attention and patience... ;-) I'm testing this 3 ways: Via Ermanno Margheriti http://www.openstreetmap.org/way/301439666 Via Maniva http://www.openstreetmap.org/way/304137562 Via Trento http://www.openstreetmap.org/way/304455618 This is my only simply style for this test: lines ===== highway=* & name=* & (route_name=* | ref=*) {name '${name}'} [0x09 road_class=0 road_speed=1 resolution 24 continue] highway=* & route_type ~ '.*hiking.*' {name '${route_ref1|highway-symbol:oval} ${route_name}' | '${route_ref1|highway-symbol:oval}' | '${route_name}'} (highway=secondary | highway=secondary_link) & surface=asphalt {name '${ref|highway-symbol:hbox} ${route_name}' | '${ref|highway-symbol:hbox}'} [0x04 road_class=2 road_speed=2 resolution 22 continue] <finalize> name=* {name '${name}'} relations ===== type=route & (route=hiking) { apply { set route_type='$(route_type), ${route}' | '${route}'; set route_ref1='$(route_ref1), ${ref}' | '${ref}'; set route_name='$(route_name) | ${name}' | '${name} (${alt_name})' | '${name}' } } and this is the result with --preserve-element-order option: Via Ermanno Margheriti <http://gis.19327.n8.nabble.com/file/t339261/1.jpg> Via Maniva <http://gis.19327.n8.nabble.com/file/t339261/2.jpg> Via Trento <http://gis.19327.n8.nabble.com/file/t339261/3.jpg> and this is the result without --preserve-element-order option: Via Ermanno Margheriti <http://gis.19327.n8.nabble.com/file/t339261/1b.jpg> Via Maniva <http://gis.19327.n8.nabble.com/file/t339261/2b.jpg> Via Trento <http://gis.19327.n8.nabble.com/file/t339261/3b.jpg> Finally I mean... how can I display the name always for first? THANKS. --enrico -- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (3)
-
demon.box
-
Gerd Petermann
-
lig fietser