* (c) 2014 Martin Mares <mj@ucw.cz>
*/
-#include <ucw/lib.h>
+#include "leo.h"
+
#include <ucw/gary.h>
#include <ucw/mempool.h>
#include <ucw/stkstring.h>
#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#include <proj_api.h>
-#include "leo.h"
#include "osm.h"
struct osm *osm_this;
osm_obj_add_tag_raw(o, osm_key_encode(key), osm_val_encode(val));
}
+void osm_obj_set_tag_raw(struct osm_object *o, osm_key_t key, osm_val_t val)
+{
+ CLIST_FOR_EACH(struct osm_tag *, t, o->tags)
+ if (t->key == key)
+ {
+ t->val = val;
+ return;
+ }
+
+ osm_obj_add_tag_raw(o, key, val);
+}
+
+void osm_obj_set_tag(struct osm_object *o, const char *key, const char *val)
+{
+ osm_obj_set_tag_raw(o, osm_key_encode(key), osm_val_encode(val));
+}
+
osm_val_t osm_obj_find_tag(struct osm_object *o, osm_key_t key)
{
CLIST_FOR_EACH(struct osm_tag *, t, o->tags)
if (f->role != VALUE_INNER && f->role != VALUE_OUTER)
{
if (!inner)
- osm_obj_warn(o, "Unknown role %s in multipolygon relation", osm_val_decode(f->role));
+ osm_obj_warn(o, "Unknown role %s in multipolygon relation", f->role ? osm_val_decode(f->role) : "<none>");
continue;
}
if ((f->role == VALUE_INNER) != inner)