[Patch v1] improve handling of exits

Hi all, attached patch changes mkgmap so that a) the process-exits and process-destination options are also checking highway=primary roads and also those cases were a link divides into two or more further link roads. b) the exit_to tag on a highway=motorway_junction node is ignored when the road is e.g. a highway=trunk and all connected roads are trunk_links. Typically, the exit_to tag contains then a list of hints, but it is not clear which hint is meant for which way. I've uploaded a binary based on r3598: http://files.mkgmap.org.uk/download/266/mkgmap.jar @Dave: Please note the changes in the default style. It would be great if you could test this patch and maybe suggest a better description of the two options. Gerd

On Mon, May 18, 2015 at 7:51 AM, Gerd Petermann < gpetermann_muenchen@hotmail.com> wrote:
@Dave: Please note the changes in the default style. It would be great if you could test this patch and maybe suggest a better description of the two options.
Sorry for the delay in responding. The modified r3598 produced output from the echotags function. I did not see anything regarding the exit_to tags but my test destination tag was processed and this output went to stderr: 4611686018427392234 (168231839) - [highway=motorway_link,destination=Beltline Road East,mkgmap:exit_hint=true,mkgmap:dest_hint=true,bicycle=yes,mkgmap:way-has-pois=true,mkgmap:exit_hint_ref=195A,mkgmap:label:1=Dest: Beltline Road East,oneway=yes] before 4611686018427392234 (168231839) - [highway=motorway_link,destination=Beltline Road East,mkgmap:exit_hint=true,mkgmap:dest_hint=true,bicycle=yes,mkgmap:way-has-pois=true,mkgmap:exit_hint_ref=195A,mkgmap:label:1=Dest: Beltline Road East,oneway=yes] after *(highway=motorway_link | highway=trunk_link) & mkgmap:exit_hint=true &* *mkgmap:dest_hint=true* * { echotags "before";* *name '${destination:ref|subst: =>} ${destination|subst:;=> |subst:/=> }' |* * '${ref|subst: =>} ${destination|subst:;=> |subst:/=> }' |* * '${destination|subst:;=> |subst:/=> }' |* * 'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_name}' |* * 'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_exit_to}' |* * 'Exit ${mkgmap:exit_hint_exit_to}' |* * 'Exit ${mkgmap:exit_hint_name}' |* * 'Exit ${mkgmap:exit_hint_ref}' ;* *echotags "after"* * }* This is my rule for debugging the destination tag and it appears before the rule above: *destination=* & (highway=motorway_link | highway=trunk_link) {name 'Dest: ${destination}' }* My exit_to rule is for points is here: *exit_to=* {name 'Exit ${ref} ${exit_to}' | '${exit_to}' } [0x12615 resolution 24]* This produces the desired output on my maps but doesn't show up in stderr because I haven't yet put echotags into my points style file. Thanks for the good work.... -- Dave Swarthout Homer, Alaska Chiang Mai, Thailand Travel Blog at http://dswarthout.blogspot.com

Okay, just now I added the echotags directive to my points style file: exit_to=* {name 'Exit ${ref} ${exit_to}' | '${exit_to}' ; echotags ""} #[0x12615 resolution 24] Here is a portion of the exit_to tag output to stderr. There are many more of them but this section is typical 39682119 - [highway=motorway_junction,ref=7A,exit:road_ref=OR 569,mkgmap:label:1=Exit 7A Prairie Road,mkgmap:osmid=39682119,exit_to=Prairie Road] 272994915 - [highway=motorway_junction,ref=10,exit:road_ref=OR 569,mkgmap:label:1=Exit 10 Delta Hwy.; Valley River Cnt.; Downtown,mkgmap:osmid=272994915,exit_to=Delta Hwy.; Valley River Cnt.; Downtown] 272994818 - [highway=motorway_junction,ref=10B,exit:road_ref=OR 569,mkgmap:label:1=Exit 10B Delta Hwy. N.; Ayers Rd.,mkgmap:osmid=272994818,exit_to=Delta Hwy. N.; Ayers Rd.] On Tue, May 19, 2015 at 7:08 AM, Dave Swarthout <daveswarthout@gmail.com> wrote:
On Mon, May 18, 2015 at 7:51 AM, Gerd Petermann < gpetermann_muenchen@hotmail.com> wrote:
@Dave: Please note the changes in the default style. It would be great if you could test this patch and maybe suggest a better description of the two options.
Sorry for the delay in responding. The modified r3598 produced output from the echotags function. I did not see anything regarding the exit_to tags but my test destination tag was processed and this output went to stderr:
4611686018427392234 (168231839) - [highway=motorway_link,destination=Beltline Road East,mkgmap:exit_hint=true,mkgmap:dest_hint=true,bicycle=yes,mkgmap:way-has-pois=true,mkgmap:exit_hint_ref=195A,mkgmap:label:1=Dest: Beltline Road East,oneway=yes] before 4611686018427392234 (168231839) - [highway=motorway_link,destination=Beltline Road East,mkgmap:exit_hint=true,mkgmap:dest_hint=true,bicycle=yes,mkgmap:way-has-pois=true,mkgmap:exit_hint_ref=195A,mkgmap:label:1=Dest: Beltline Road East,oneway=yes] after
*(highway=motorway_link | highway=trunk_link) & mkgmap:exit_hint=true &* *mkgmap:dest_hint=true* * { echotags "before";* *name '${destination:ref|subst: =>} ${destination|subst:;=> |subst:/=> }' |* * '${ref|subst: =>} ${destination|subst:;=> |subst:/=> }' |* * '${destination|subst:;=> |subst:/=> }' |* * 'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_name}' |* * 'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_exit_to}' |* * 'Exit ${mkgmap:exit_hint_exit_to}' |* * 'Exit ${mkgmap:exit_hint_name}' |* * 'Exit ${mkgmap:exit_hint_ref}' ;* *echotags "after"* * }*
This is my rule for debugging the destination tag and it appears before the rule above:
*destination=* & (highway=motorway_link | highway=trunk_link) {name 'Dest: ${destination}' }*
My exit_to rule is for points is here:
*exit_to=* {name 'Exit ${ref} ${exit_to}' | '${exit_to}' } [0x12615 resolution 24]*
This produces the desired output on my maps but doesn't show up in stderr because I haven't yet put echotags into my points style file.
Thanks for the good work....
-- Dave Swarthout Homer, Alaska Chiang Mai, Thailand Travel Blog at http://dswarthout.blogspot.com
-- Dave Swarthout Homer, Alaska Chiang Mai, Thailand Travel Blog at http://dswarthout.blogspot.com

Hi Dave, I am not sure if you understand that echotags always worked. The problem is/was that the rule was not executed because the expression evaluated to false. In other words, I did not change the echotags code, I changed the code so that it is more likely that the term "mkgmap:exit_hint=true & mkgmap:dest_hint=true" evaluates to true. Gerd Dave Swarthout wrote
On Mon, May 18, 2015 at 7:51 AM, Gerd Petermann <
gpetermann_muenchen@
wrote:
@Dave: Please note the changes in the default style. It would be great if you could test this patch and maybe suggest a better description of the two options.
Sorry for the delay in responding. The modified r3598 produced output from the echotags function. I did not see anything regarding the exit_to tags but my test destination tag was processed and this output went to stderr:
4611686018427392234 (168231839) - [highway=motorway_link,destination=Beltline Road East,mkgmap:exit_hint=true,mkgmap:dest_hint=true,bicycle=yes,mkgmap:way-has-pois=true,mkgmap:exit_hint_ref=195A,mkgmap:label:1=Dest: Beltline Road East,oneway=yes] before 4611686018427392234 (168231839) - [highway=motorway_link,destination=Beltline Road East,mkgmap:exit_hint=true,mkgmap:dest_hint=true,bicycle=yes,mkgmap:way-has-pois=true,mkgmap:exit_hint_ref=195A,mkgmap:label:1=Dest: Beltline Road East,oneway=yes] after
*(highway=motorway_link | highway=trunk_link) & mkgmap:exit_hint=true &* *mkgmap:dest_hint=true* * { echotags "before";* *name '${destination:ref|subst: =>} ${destination|subst:;=> |subst:/=> }' |* * '${ref|subst: =>} ${destination|subst:;=> |subst:/=> }' |* * '${destination|subst:;=> |subst:/=> }' |* * 'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_name}' |* * 'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_exit_to}' |* * 'Exit ${mkgmap:exit_hint_exit_to}' |* * 'Exit ${mkgmap:exit_hint_name}' |* * 'Exit ${mkgmap:exit_hint_ref}' ;* *echotags "after"* * }*
This is my rule for debugging the destination tag and it appears before the rule above:
*destination=* & (highway=motorway_link | highway=trunk_link) {name 'Dest: ${destination}' }*
My exit_to rule is for points is here:
*exit_to=* {name 'Exit ${ref} ${exit_to}' | '${exit_to}' } [0x12615 resolution 24]*
This produces the desired output on my maps but doesn't show up in stderr because I haven't yet put echotags into my points style file.
Thanks for the good work....
-- Dave Swarthout Homer, Alaska Chiang Mai, Thailand Travel Blog at http://dswarthout.blogspot.com
_______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/Patch-v1-improve-handling-of-exits-tp5845035p... Sent from the Mkgmap Development mailing list archive at Nabble.com.

When you say you didn't change the echotags code, did you rewrite the style rule? If you did that I'm embarrassed to admit I am unable to see the difference. AFAIK I'm using the exact same style file for both runs, but the run with the older executables produced no output. I replaced that jar file with the new one (modified r3598) and all of a sudden output from echotags appeared. Anyway, it's all good. On Tue, May 19, 2015 at 11:03 AM, GerdP <gpetermann_muenchen@hotmail.com> wrote:
Hi Dave,
I am not sure if you understand that echotags always worked. The problem is/was that the rule was not executed because the expression evaluated to false. In other words, I did not change the echotags code, I changed the code so that it is more likely that the term "mkgmap:exit_hint=true & mkgmap:dest_hint=true" evaluates to true.
Gerd
Dave Swarthout wrote
On Mon, May 18, 2015 at 7:51 AM, Gerd Petermann <
gpetermann_muenchen@
wrote:
@Dave: Please note the changes in the default style. It would be great if you could test this patch and maybe suggest a better description of the two options.
Sorry for the delay in responding. The modified r3598 produced output from the echotags function. I did not see anything regarding the exit_to tags but my test destination tag was processed and this output went to stderr:
4611686018427392234 (168231839) - [highway=motorway_link,destination=Beltline Road
East,mkgmap:exit_hint=true,mkgmap:dest_hint=true,bicycle=yes,mkgmap:way-has-pois=true,mkgmap:exit_hint_ref=195A,mkgmap:label:1=Dest:
Beltline Road East,oneway=yes] before 4611686018427392234 (168231839) - [highway=motorway_link,destination=Beltline Road
East,mkgmap:exit_hint=true,mkgmap:dest_hint=true,bicycle=yes,mkgmap:way-has-pois=true,mkgmap:exit_hint_ref=195A,mkgmap:label:1=Dest:
Beltline Road East,oneway=yes] after
*(highway=motorway_link | highway=trunk_link) & mkgmap:exit_hint=true &* *mkgmap:dest_hint=true* * { echotags "before";* *name '${destination:ref|subst: =>} ${destination|subst:;=> |subst:/=> }' |* * '${ref|subst: =>} ${destination|subst:;=> |subst:/=> }' |* * '${destination|subst:;=> |subst:/=> }' |* * 'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_name}' |* * 'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_exit_to}' |* * 'Exit ${mkgmap:exit_hint_exit_to}' |* * 'Exit ${mkgmap:exit_hint_name}' |* * 'Exit ${mkgmap:exit_hint_ref}' ;* *echotags "after"* * }*
This is my rule for debugging the destination tag and it appears before the rule above:
*destination=* & (highway=motorway_link | highway=trunk_link) {name 'Dest: ${destination}' }*
My exit_to rule is for points is here:
*exit_to=* {name 'Exit ${ref} ${exit_to}' | '${exit_to}' } [0x12615 resolution 24]*
This produces the desired output on my maps but doesn't show up in stderr because I haven't yet put echotags into my points style file.
Thanks for the good work....
-- Dave Swarthout Homer, Alaska Chiang Mai, Thailand Travel Blog at http://dswarthout.blogspot.com
_______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/Patch-v1-improve-handling-of-exits-tp5845035p... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- Dave Swarthout Homer, Alaska Chiang Mai, Thailand Travel Blog at http://dswarthout.blogspot.com

Hi Dave, the patch changes the rules in the default style so that exist on primary roads are taken into account. More important for your test case: It also changes the code so that exists on motorway_links to other motorway_links are taken into account. The old code only looked at exits on highway=motorway and highway=trunk, the new code checks these highway types: "motorway", "trunk", "primary", "motorway_link", "trunk_link", "primary_link" So, when you use the patched binary with your own style, the big change is that the condition (highway=motorway_link | highway=trunk_link) & mkgmap:exit_hint=true & mkgmap:dest_hint=true is now true, and that's why echotags is executed. You can double check by adding this rule to your lines file: (mkgmap:exit_hint=* | mkgmap:dest_hint=*) { echotags "hint" } Test this once with the patched binary and once with the normal one and you should see the difference. Gerd From: daveswarthout@gmail.com Date: Tue, 19 May 2015 18:37:26 -0700 To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] [Patch v1] improve handling of exits When you say you didn't change the echotags code, did you rewrite the style rule? If you did that I'm embarrassed to admit I am unable to see the difference. AFAIK I'm using the exact same style file for both runs, but the run with the older executables produced no output. I replaced that jar file with the new one (modified r3598) and all of a sudden output from echotags appeared. Anyway, it's all good. On Tue, May 19, 2015 at 11:03 AM, GerdP <gpetermann_muenchen@hotmail.com> wrote: Hi Dave, I am not sure if you understand that echotags always worked. The problem is/was that the rule was not executed because the expression evaluated to false. In other words, I did not change the echotags code, I changed the code so that it is more likely that the term "mkgmap:exit_hint=true & mkgmap:dest_hint=true" evaluates to true. Gerd Dave Swarthout wrote
On Mon, May 18, 2015 at 7:51 AM, Gerd Petermann <
gpetermann_muenchen@
wrote:
@Dave: Please note the changes in the default style.
It would be great if you could test this patch and maybe suggest
a better description of the two options.
Sorry for the delay in responding. The modified r3598 produced output from
the echotags function. I did not see anything regarding the exit_to tags
but my test destination tag was processed and this output went to stderr:
4611686018427392234 (168231839) -
[highway=motorway_link,destination=Beltline Road
East,mkgmap:exit_hint=true,mkgmap:dest_hint=true,bicycle=yes,mkgmap:way-has-pois=true,mkgmap:exit_hint_ref=195A,mkgmap:label:1=Dest:
Beltline Road East,oneway=yes] before
4611686018427392234 (168231839) -
[highway=motorway_link,destination=Beltline Road
East,mkgmap:exit_hint=true,mkgmap:dest_hint=true,bicycle=yes,mkgmap:way-has-pois=true,mkgmap:exit_hint_ref=195A,mkgmap:label:1=Dest:
Beltline Road East,oneway=yes] after
*(highway=motorway_link | highway=trunk_link) & mkgmap:exit_hint=true &*
*mkgmap:dest_hint=true*
* { echotags "before";*
*name '${destination:ref|subst: =>} ${destination|subst:;=> |subst:/=> }'
|*
* '${ref|subst: =>} ${destination|subst:;=> |subst:/=> }' |*
* '${destination|subst:;=> |subst:/=> }' |*
* 'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_name}' |*
* 'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_exit_to}' |*
* 'Exit ${mkgmap:exit_hint_exit_to}' |*
* 'Exit ${mkgmap:exit_hint_name}' |*
* 'Exit ${mkgmap:exit_hint_ref}' ;*
*echotags "after"*
* }*
This is my rule for debugging the destination tag and it appears before
the
rule above:
*destination=* & (highway=motorway_link | highway=trunk_link) {name 'Dest:
${destination}' }*
My exit_to rule is for points is here:
*exit_to=* {name 'Exit ${ref} ${exit_to}' | '${exit_to}' } [0x12615
resolution 24]*
This produces the desired output on my maps but doesn't show up in stderr
because I haven't yet put echotags into my points style file.
Thanks for the good work....
--
Dave Swarthout
Homer, Alaska
Chiang Mai, Thailand
Travel Blog at http://dswarthout.blogspot.com
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/Patch-v1-improve-handling-of-exits-tp5845035p... Sent from the Mkgmap Development mailing list archive at Nabble.com. _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev -- Dave Swarthout Homer, Alaska Chiang Mai, Thailand Travel Blog at http://dswarthout.blogspot.com _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi all, I've just noticed that this patch was not yet applied. If nobody complains I'll commit it on friday. Gerd GerdP wrote
Hi Dave,
the patch changes the rules in the default style so that exist on primary roads are taken into account. More important for your test case: It also changes the code so that exists on motorway_links to other motorway_links are taken into account. The old code only looked at exits on highway=motorway and highway=trunk, the new code checks these highway types: "motorway", "trunk", "primary", "motorway_link", "trunk_link", "primary_link"
So, when you use the patched binary with your own style, the big change is that the condition (highway=motorway_link | highway=trunk_link) & mkgmap:exit_hint=true & mkgmap:dest_hint=true
is now true, and that's why echotags is executed.
You can double check by adding this rule to your lines file: (mkgmap:exit_hint=* | mkgmap:dest_hint=*) { echotags "hint" }
Test this once with the patched binary and once with the normal one and you should see the difference.
Gerd
From:
daveswarthout@
Date: Tue, 19 May 2015 18:37:26 -0700 To:
mkgmap-dev@.org
Subject: Re: [mkgmap-dev] [Patch v1] improve handling of exits
When you say you didn't change the echotags code, did you rewrite the style rule? If you did that I'm embarrassed to admit I am unable to see the difference. AFAIK I'm using the exact same style file for both runs, but the run with the older executables produced no output. I replaced that jar file with the new one (modified r3598) and all of a sudden output from echotags appeared. Anyway, it's all good.
On Tue, May 19, 2015 at 11:03 AM, GerdP <
gpetermann_muenchen@
> wrote: Hi Dave,
I am not sure if you understand that echotags always worked.
The problem is/was that the rule was not executed because
the expression evaluated to false.
In other words, I did not change the echotags code,
I changed the code so that it is more likely that the
term "mkgmap:exit_hint=true & mkgmap:dest_hint=true"
evaluates to true.
Gerd
Dave Swarthout wrote
On Mon, May 18, 2015 at 7:51 AM, Gerd Petermann <
gpetermann_muenchen@
wrote:
@Dave: Please note the changes in the default style.
It would be great if you could test this patch and maybe suggest
a better description of the two options.
Sorry for the delay in responding. The modified r3598 produced output from
the echotags function. I did not see anything regarding the exit_to tags
but my test destination tag was processed and this output went to stderr:
4611686018427392234 (168231839) -
[highway=motorway_link,destination=Beltline Road
East,mkgmap:exit_hint=true,mkgmap:dest_hint=true,bicycle=yes,mkgmap:way-has-pois=true,mkgmap:exit_hint_ref=195A,mkgmap:label:1=Dest:
Beltline Road East,oneway=yes] before
4611686018427392234 (168231839) -
[highway=motorway_link,destination=Beltline Road
East,mkgmap:exit_hint=true,mkgmap:dest_hint=true,bicycle=yes,mkgmap:way-has-pois=true,mkgmap:exit_hint_ref=195A,mkgmap:label:1=Dest:
Beltline Road East,oneway=yes] after
*(highway=motorway_link | highway=trunk_link) & mkgmap:exit_hint=true &*
*mkgmap:dest_hint=true*
* { echotags "before";*
*name '${destination:ref|subst: =>} ${destination|subst:;=> |subst:/=> }'
|*
* '${ref|subst: =>} ${destination|subst:;=> |subst:/=> }' |*
* '${destination|subst:;=> |subst:/=> }' |*
* 'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_name}' |*
* 'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_exit_to}' |*
* 'Exit ${mkgmap:exit_hint_exit_to}' |*
* 'Exit ${mkgmap:exit_hint_name}' |*
* 'Exit ${mkgmap:exit_hint_ref}' ;*
*echotags "after"*
* }*
This is my rule for debugging the destination tag and it appears before
the
rule above:
*destination=* & (highway=motorway_link | highway=trunk_link) {name 'Dest:
${destination}' }*
My exit_to rule is for points is here:
*exit_to=* {name 'Exit ${ref} ${exit_to}' | '${exit_to}' } [0x12615
resolution 24]*
This produces the desired output on my maps but doesn't show up in stderr
because I haven't yet put echotags into my points style file.
Thanks for the good work....
--
Dave Swarthout
Homer, Alaska
Chiang Mai, Thailand
Travel Blog at http://dswarthout.blogspot.com
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@.org
--
View this message in context: http://gis.19327.n5.nabble.com/Patch-v1-improve-handling-of-exits-tp5845035p...
Sent from the Mkgmap Development mailing list archive at Nabble.com.
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@.org
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-- Dave Swarthout Homer, Alaska Chiang Mai, Thailand Travel Blog at http://dswarthout.blogspot.com
_______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/Patch-v1-improve-handling-of-exits-tp5845035p... Sent from the Mkgmap Development mailing list archive at Nabble.com.
participants (3)
-
Dave Swarthout
-
Gerd Petermann
-
GerdP