mapzen / eraser-map

Privacy-focused mapping application for Android
GNU General Public License v3.0
74 stars 24 forks source link

Destination maneuver is not using TTS formatted verbal_pre_transition_instruction #137

Closed dgearhart closed 8 years ago

dgearhart commented 8 years ago
ecgreb commented 8 years ago

@dgearhart I am having a hard time reproducing this one since for a lot of 3 and 4 digit address numbers I am not seeing a difference in formatting for verbal instructions. For example this one:

https://valhalla.mapzen.com/route?json=%7B%22costing%22%3A%22auto%22%2C%22directions_options%22%3A%7B%22units%22%3A%22miles%22%7D%2C%22locations%22%3A%5B%7B%22lat%22%3A%2240.32239085%22%2C%22lon%22%3A%22-75.13197358%22%7D%2C%7B%22city%22%3A%22Buckingham%22%2C%22lat%22%3A%2240.347278%22%2C%22lon%22%3A%22-75.078129%22%2C%22name%22%3A%223434+Durham+Road%22%2C%22state%22%3A%22Pennsylvania%22%2C%22street%22%3A%223434+Durham+Road%22%7D%5D%7D&api_key=YOUR_KEY_HERE

The final instruction looks like this (text and verbal are the same):

{
begin_shape_index: 169,
time: 0,
type: 6,
end_shape_index: 169,
instruction: "3434 Durham Road is on the left.",
length: 0,
verbal_transition_alert_instruction: "3434 Durham Road will be on the left.",
verbal_pre_transition_instruction: "3434 Durham Road is on the left."
}

Also it appears in the code we are using only verbal formatted instructions for voice commands:

https://github.com/mapzen/eraser-map/blob/master/app/src/main/kotlin/com/mapzen/erasermap/view/VoiceNavigationController.kt

https://github.com/mapzen/on-the-road/blob/master/src/main/java/com/mapzen/valhalla/Instruction.kt#L202

dgearhart commented 8 years ago

@ecgreb i found the issue - the request is setting both of the destination location attributes "name" and "street" to "3434 Durham Road" - for example: screenshot from 2015-12-14 09 05 40

the "name" should be the POI name if there is one - such as "WalMart" The logic is: if there is a name then output that without formatting else if there is a street then output that with TTS formatting for the street name

when input is this: https://valhalla.mapzen.com/route?json={%22costing%22%3A%22auto%22%2C%22directions_options%22%3A{%22units%22%3A%22miles%22}%2C%22locations%22%3A[{%22lat%22%3A%2240.32239085%22%2C%22lon%22%3A%22-75.13197358%22}%2C{%22city%22%3A%22Buckingham%22%2C%22lat%22%3A%2240.347278%22%2C%22lon%22%3A%22-75.078129%22%2C%22state%22%3A%22Pennsylvania%22%2C%22street%22%3A%223434+Durham+Road%22}]}&api_key=YOUR_KEY_HERE

screenshot from 2015-12-14 09 19 43

then output is this: screenshot from 2015-12-14 09 20 48

ecgreb commented 8 years ago

@dgearhart thanks! Nice detective work ... will update.

ecgreb commented 8 years ago

We are going to need a way to determine if the name field for a given search result contains an actual name of if it contains the street address.

Added https://github.com/pelias/pelias-android-sdk/issues/24 to Pelias SDK project.