Speaking highway ref route numbers in letters only

112 views
Skip to first unread message

rickmastfan67

unread,
Aug 12, 2014, 4:29:54 AM8/12/14
to osm...@googlegroups.com
I've been noticing recently, whenever I'm doing a trip to a destination, anytime I'm routed onto a State Highway here in Pennsylvania, it speaks the abbreviation in a way thinking it's a real 'word' instead of just letters.

For example, if the ref tag on the road is 'PA 228' (https://www.openstreetmap.org/way/137186339), it says it's 'Pa 228' (Pa = http://en.wiktionary.org/wiki/Pa#Noun) instead of 'P A 228'.  It does this for all highways around here, and it kinda gets annoying after awhile to be honest.  So, is there a way to force it to just say the letters for anything infront of a number, while still saying any words after the number (example: ref=US 19 Truck - https://www.openstreetmap.org/way/55067239).  If this could be implemented, it would greatly improve the audio for directions here in the USA.

EnSun

unread,
Aug 12, 2014, 9:42:45 AM8/12/14
to osm...@googlegroups.com

On Tuesday, August 12, 2014 4:29:54 AM UTC-4, rickmastfan67 wrote:
 is there a way to force it to just say the letters for anything infront of a number, while still saying any words after the number (example: ref=US 19 Truck - https://www.openstreetmap.org/way/55067239). 

So, "Route 228" becomes "R O U T E 228"? (those are letters in front of numbers". Or worse, "Rt. 228" becomes "R T . 228"? (again, those are letters in front of numbers". Not good!

rickmastfan67

unread,
Aug 12, 2014, 10:24:01 AM8/12/14
to osm...@googlegroups.com
Can you please show me a place that a 'ref=' tag (and not the 'name=' tag) on a way has the word 'route' in front of the highway number.  I know over in Europe that they have highways with mostly just one letter before the number (like A28) which makes it easier for them, as you wouldn't have words show up in abbreviations for states here in the USA.  But in the USA on OSM, we just go with the 2 letter State abbreviation or use 'SR' (SR = State Route) (we're trying to convince the Ohio mappers to convert to using 'OH' instead of 'SR' in the ref tags). Anyways, how about just limiting it to ones that are only 2 letters and a space before the number?  As I said before, this is just for the 'ref=' tag and no other tags would be effected.  Thus, if the 'name=' tag had 'Route 228' or 'Rt. 228', that would still be said the way it is currently in OSMand.

Now, I do acknowledge that there would be a flaw if there where more than one highway route in the ref tag (like this: ref=PA 8;PA 228 - https://www.openstreetmap.org/way/55464401).  I guess in a case like this, you could reset the speaking at the ';' so that the 'PA' would be said in just letters.

Or, how about a different approach --- How about having a dictionary of abbreviations inside of OSMand for two letter abbreviations words that would expand in the speaking part for routing? So, if this 'ref=PA 228' was on the way, OSMand would say 'Pennsylvania 228' instead of 'Pa 228'.  I could live with that for the State abbreviations.

EnSun

unread,
Aug 12, 2014, 10:59:48 AM8/12/14
to osm...@googlegroups.com
I like your idea of dictionary. I think that would be nice. May be someone from osamand can comment on this.

Jack Burke

unread,
Aug 12, 2014, 1:58:18 PM8/12/14
to osm...@googlegroups.com
Does it do this for you for routes that are *only* state highways, or for ones that are dual-badged US and state highways?
 
I've noticed it does this for me for dual-badged routes, but ONLY if the ref tag has a semicolon and no space separating the values (e.g., if the ref is "US 41;GA 3").  For routes that are only state highways, for me it pronounces the letters individually, and it does it if the ref tag includes a space after the semicolon ("US 41; GA 3").

(I posted about this a while back, but I've deleted my original post because I'm rewriting it better.)
 
--jack
 

On Tuesday, August 12, 2014 4:29:54 AM UTC-4, rickmastfan67 wrote:

rickmastfan67

unread,
Aug 13, 2014, 2:13:32 AM8/13/14
to osm...@googlegroups.com


On Tuesday, August 12, 2014 1:58:18 PM UTC-4, Jack Burke wrote:
Does it do this for you for routes that are *only* state highways, or for ones that are dual-badged US and state highways?
 


I just tested this with the simulation mode where the way had the ref tag of 'ref=US 19 Truck;PA 51' (https://www.openstreetmap.org/way/121974047).  It still said 'Pa' (http://en.wiktionary.org/wiki/Pa#Noun) for the 'PA' part for PA-51.  So, it happens with any way that has a PA State Route tagged on it.

It does seem to work ok when there isn't a state route (at least in PA as that's all I have downloaded for OSMand) in the ref tag as it worked ok for the Parkway West here in Pittsburgh (ref=I 376;US 22;US 30).

Anyways Jack, how does OSMand handle stuff like the 7 route segment of highway down in Folkston, GA? (https://www.openstreetmap.org/way/52035534)  Sure, right now the way isn't properly tagged for the state highway refs with the 'GA' part missing, but I'm curious if OSMand chokes on a super long ref like that.  And yes, all of those routes are posted.  Have been there one time to see the major railway junction.  Anyways, Georgia right now is kinda messed up with the 'ref' tags on ways.  Some are 'GA', some 'SR', and several with nothing in front of the number.  Maybe we need a mapathon to get Georgia all on the same page. lol.

Jack Burke

unread,
Aug 13, 2014, 11:33:09 AM8/13/14
to osm...@googlegroups.com
So you don't notice a difference when the ref tag has a semicolon-space as opposed to just a semicolon?  For US routes, it does it properly every time for me, it's only state routes that it mispronounces when there's no space after the semicolon (for refs with multiple values).  It also behaves this way for me with destination tags.
 
It does pretty good with things like "turn left on United States 78  United States 278  G A 5  G A 8  Veterans Memorial Parkway Southwest".  It just takes it a long time to say it all :-)
 
Yeah, a lot of state routes are missing the GA part of the tag; from what I've read (a while back), that is a problem for pretty much all state highways in the U.S.  When the routes were imported, only the route number was imported--the state label was not included.  I don't know the reason for that.  Some folks have been better than others in fixing their state's routes.  I periodically try to 'drive through' the state using JOSM and fix those.  I also try to change the SR ones to GA; the big problem that I run into with those is where there's a tiny sliver of a road segment that I miss.
 

Max Erickson

unread,
Aug 13, 2014, 12:37:15 PM8/13/14
to osm...@googlegroups.com


On Wednesday, August 13, 2014 11:33:09 AM UTC-4, Jack Burke wrote:
 
Yeah, a lot of state routes are missing the GA part of the tag; from what I've read (a while back), that is a problem for pretty much all state highways in the U.S.  When the routes were imported, only the route number was imported--the state label was not included.  I don't know the reason for that.  Some folks have been better than others in fixing their state's routes.  I periodically try to 'drive through' the state using JOSM and fix those.  I also try to change the SR ones to GA; the big problem that I run into with those is where there's a tiny sliver of a road segment that I miss.

In JOSM, a search like 'ref:SR' (where you input the text inside the quotes but not the quotes) should help with tracking the stragglers down. That will match any object where SR appears in the ref. You can also do something like ref="SR 1" to only match a specific ref (there the quotes around SR 1 are important to get that exact ref, without them the search will be for 'ref=SR' and '1').

Selecting objects with a search does make it that much more important to pay attention to what exactly you are changing. For that sort of edit, I usually right click in the selection panel and zoom to the objects I am about to change.

I guess it won't help any for OSMAnd right now, but you may also want to look at the relations while you are at it:

http://wiki.openstreetmap.org/wiki/United_States_roads_tagging#Tagging_with_relations

The next step for a lot of renderers is to use the relations to render the proper shields for the routes, rather than the text of the ref:

http://tile.paulnorman.ca/demo/abbreviated.html#12/33.8068/-84.5762

(note that is just some prototype rendering used to display some information about US road names: https://lists.openstreetmap.org/pipermail/talk-us/2014-July/013388.html )


Max

Jack Burke

unread,
Aug 13, 2014, 5:06:30 PM8/13/14
to osm...@googlegroups.com

On Wednesday, August 13, 2014 12:37:15 PM UTC-4, Max Erickson wrote:

The next step for a lot of renderers is to use the relations to render the proper shields for the routes, rather than the text of the ref:

http://tile.paulnorman.ca/demo/abbreviated.html#12/33.8068/-84.5762

(note that is just some prototype rendering used to display some information about US road names: https://lists.openstreetmap.org/pipermail/talk-us/2014-July/013388.html )


Max
 
 
Oh, that is very nice.  Jack likes!
 
--jack
 

Max Erickson

unread,
Aug 13, 2014, 5:20:08 PM8/13/14
to osm...@googlegroups.com


On Wednesday, August 13, 2014 5:06:30 PM UTC-4, Jack Burke wrote:
 
Oh, that is very nice.  Jack likes!
 
--jack

I was mistaken about the source of the tiles, it's MapQuest open:

http://www.openstreetmap.org/#map=9/40.5524/-75.7205&layers=Q

It's not clear if they are using relations or parsing refs.

Oops.

Here's a real Proof of concept using relations:

http://elrond.aperiodic.net/shields/



Max

rickmastfan67

unread,
Aug 13, 2014, 8:45:54 PM8/13/14
to osm...@googlegroups.com


On Wednesday, August 13, 2014 11:33:09 AM UTC-4, Jack Burke wrote:
I don't know of anywhere in PA that has a 'space' after the ';' in the ref tags.  So, I can't really test that.

Also, as far as I know, all State Routes here in PA have the proper ref tags with the state abbreviation in them.

rickmastfan67

unread,
Aug 13, 2014, 8:46:28 PM8/13/14
to osm...@googlegroups.com
MapQuest Open completely relies on the 'ref=*' tag on the ways to render the shields.  They don't touch relations to do this.  Too bad they can only render a max of two shields on a way at a time, however they have told me they do plan on sometime in the future adding support to allow more than that if needed.

Jack Burke

unread,
Aug 14, 2014, 4:55:26 PM8/14/14
to osm...@googlegroups.com
It might be  worth experimenting with a state route that you use frequently, and edit its ref tag to put a space if it doesn't have one, then see how osmand pronounces it after the next map update (or build your own map file and see).
 
Another question--does it do this for you for PA-only routes (that aren't also U.S. routes)?  And if a route has two route numbers in it (e.g., PA 17;PA23), does it say "semicolon" in between them?  It does that for me if there isn't a space after the semicolon.
 

Harry van der Wolf

unread,
Aug 15, 2014, 6:03:59 AM8/15/14
to osmand
No, please don't mess with OSM data just because the OsmAnd tts does not pronounce it correctly. This is not how it should be done.
One option could be to download the osm.pbf for your state from geofabrik.download.de, convert the osm.pbf to osm, update the tags for the roads you want, convert back to osm.pbf and make your own map of it.

A much better idea IMHO, would be a special dictonary. We already have special_phrases ( https://github.com/osmandapp/OsmAnd-resources/tree/master/specialphrases).
Why not the same for these kind of things?

Harry


--
You received this message because you are subscribed to the Google Groups "Osmand" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osmand+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

rickmastfan67

unread,
Aug 15, 2014, 7:32:00 AM8/15/14
to osm...@googlegroups.com
Just did a quick simulation over a segment of PA-8 & PA-228 (ref=PA 8;PA 228 - https://www.openstreetmap.org/way/55464401).  The 'semicolon' isn't mentioned when OSMand gives the directions.  And yes, it still says 'PA' as 'Pa' (http://en.wiktionary.org/wiki/Pa#Noun) for both of the PA routes when I tested this.
Message has been deleted

Jack Burke

unread,
Aug 15, 2014, 5:58:51 PM8/15/14
to osm...@googlegroups.com
Er, the problem with that download-convert-update-convert-mappy process is that it would only help me.  I think Rick & I are looking for a more permanent solution that will work for everyone.
 
 
"a special dictionary"
 
Does osmand use something like that to pronounce  US routes as United States (e.g., "US 41" is pronounced "United States 41")?  If not, how is that done, and why can't the same be used for U.S. states?
 
For that matter, how would I get it to stop saying "semicolon" in the middle of ref and destination tags that have semicolons separating multiple values?
 
--jack

Jack Burke

unread,
Aug 15, 2014, 6:17:06 PM8/15/14
to osm...@googlegroups.com
Rick,
 
If you have some time, would you mind trying a simulation from https://www.openstreetmap.org/node/358752397 (Morgan County High School, Moreland Avenue, Madison, Morgan, Georgia, 30650, United States of America) to https://www.openstreetmap.org/node/358769457 (Corry Junior High School, Walker Street, Greensboro, Greene, Georgia, 30642, United States of America), with Avoid Motorways selected (and Prefer Motorways deselected, of course)?  And let me know how it pronounces the highways (or at least the first one or two announcements), in particular if it says "semicolon" for that route?
 
--jack

Harry van der Wolf

unread,
Aug 16, 2014, 3:04:56 AM8/16/14
to osmand
2014-08-15 23:58 GMT+02:00 Jack Burke <burk...@gmail.com>:

For that matter, how would I get it to stop saying "semicolon" in the middle of ref and destination tags that have semicolons separating multiple values?
 
--jack


That has nothing to do with Osmand. That's the tts engine implementation. I'm using SVOX with Dutch voice Jan. That one doesn't pronounce semicolons. It brings in a natural, subtile pause like a human voice would do and even changes tone "at the end of the sentence" like a normal human would do.
Same for . , :

Harry

 

rickmastfan67

unread,
Aug 16, 2014, 3:20:23 AM8/16/14
to osm...@googlegroups.com
Jack, what type of Android device are you using anyways?  I'm personally using a Samsung Galaxy Note 10.1 2014 (wifi only) for all my tests as that's the only Android device I have access to.  Not once have I had it say 'semicolon'.

rickmastfan67

unread,
Aug 16, 2014, 3:27:51 AM8/16/14
to osm...@googlegroups.com
I think the reason why you're having the problem there is because there is no abbreviation infront of the second route in the ref tag.  I bet if you fix the OSM data there to add in the 'GA' infront of the '12', the semicolon problem with disappear with the next update of GA data.

Now, I already had a copy of Ohio downloaded, and my tablet does say 'S R' for any ref tags that are 'ref=SR 14'.  Maybe because it couldn't find a real word equivalent for it.

Jack Burke

unread,
Aug 16, 2014, 3:18:36 PM8/16/14
to osm...@googlegroups.com
Replying to both Harry & Rick at the same time, since both your responses lead to the same answer :-)

That has nothing to do with Osmand. That's the tts engine implementation. I'm using SVOX with Dutch voice Jan. That one doesn't pronounce semicolons. It brings in a natural, subtile pause like a human voice would do and even changes tone "at the end of the sentence" like a normal human would do.
Same for . , :

Harry
 
and
 
 
Jack, what type of Android device are you using anyways? I'm personally using a Samsung Galaxy Note 10.1 2014 (wifi only) for all my tests as that's the only Android device I have access to. Not once have I had it say 'semicolon'.
 
 
I'm using a Samsung Galaxy S4, Android version 4.2.2, with the default Samsung tts engine and default U.S. English voice (who I call Samsung Sally).  I can't remember if I've tried the Google tts engine with osmand, so I'll test that this weekend.
 

Jack Burke

unread,
Aug 16, 2014, 3:26:02 PM8/16/14
to osm...@googlegroups.com
No, it happens for routes where there is a GA in front of the route number, too.  I'm completely positive of that, having tested it extensively while driving.
 
It's just that when the ref tag is "US 28;GA 6" without a space, it speaks the semicolon *and* pronounces GA as "gah" like your Pah.  If the ref tag is "US 28; GA 6" with a space, it does NOT speak the semicolon, and pronounces GA as individual letters:  G A.
 
If it would help, I can plan a route (maybe not this weekend, probably next weekend) where I can intentionally drive using roads with both ref formats (with and without space after a semicolon) and record it with audio using DailyRoads Voyager, and you can hear what I'm referring to.  I promise I know what I'm talking about--I'm a computer systems engineeer with more than 15 years' experience, including a background as a software test engineer and QA engineer.  I've tried all sorts of combinations for this issue, except perhaps using the Google tts engine.  (Having said that, I know I'm not perfect.  The results of a test plan are only as good as the plan itself, which is only as good as the imagination of the person writing it.)
 
--jack

Jack Burke

unread,
Aug 21, 2014, 12:48:42 AM8/21/14
to osm...@googlegroups.com
So I've managed to reproduce some of Rick's results.  The Google tts engine pronounces GA as Gah, like Rick's Pah on certain roads.
 
I'm going to make the suggestion that this is primarily an osmand problem.  The tts engines obviously produce different results with identical input; osmand can't be expected to take into account every tts engine out there, but I do think that it should at least present the data to the tts engine in a gramatically correct form; at that point, it becomes the tts engine's problem.  OSM makes that harder by having a non-gramatically-correct standard.
 
From my experiments, I contend that the Samsung engine does a better job:  with proper grammar sent to it, it pronounces the ref tags in a gramatically-correct way.  I think the Google engine actually makes a mistake--it tries to guess what was *meant* and in doing so runs the risk of not saying things that should be said in some cases.
 
With that said, Rick is right; something needs to be done to better say US State highway ref data.
 
--jack

Harry van der Wolf

unread,
Aug 21, 2014, 4:47:52 AM8/21/14
to osmand
I think the simplest patch for OsmAnd would be to check the string for the road references and if it contains two or three characters before a number, it should put a space in between.
In semi code:

If (2 or 3 characters) in (begin of string) of RoadRef
then
   put spaces between characters of RoadRef string
end
pronounce RoadRef string


I could do this easily in python, but I know nothing of java.

Harry



--
Reply all
Reply to author
Forward
0 new messages