From: Kaj-Michael Lang Date: Wed, 23 Apr 2008 13:22:09 +0000 (+0300) Subject: Small fixes to importer: X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=17750329c937553863f4f2e8feaac892f6616be2;p=mapper Small fixes to importer: - reverse ways with oneway=-1 - misc other small fixes --- diff --git a/src/osm-db-import.c b/src/osm-db-import.c index be7fffa..1ad250e 100644 --- a/src/osm-db-import.c +++ b/src/osm-db-import.c @@ -81,7 +81,6 @@ static guint import_sid=0; static gboolean is_update=FALSE; static XML_Parser xp; - /* XML tag IDs */ typedef enum { START, @@ -345,7 +344,6 @@ struct sql_stmt { }; static struct sql_stmt sql; - static struct map_bbox bbox; static gboolean use_bbox; @@ -1530,10 +1528,12 @@ switch (t) { if (v) cway->data->postal_code=g_strdup(v); - /* XXX: somehow handle the silly -1 'reversed' oneway */ v=g_hash_table_lookup(osm_way_tags, "oneway"); - if (v) + if (v) { cway->flags|=W_ONEWAY; + if (strcmp(v, "-1")==0) + cway->nodes=g_slist_reverse(cway->nodes); + } v=g_hash_table_lookup(osm_way_tags, "noexit"); if (v) @@ -1546,11 +1546,9 @@ switch (t) { if (v) cway->data->speed=atoi(v); -#if 0 v=g_hash_table_lookup(osm_way_tags, "layer"); if (v) cway->data->layer=atoi(v); -#endif v=g_hash_table_lookup(osm_way_tags, "junction"); if (v && strcasecmp(v,"roundabout")==0) { @@ -1668,7 +1666,7 @@ storage_free(); } gboolean -osm_planet_parse_buffer(gchar *buffer, size_t r) +osm_planet_parse_buffer(const gchar *buffer, size_t r) { if (XML_Parse(xp, buffer, r, r>0 ? 0:1) == XML_STATUS_ERROR) { g_printerr("Parse error at line %d:\n%s\n",