logo separator

[mkgmap-dev] FW: Routing parameters

From Dave Swarthout daveswarthout at gmail.com on Sun May 17 18:58:34 BST 2015

Yes, that explains how the Garmin can display a destination even if an
exit_to tag does not exist. I also understand better now, after your
clarifications, how the destination code works with the mkgmap hinting
variables.

I'm still having trouble getting the echotags command to work, even with
your package. It's complicated to explain because I'm trying to keep your
code separate from my stuff but I will keep trying. In the meantime, I
solved the problem another way. I merely created two style rules to process
exit_to and destination tags so they display on my maps. Now, when I drive
past exits the tagging data, if present, will display. In addition I can
easily tell from my desktop in Basecamp whether the exit_to tag has been
added on that particular node and if not, I can add it myself.

destination=* {name 'Dest: ${destination}' }   #lines style file

exit_to=* {name 'Exit ${ref} ${exit_to}' | '${exit_to}' }  [0x12615
resolution 24]  #points style file - uses an icon I created

I don't think these two rules will affect the processing of the following
rules that we've been discussing because those check highway=*_link tags.
At any rate, I have what I need for now.

I'll let you know about my trials with the echotags command later.

Thanks very much,

Dave

PS: Thanks for including that Java code snippet. I can understand why
placing an exit_to tag on highways other than trunk or motorway will never
show up. The code only processes links for motorways and trunks. Just in
passing let me say it would be helpful if primary highways were included
there as many of those have exits similar to motorways. But that's a topic
for another day.


On Sun, May 17, 2015 at 8:24 AM, Gerd Petermann <
gpetermann_muenchen at hotmail.com> wrote:

> Hi all,
>
> okay, I have now analysed a few situations and I think
> one problem with the documentation of the --process-exits
> and --process-destination option is that it doesn't clearly explain
> what problem you have when you don't use the option.
>
> My understanding now is  this:
> When Garmin calculates a  route and it finds
> a *_link way with type 0x08 or 0x09
> on that route it looks for the name
> of the next road which is not a link. This name is used for the
> "exit to ..." messsage.
> When you want to see / here the information in the destination=* tag
> or the exit_to=* tag mkgmap has to create a way that is not a link
> and that has the wanted name.
> The options --process-exits and process-destination prepare this
> by splitting the link way and creating a short way tagged  with as much
> info as available
> while the style rules are used to calculate the name.
>
> I see a few problems regarding the algo, esp. when a motorway
> splits into two motorway_link roads. The current algo seems to
> add the exit_to tag to both links, see e.g. node 97002577.
> I guess it should ignore the exit_to tag in this case?
>
> The current source also ignores the tags exit_to:left / exit_to:right.
> These tags are not often used, so I think this problem is small.
>
> Does all that make sense?
>
> Gerd
>
> ------------------------------
> From: daveswarthout at gmail.com
> Date: Sat, 16 May 2015 15:43:20 -0700
> To: mkgmap-dev at lists.mkgmap.org.uk
> Subject: Re: [mkgmap-dev] FW: Routing parameters
>
>
> Also, not to be a pest, but does anyone know how the exit_to tag is
> processed?
>
> On Sat, May 16, 2015 at 2:18 PM, Dave Swarthout <daveswarthout at gmail.com>
> wrote:
>
> Thanks for the help but the echotags directive does not work for me the
> way you have it. I've tried everything I can think of to make it go. Spaces
> before and after, semicolon or no semicolon, braces or no braces  - I get
> nothing in my stderr file.
>
> I tried to use echotags in a simplified rule just to make sure I was
> writing the output to the correct file. It appears to be a very fussy
> command...
>
> this works
>
> (highway=motorway_link | highway=trunk_link)     { echotags "motorway or
> trunk link seen" }
>
> but this does not
>
> (highway=motorway_link | highway=trunk_link)     { echotags }
>
> nor does this
>
> (highway=motorway_link | highway=trunk_link)     {echotags}
>
> According to the style manual, all those statements should produce output.
> However, the style manual isn't very informative unfortunately.
>
> Your suggestion
>
> (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"
>        }
>
> produced nothing at all. I know there must be a way to debug these blasted
> rules but the echotags and echo command don't seem to work all that well.
>
> On Sat, May 16, 2015 at 12:22 PM, GerdP <gpetermann_muenchen at hotmail.com>
> wrote:
>
> Hi Dave,
>
> well, I am not an expert for the styles nor did I write the java code
> in LinkDestinationHook.java, but I try again:
>
> The action block of the rule starts with name, so what it does is to set
> the
> mkgmap:label:1 tag. This is explained in the style manual.
> The contents of the tags like mkgmap:exit_hint_ref depends on the OSM data
> and what the java code in LinkDestinationHook.java does.
> If you want to find out what values are passed to the rule and
> what the action block changes, use the echotags action:
> (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"
>        }
>
> BTW: You posted a rule which doesn't appear in the default style,
> the phrase "highway=road" looks wrong there.
>
> Ciao,
> Gerd
>
>
> Dave Swarthout wrote
> > @Gerd,
> >
> > There is no problem and your brief explanation helped. Everything is
> > working fine but I wanted to understand the logic of the rule better. But
> > because I don't have any way to experiment with running different strings
> > through those filters I'm having trouble visualizing what they are doing.
> > In the style manual some examples of the subst filter in action are shown
> > for illustrative purposes:
> >
> > Example, if name ="Queen Street"
> > ${name|subst:"Queen=>"} returns " Street"
> > ${name|subst:"Queen=>King"} returns "King Street"
> > ${name|subst:".*\s~>"} returns "Street"
> >
> > I was wanting some similar explanation for how that long rule works.
> > Something like this:
> >
> > If the following tag exists on a way, destination:ref=US 20;Rochester
> > the results will be
> > ????
> >
> > I was not seeing what this part of that single long rule was doing until
> > you mentioned cleaning up blanks and semicolons:
> >
> > name '${destination:ref|subst: =>} ${destination|subst:;=> |subst:/=> }'
> >
> > To me it appeared to be setting the name of the way to blank or null if
> it
> > encounters the tag destination:ref but now I understand it is eliminating
> > blanks and other punctuation because I noticed the blank character
> > following the colon in the subst command. So that means the second part
> > removes semicolons. But why is it doing that? And what part gets passed
> to
> > the Garmin "assistant" who then voices the information as the exit on a
> > route is approached?
> >
> > Continuing: After all the punctuation has been stripped from the
> > destination tag we move to the next part of the rule.
> >
> >           'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_name}' |
> > highway=road
> >          '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}'
> >
> > This seems to be setting a variable named "Exit" to whatever is contained
> > in the mkgmap internal variables. Is that what's happening? Where are
> > those
> > variables defined and set? Where does the data come from?
> >
> > Another big question is about the exit_to tag. Take this example of a
> > motorway junction node. No destination tag appears on the linking way
> > itself but my Garmin will speak the words properly as you approach Exit
> > 10:
> >
> > highway=motorway_junction
> > ref:Exit 10
> > exit_to:Greenville;South NC 40; US 421
> >
> > I cannot find a rule that tells me how an exit_to tag is handled. Where
> > does that information get processed? And how does the "assistant" know
> > what
> > words to speak?
> >
> > In summary, those are the questions I'm trying to answer. Now that I'm
> > writing style rules of my own I want to better understand how they work.
> > It's a slow process, especially when the examples in the manual are so
> > simple. Perhaps a more complex, real world, example would help future
> > mappers.
> >
> > Dave
> >
> >
> > On Sat, May 16, 2015 at 3:04 AM, Gerd Petermann <
>
> > gpetermann_muenchen@
>
> >> wrote:
> >
> >>
> >>
> >> ------------------------------
> >> From:
>
> > gpetermann_muenchen@
>
> >> To:
>
> > daveswarthout@
>
> >> Subject: RE: [mkgmap-dev] Routing parameters
> >> Date: Sat, 16 May 2015 12:02:22 +0200
> >>
> >>
> >> Hi Dave,
> >>
> >> not sure what the problem is.
> >> The subst filters are just used to remove some blanks or semicolons.
> >> The rest is more or less "a list of alternative expressions separated
> >> with
> >> a vertical bar",
> >> you can search for that term in the style manual:
> >> http://www.mkgmap.org.uk/doc/pdf/style-manual.pdf
> >>
> >> I've never tried these options because I use my GPS only for cycling,
> >> but my understanding is that the types 0x08 and 0x09 are special
> >> as they instruct the Garmin device to use the name of the road for the
> >> destination hint, and these rules are used to fill this name with useful
> >> information.
> >>
> >> Does that help?
> >>
> >> Gerd
> >>
> >> ------------------------------
> >> From:
>
> > daveswarthout@
>
> >> Date: Fri, 15 May 2015 17:51:13 -0700
> >> To:
>
> > mkgmap-dev at .org
>
> >> Subject: Re: [mkgmap-dev] Routing parameters
> >>
> >> Yes, as you can see above, I  understand the intent of those two
> options.
> >> But if someone could further explain what's happening in the rule, I
> >> would
> >> be most appreciative.
> >>
> >> I'm guessing the first part assigns a name or ref if one appears in the
> >> tagging but understanding the logic of the series of "subst" filters
> >> following that is, for a newbie, quite challenging.
> >>
> >> On Fri, May 15, 2015 at 12:17 PM, GerdP <
>
> > gpetermann_muenchen@
>
> > >
> >> wrote:
> >>
> >> Hi Dave,
> >>
> >> please check the documentation for --process-destination and
> >> --process-exits:
> >> http://www.mkgmap.org.uk/doc/options
> >>
> >> If I got this right, these option mark exits so that Garmin knows where
> >> they are where they lead.
> >>
> >> Gerd
> >>
> >>
> >> Dave Swarthout wrote
> >> > I am curious to know how mkgmap handles the display of and text to
> >> speech
> >> > aspects of motorway junctions. It's hard to test for this without
> >> actually
> >> > creating a route and then driving it to see and hear what the Garmin
> is
> >> > doing with the data or to discover where it gets the information from.
> >> >
> >> > I'm assuming that whatever one puts in the exit_to=* tag gets
> displayed
> >> > and
> >> > spoken by the Garmin "assistant". Does mkgmap ever use the
> >> destination=*
> >> > tag, and if so under what circumstances?
> >> >
> >> > I found this rule in the lines style sheet, but I do not understand it
> >> > well
> >> > enough to help me answer my question
> >> >
> >> > (highway=motorway_link | highway=trunk_link) & mkgmap:exit_hint=true &
> >> > mkgmap:dest_hint=true
> >> >   { name '${destination:ref|subst: =>} ${destination|subst:;=>
> >> |subst:/=>
> >> > }' |
> >> >          '${ref|subst: =>} ${destination|subst:;=> |subst:/=> }' |
> >> >          '${destination|subst:;=> |subst:/=> }' |
> >> >          'Exit ${mkgmap:exit_hint_ref} ${mkgmap:exit_hint_name}' |
> >> > highway=road
> >> >          '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}'
> >> >        }
> >> >
> >> >
> >> > As always, thanks in advance to any help you can provide.
> >> >
> >> > Dave
> >> >
> >> > --
> >> > Dave Swarthout
> >> > Homer, Alaska
> >> > Chiang Mai, Thailand
> >> > Travel Blog at http://dswarthout.blogspot.com
> >> >
> >> > _______________________________________________
> >> > mkgmap-dev mailing list
> >>
> >> > mkgmap-dev at .org
> >>
> >> > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> >>
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://gis.19327.n5.nabble.com/Routing-parameters-tp5844762p5844766.html
> >> Sent from the Mkgmap Development mailing list archive at Nabble.com.
> >> _______________________________________________
> >> mkgmap-dev mailing list
> >>
>
> > mkgmap-dev at .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 at .org
>
> >> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> >>
> >> _______________________________________________
> >> mkgmap-dev mailing list
> >>
>
> > mkgmap-dev at .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 at .org
>
> > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
>
>
>
>
>
> --
> View this message in context:
> http://gis.19327.n5.nabble.com/Routing-parameters-tp5844762p5844865.html
> Sent from the Mkgmap Development mailing list archive at Nabble.com.
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at 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
>
>
>
>
> --
> Dave Swarthout
> Homer, Alaska
> Chiang Mai, Thailand
> Travel Blog at http://dswarthout.blogspot.com
>
> _______________________________________________ mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
>
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20150517/d10d0a01/attachment-0001.html>


More information about the mkgmap-dev mailing list