osm_db_ok=FALSE;
memset(&sql, 0, sizeof(sql));
g_hash_table_destroy(pcache.cache);
+pcache.cache=NULL;
pcache.hit=0;
pcache.miss=0;
g_timer_destroy(dbt);
/******************************************************************************/
+/**
+ * Check if we have moved away from the last known street
+ */
+gboolean
+osm_check_location(osm_location *map_loc, gint lat, gint lon)
+{
+gdouble dist;
+if (map_loc->street && osm_way_distance(lat, lon, map_loc->street->node_f, map_loc->street->node_t, &dist)==TRUE) {
+ return (dist>(gdouble)way_dist_range) ? FALSE : TRUE;
+} else
+ return FALSE;
+}
+
/**
* Try to figure out where the given lat,lon is. Fills in the given struct,
* with street, secondary (suburb) and primary (city,town,village) location.