diff options
Diffstat (limited to 'src/main/java/org/traccar/speedlimit')
-rw-r--r-- | src/main/java/org/traccar/speedlimit/OverpassSpeedLimitProvider.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main/java/org/traccar/speedlimit/OverpassSpeedLimitProvider.java b/src/main/java/org/traccar/speedlimit/OverpassSpeedLimitProvider.java index 60ad65f9e..a25eedb2c 100644 --- a/src/main/java/org/traccar/speedlimit/OverpassSpeedLimitProvider.java +++ b/src/main/java/org/traccar/speedlimit/OverpassSpeedLimitProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2020 - 2022 Anton Tananaev (anton@traccar.org) + * Copyright 2020 - 2023 Anton Tananaev (anton@traccar.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,8 @@ */ package org.traccar.speedlimit; +import org.traccar.config.Config; +import org.traccar.config.Keys; import org.traccar.helper.UnitsConverter; import jakarta.json.JsonArray; @@ -28,9 +30,10 @@ public class OverpassSpeedLimitProvider implements SpeedLimitProvider { private final Client client; private final String url; - public OverpassSpeedLimitProvider(Client client, String url) { + public OverpassSpeedLimitProvider(Config config, Client client, String url) { + int accuracy = config.getInteger(Keys.SPEED_LIMIT_ACCURACY); this.client = client; - this.url = url + "?data=[out:json];way[maxspeed](around:100.0,%f,%f);out%%20tags;"; + this.url = url + "?data=[out:json];way[maxspeed](around:" + accuracy + ",%f,%f);out%%20tags;"; } private Double parseSpeed(String value) { |