From fc20f0c8a3f0be728c173d407e723876332da65c Mon Sep 17 00:00:00 2001 From: projectmoon Date: Sun, 15 Dec 2024 20:19:33 +0100 Subject: [PATCH] OSM: round distances to 3 decimal places. --- CHANGELOG.md | 3 +++ osm.py | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82ffd49..559bc35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # OpenStreetMap Tool +**2.2.1:** + - Round distances to 3 decimal places. + **2.2.0:** - Report distances and travel time for each step in a navigation route. diff --git a/osm.py b/osm.py index ba40bdb..1068611 100644 --- a/osm.py +++ b/osm.py @@ -2,7 +2,7 @@ title: OpenStreetMap Tool author: projectmoon author_url: https://git.agnos.is/projectmoon/open-webui-filters -version: 2.2.0 +version: 2.2.1 license: AGPL-3.0+ required_open_webui_version: 0.4.3 requirements: openrouteservice, pygments @@ -857,14 +857,14 @@ class OsmSearcher: if nav_distance: used_ors = True cache.set(cache_key, nav_distance) - thing['nav_distance'] = nav_distance + thing['nav_distance'] = round(nav_distance, 3) return used_ors def calculate_haversine(self, origin, things_nearby): for thing in things_nearby: if 'distance' not in thing: - thing['distance'] = haversine_distance(origin, thing) + thing['distance'] = round(haversine_distance(origin, thing), 3) def use_detailed_interpretation_mode(self) -> bool: # Let user valve for instruction mode override the global