Add:Core:Add support for cities that do not have is_in tag, trac #338
authorpavel <pavel@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sat, 23 May 2009 21:22:52 +0000 (21:22 +0000)
committerpavel <pavel@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Sat, 23 May 2009 21:22:52 +0000 (21:22 +0000)
|
Group them under fake, "unknown" country; but at least user will be
able to search for streets in them, etc.

git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit@2282 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/country.c
navit/osm2navit.c

index 729349e..1bcaad1 100644 (file)
@@ -282,6 +282,7 @@ static struct country country[]= {
   {710,        "ZA",   "ZA", "ZAF", /* 710 */ _n("South Africa") },
   {894,        "Z",    "ZM", "ZMB", /* 894 */ _n("Zambia")},
   {716,        "ZW",   "ZW", "ZWE", /* 716 */ _n("Zimbabwe")},
+  {999, "*",    "*",  "*",             _n("* Unknown, add is_in tags to those cities")},
 };
 
 
index 4a9dae3..1c4dba2 100644 (file)
@@ -411,7 +411,8 @@ struct country_table {
        {752,"Sweden,Sverige,Konungariket Sverige,SE"},
        {756,"Schweiz"}, 
        {826,"United Kingdom,UK"},
-       {840,"USA"} 
+       {840,"USA"},
+       {999,"Unknown"},
 };
 
 static GHashTable *country_table_hash;
@@ -1478,6 +1479,8 @@ end_node(FILE *out)
        item_bin_write(item_bin,out);
        if (item_is_town(*item_bin) && attr_strings[attr_string_label]) {
                char *tok,*buf=is_in_buffer;
+               if (!buf[0])
+                       strcpy(is_in_buffer, "Unknown");
                while ((tok=strtok(buf, ","))) {
                        while (*tok==' ')
                                tok++;