logo separator

[mkgmap-dev] FW: Routing parameters

From Dave Swarthout daveswarthout at gmail.com on Sat May 16 22:18:30 BST 2015

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20150516/02a00ab0/attachment-0001.html>


More information about the mkgmap-dev mailing list