]> err.no Git - mapper/commitdiff
Use shorter range for new location check
authorKaj-Michael Lang <milang@onion.tal.org>
Tue, 26 Feb 2008 17:34:03 +0000 (19:34 +0200)
committerKaj-Michael Lang <milang@onion.tal.org>
Tue, 26 Feb 2008 17:34:03 +0000 (19:34 +0200)
src/map.c
src/osm-db.c

index 6afafea27ecc333ab8bfba45f956a566a1cf290e..e9b6092f13a3d92f6801a1596fada52775627eff 100644 (file)
--- 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);
index be9080824ab8a6150f2d3de2e1b4118fad158ac5..86124cd39dfc04e15b6775a1993602da5c042afe 100644 (file)
@@ -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;