Speed limit warning should use speed unit instead of distance unit

38 views
Skip to first unread message

Simon Liebold

unread,
Aug 14, 2019, 5:43:52 PM8/14/19
to Osmand
As an European driving in the US, I like to set the distance units to kilometers while keeping the speed units in miles per hour (see screenshots).  However, when exceeding the speed limit, it gives an audible warning (i.e. "Speed limit 88." when the limit is actually 55 mph.)

Is there a trick to make the speed limit warnings use the speed unit set in the preferences?

Simon
new-Screenshot_20190812-173341.jpg
new-Screenshot_20190812-173400.jpg
Screenshot_20190812-182006__01.jpg

Simon Liebold

unread,
Aug 14, 2019, 10:07:54 PM8/14/19
to Osmand
It's in OsmAnd/OsmAnd/src/net/osmand/plus/helpers/WaypointHelper.java:

    private static AlarmInfo createSpeedAlarm(MetricsConstants mc, float mxspeed, Location loc, float delta) {
        AlarmInfo speedAlarm = null;
        if (mxspeed != 0 && loc != null && loc.hasSpeed() && mxspeed != RouteDataObject.NONE_MAX_SPEED) {
            if (loc.getSpeed() > mxspeed + delta) {
                int speed;
                if (mc == MetricsConstants.KILOMETERS_AND_METERS) {
                    speed = Math.round(mxspeed * 3.6f);
                } else {
                    speed = Math.round(mxspeed * 3.6f / 1.6f);
                }
                speedAlarm = AlarmInfo.createSpeedLimit(speed, loc);
            }
        }
        return speedAlarm;
    }

In if (mc == MetricsConstants.KILOMETERS_AND_METERS) it just looks up the general setting length units. It doesn't  use the speed unit setting from the navigation profiles.

Harry van der Wolf

unread,
Aug 15, 2019, 8:41:05 AM8/15/19
to osmand
Hi,

Please make this an issue in the issue tracker: https://github.com/osmandapp/Osmand/issues.
The developers hardly read this "users help users" mailing list.

Harry

Op do 15 aug. 2019 om 04:07 schreef Simon Liebold <simon....@formfall.de>:
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/osmand/f0206d27-e869-4e01-9f4d-3b65c6e97c89%40googlegroups.com.

Simon Liebold

unread,
Aug 15, 2019, 11:00:32 AM8/15/19
to Osmand
Opened issue #7430.
Reply all
Reply to author
Forward
0 new messages