* (c) 2014 Martin Mares <mj@ucw.cz>
*/
-#include <ucw/lib.h>
+#include "leo.h"
+#include "osm.h"
+
#include <ucw/gary.h>
#include <ucw/mempool.h>
#include <ucw/stkstring.h>
#include <stdio.h>
#include <proj_api.h>
-#include "leo.h"
-#include "osm.h"
-
struct osm *osm_this;
/*** Generic objects ***/
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);
clist_init(&b->nodes);
struct mpg_vertex *w = v;
- while (!w->visited)
+ while (w && !w->visited)
{
w->visited = 1;
struct osm_ref *f = mp_alloc(osm_this->pool, sizeof(*f));
w = dest;
}
- if (w != v)
+ if (!w)
+ osm_obj_warn(&mpg_current->o, "Boundary not closed");
+ else if (w != v)
osm_obj_warn(&mpg_current->o, "Boundary not closed at node %ju", (uintmax_t) w->o->id);
struct osm_ref *f = mp_alloc(osm_this->pool, sizeof(*f));
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]);
+}