]> mj.ucw.cz Git - leo.git/blobdiff - osm.c
Log statistics when a data source is loaded
[leo.git] / osm.c
diff --git a/osm.c b/osm.c
index 325b592322287858a064f46faa10bd538b5fac96..862f7fbb52012cdcf76221a15879cdc60beace04 100644 (file)
--- a/osm.c
+++ b/osm.c
@@ -74,6 +74,7 @@ static void *osm_obj_new(enum osm_object_type type, osm_id_t id, uns size)
 
   struct osm_object *o = mp_alloc_zero(osm_this->pool, size);
   clist_add_tail(&osm_this->obj_list[type], &o->n);
+  osm_this->obj_cnt[type]++;
   o->type = type;
   o->id = id;
   clist_init(&o->tags);
@@ -585,3 +586,11 @@ void osm_dump(void)
   osm_relation_dump_all();
   osm_multipolygon_dump_all();
 }
+
+void osm_stats(void)
+{
+  msg(L_INFO, "Loaded %u nodes, %u ways, %u relations",
+    osm_this->obj_cnt[OSM_TYPE_NODE],
+    osm_this->obj_cnt[OSM_TYPE_WAY],
+    osm_this->obj_cnt[OSM_TYPE_RELATION]);
+}