From f5ffc208b139be7992f755d6a0bcced04069f136 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Thu, 20 Mar 2008 15:00:08 +0200 Subject: [PATCH] Print progress properly --- src/osm-db-import.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/osm-db-import.c b/src/osm-db-import.c index 6d5a0e7..be7fffa 100644 --- a/src/osm-db-import.c +++ b/src/osm-db-import.c @@ -61,12 +61,12 @@ #define FILE_BUFFER (128*1024) -static guint node_cnt=0; -static guint node_skip_cnt=0; -static guint noded_cnt=0; -static guint way_cnt=0; -static guint way_names=0; -static guint way_refs=0; +static guint node_cnt=0; /* Nodes */ +static guint node_skip_cnt=0; /* Skipped nodes */ +static guint noded_cnt=0; /* Nodes with (usable) data */ +static guint way_cnt=0; /* Ways */ +static guint way_names=0; /* Ways with name */ +static guint way_refs=0; /* Ways with ref or int_ref */ static guint dbnode_cnt=0; static guint dbnoded_cnt=0; @@ -1132,7 +1132,7 @@ dbnode_cnt++; db_insert_node(n); if (dbnode_cnt % 20000==0) g_printf("\rNodes: %f%% (%u/%u)\n", - ((float)dbnode_cnt/(float)node_cnt)*100, + ((float)dbnode_cnt/(float)(node_cnt-node_skip_cnt))*100, dbnode_cnt, node_cnt); } @@ -1757,7 +1757,6 @@ if (db_connect(&db, database)!=TRUE) { return FALSE; } - if (!osm_db_create(db)) { g_printerr("Failed to create osm tables or indexes\n"); return FALSE; -- 2.39.5