From 8cb3c867edac7b206a2e72efd17ea3629213cba0 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Sun, 14 Oct 2007 13:42:42 +0300 Subject: [PATCH] Small debuging code fixes. --- src/osm-db.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/osm-db.c b/src/osm-db.c index c9ff84f..e2190bd 100644 --- a/src/osm-db.c +++ b/src/osm-db.c @@ -67,6 +67,8 @@ else way_dist_range=OSM_RANGE_WAY-lrint((speed/4)*1000); } +/*****************************************************************************/ + static int osm_progress(void *ud) { @@ -108,6 +110,8 @@ if (w!=NULL) osm_progress_show(db); } +/*****************************************************************************/ + gboolean osm_db_prepare(sqlite3 *db) { @@ -416,7 +420,7 @@ osm_find_nearest_way_nodes(gint lat, gint lon, guint range) GList *ways=NULL; osm_way *w; gulong tms; -gint wc=0; +guint wc=0; sqlite3_reset(sql.select_way2); sqlite3_clear_bindings(sql.select_way2); @@ -536,22 +540,21 @@ while ((w=osm_find_nearest_way_nodes(lat, lon, range))==NULL && range<=OSM_RANGE range+=OSM_RANGE_STEP; g_printf("Trying with range: %d\n", range); } +#ifdef DEBUG_OSM +g_printf("Found %d ways withing range %d\n", g_list_length(w), range); +#endif if (g_list_length(w)==0) return NULL; -#ifdef DEBUG_OSM -g_printf("Found ways: %d\n", g_list_length(w)); -#endif - for (iter=w; iter!=NULL; iter=iter->next) { osm_way_node *wnn; osm_way_node *wnp; osm_way *way=(osm_way*)iter->data; #ifdef DEBUG_OSM - g_printf("WAY %d (%d) HAS %d NODES, nearest is %d\n", - way->id, way->type, way->nodecnt, way->f); + g_printf("Way: %d (%d) has %d nodes, nearest is %d,%d\n", + way->id, way->type, way->nodecnt, way->f, way->t); #endif way->node_t=NULL; @@ -610,8 +613,8 @@ g_printf("BEST WAY(%d): %s [%s][%s]\n", g_printf("\tType: %d Flags: %d Nodes: %d Dist: %f\n", cw->type, cw->flags, cw->nodecnt, cw->dist); g_printf("\tNF: %d NT: %d Distance: %f\n", - cw->node_f->num, - cw->node_t->num, + cw->f, + cw->t, cw->distance); #endif -- 2.39.5