From 7ff17eea15287b0f029abae08e9108a7c6c27452 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Tue, 26 Feb 2008 19:34:03 +0200 Subject: [PATCH] Use shorter range for new location check --- src/map.c | 2 +- src/osm-db.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/map.c b/src/map.c index 6afafea..e9b6092 100644 --- a/src/map.c +++ b/src/map.c @@ -1254,7 +1254,7 @@ ilon=lon2mp_int(lon); if (_gps->data.fix>1 && !force) osm_set_way_range_from_speed(_gps->data.speed); else - osm_set_way_range(OSM_RANGE_WAY/4); + osm_set_way_range(OSM_RANGE_WAY/8); osm_progress_set_widget(_db, _progress_item); osm_get_location_data(ilat, ilon, _gps->data.heading, &map_loc); diff --git a/src/osm-db.c b/src/osm-db.c index be90808..86124cd 100644 --- a/src/osm-db.c +++ b/src/osm-db.c @@ -96,7 +96,7 @@ void osm_set_way_range_from_speed(gfloat speed) { if (speed>54.0) - way_dist_range=OSM_RANGE_WAY*2; + way_dist_range=OSM_RANGE_WAY; else way_dist_range=OSM_RANGE_WAY-lrint((speed/4)*1000); } @@ -940,7 +940,8 @@ if (map_loc->street && osm_way_distance(lat, lon, map_loc->street->node_f, map_l /* We are probably on the same way as last time */ if ( (dist>(gdouble)way_dist_range) || (fabs(heading-map_loc->heading)>10.0)) { /* We have moved a large amount, check way again */ - g_printf("*** dist %f over range, checking again\n", dist); + g_debug("Distance %f > %f range or angle %f > 10.0, checking location", + dist, way_dist_range, fabs(heading-map_loc->heading)); osm_way_free(map_loc->street); map_loc->street=osm_find_nearest_way(lat, lon); check_place=TRUE; -- 2.39.5