From: Kaj-Michael Lang Date: Wed, 9 Apr 2008 08:38:11 +0000 (+0300) Subject: Use angle_diff() X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e0d36a29766ee69dc445ed06b875086b983f314b;p=mapper Use angle_diff() --- diff --git a/src/osm-db.c b/src/osm-db.c index c1e4032..8f47520 100644 --- a/src/osm-db.c +++ b/src/osm-db.c @@ -1061,9 +1061,9 @@ 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, but check if the distance is over a limit or our heading has changed significantly. */ - if ( (dist>(gdouble)way_dist_range) || (fabs(heading-map_loc->heading)>10.0)) { + if ( (dist>(gdouble)way_dist_range) || (fabs(angle_diff(heading, map_loc->heading))>15.0)) { /* We have moved a large amount, check way again */ - g_debug("Distance %.2f > %.2f range or angle %f > 10.0, checking location", + g_debug("Distance %.2f > %.2f range or angle %f > 15.0, checking location", dist, (gdouble)way_dist_range, fabs(heading-map_loc->heading)); osm_way_free(map_loc->street); map_loc->street=osm_find_nearest_way(lat, lon);