brouter icon indicating copy to clipboard operation
brouter copied to clipboard

Always process voice hints for brouter-web?

Open nrenner opened this issue 2 years ago • 2 comments

brouter-web has a new option for client-side export in the binary Garmin FIT format, using an external library (brouter-web#641).

The question now is, how to (automatically?) include voice hints for the FIT format?

Adding an extra turnInstructionMode seems superfluous. The need to choose a turnInstructionMode only really exists because of the GPX format with multiple variants.

A generic option would be the profile default turnInstructionMode=1 (auto-choose), but that is just a placeholder and currently defaults to 0 (none).

What is the overhead of processing voice hints? Can we send a timode=1 parameter for all internal (geojson) brouter-web requests?

nrenner avatar Apr 13 '23 16:04 nrenner

You could send all timode values greater zero (1..7) with format 'geojson'. All should return with a 'voicehint' section.

Adding an extra turnInstructionMode seems superfluous.

Yes, that is not a way. A new format "fit" would do the job. But I don't know if there is any interest in clients other than the web client.

afischerdev avatar Apr 14 '23 07:04 afischerdev

What is the overhead of processing voice hints?

I'm unable to measure any meaningful performance difference between turning voice hint processing on or off for both short and long segments. Here is an example for a 50k route:

> export URL="http://localhost:17777/?lonlats=13.010935,52.40158|13.581065,52.534464\
&profile=trekking&alternativeidx=0&format=geojson"
> export CURL="curl --compressed -o /dev/null -s"
>
> hyperfine --warmup 2 --parameter-list timode 0,2 '$CURL "$URL&timode={timode}"'
Benchmark 1: $CURL "$URL&timode=0"
Time (mean ± σ):      2.931 s ±  0.024 s    [User: 0.006 s, System: 0.005 s]
Range (min … max):    2.885 s …  2.964 s    10 runs

Benchmark 2: $CURL "$URL&timode=2"
Time (mean ± σ):      2.923 s ±  0.026 s    [User: 0.004 s, System: 0.006 s]
Range (min … max):    2.889 s …  2.975 s    10 runs

Summary
'$CURL "$URL&timode=2"' ran
1.00 ± 0.01 times faster than '$CURL "$URL&timode=0"'

rkflx avatar Jul 18 '23 10:07 rkflx