]> err.no Git - mapper/commitdiff
Small fixes to importer:
authorKaj-Michael Lang <milang@tal.org>
Wed, 23 Apr 2008 13:22:09 +0000 (16:22 +0300)
committerKaj-Michael Lang <milang@tal.org>
Wed, 23 Apr 2008 13:22:09 +0000 (16:22 +0300)
- reverse ways with oneway=-1
- misc other small fixes

src/osm-db-import.c

index be7fffafb3311413b242687e216e88080390bdc3..1ad250e2c1770bba36aff1347036e829da5b2a19 100644 (file)
@@ -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",