diff options
| author | mdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2013-01-05 08:30:47 +0000 |
|---|---|---|
| committer | mdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2013-01-05 08:30:47 +0000 |
| commit | 67fded096bed8ce5d326e26b869b8a2ccbfadd2b (patch) | |
| tree | 912567816419cc0c567e2923d1debda78b4fd810 /navit | |
| parent | 45e00c486e2fd293a7280d04f730df8de4e59865 (diff) | |
| download | navit-67fded096bed8ce5d326e26b869b8a2ccbfadd2b.tar.gz | |
Fix:core:Update iso3166-1 country lists, recoginse iso3166-1:alpha2 tag on coutry boundary relations.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5337 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit')
| -rw-r--r-- | navit/country.c | 6 | ||||
| -rw-r--r-- | navit/maptool/boundaries.c | 4 | ||||
| -rw-r--r-- | navit/maptool/osm.c | 9 |
3 files changed, 18 insertions, 1 deletions
diff --git a/navit/country.c b/navit/country.c index 8a99904a1..52e5b0ef1 100644 --- a/navit/country.c +++ b/navit/country.c @@ -35,6 +35,8 @@ struct country { char *name; }; +/* List of all known countries and their codes. + * If you update this list, look at country_table array in maptool/osm.c also. */ static struct country country[]= { { 20, "AND", "AD", "AND", /* 020 */ _n("Andorra")}, {784, "UAE", "AE", "ARE", /* 784 */ _n("United Arab Emirates")}, @@ -66,6 +68,7 @@ static struct country country[]= { { 60, NULL, "BM", "BMU", /* 060 */ _n("Bermuda")}, { 96, "BRU", "BN", "BRN", /* 096 */ _n("Brunei Darussalam")}, { 68, "BOL", "BO", "BOL", /* 068 */ _n("Bolivia")}, + {535, NULL, "BQ", "BES", /* 535 */ _n("Bonaire, Sint Eustatius and Saba")}, { 76, "BR", "BR", "BRA", /* 076 */ _n("Brazil")}, { 44, "BS", "BS", "BHS", /* 044 */ _n("Bahamas")}, { 64, "BHT", "BT", "BTN", /* 064 */ _n("Bhutan")}, @@ -88,6 +91,7 @@ static struct country country[]= { {188, "CR", "CR", "CRI", /* 188 */ _n("Costa Rica")}, {192, "C", "CU", "CUB", /* 192 */ _n("Cuba")}, {132, "CV", "CV", "CPV", /* 132 */ _n("Cape Verde")}, + {531, NULL, "CW", "CUW", /* 531 */ _n("Curacao")}, {162, NULL, "CX", "CXR", /* 162 */ _n("Christmas Island")}, {196, "CY", "CY", "CYP", /* 196 */ _n("Cyprus")}, {203, "CZ", "CZ", "CZE", /* 203 */ _n("Czech Republic")}, @@ -242,8 +246,10 @@ static struct country country[]= { {686, "SN", "SN", "SEN", /* 686 */ _n("Senegal")}, {706, "SO", "SO", "SOM", /* 706 */ _n("Somalia")}, {740, "SME", "SR", "SUR", /* 740 */ _n("Suriname")}, + {728, NULL, "SS", "SSD", /* 728 */ _n("South Sudan")}, {678, "STP", "ST", "STP", /* 678 */ _n("Sao Tome and Principe")}, {222, "ES", "SV", "SLV", /* 222 */ _n("El Salvador")}, + {534, NULL, "SX", "SXM", /* 534 */ _n("Sint Maarten (Dutch part)")}, {760, "SYR", "SY", "SYR", /* 760 */ _n("Syrian Arab Republic")}, {748, "SD", "SZ", "SWZ", /* 748 */ _n("Swaziland")}, {796, NULL, "TC", "TCA", /* 796 */ _n("Turks and Caicos Islands")}, diff --git a/navit/maptool/boundaries.c b/navit/maptool/boundaries.c index 418f719b8..fba9c166a 100644 --- a/navit/maptool/boundaries.c +++ b/navit/maptool/boundaries.c @@ -78,6 +78,10 @@ process_boundaries_setup(FILE *boundaries, struct relations *relations) struct boundary *boundary=g_new0(struct boundary, 1); char *admin_level=osm_tag_value(ib, "admin_level"); char *iso=osm_tag_value(ib, "ISO3166-1"); + + if(!iso) + iso=osm_tag_value(ib, "iso3166-1:alpha2"); + /* disable spain for now since it creates a too large index */ if (admin_level && !strcmp(admin_level, "2") && (!iso || strcasecmp(iso,"es"))) { if (iso) { diff --git a/navit/maptool/osm.c b/navit/maptool/osm.c index 65d714249..b86276412 100644 --- a/navit/maptool/osm.c +++ b/navit/maptool/osm.c @@ -112,6 +112,9 @@ char *osm_types[]={"unknown","node","way","relation"}; #define REF(c) ((c).y) #define SET_REF(c,ref) do { (c).x = 1 << 30; (c).y = ref ; } while(0) +/* Table of country codes with possible is_in spellings. + * Note: If you update this list, check also country array in country.c + */ struct country_table { int countryid; char *names; @@ -272,7 +275,10 @@ struct country_table { { 524,"Nepal"}, { 528,"Nederland,The Netherlands,Niederlande,NL,Netherlands"}, { 530,"Netherlands Antilles"}, + { 531,"Curacao"}, { 533,"Aruba"}, + { 534,"Sint Maarten (Dutch part)"}, + { 535,"Bonaire, Sint Eustatius and Saba"}, { 540,"New Caledonia"}, { 548,"Vanuatu"}, { 554,"New Zealand"}, @@ -327,6 +333,7 @@ struct country_table { { 710,"South Africa"}, { 716,"Zimbabwe"}, { 724,"Spain,Espana,España,Reino de Espana,Reino de España"}, + { 728,"South Sudan"}, { 732,"Western Sahara"}, { 736,"Sudan"}, { 740,"Suriname"}, @@ -1817,7 +1824,7 @@ osm_process_town_by_boundary(GList *bl, struct item_bin *ib, struct coord *c, st while (l) { struct boundary *b=l->data; if (b->country) { - if (match) { + if (match && match->country->countryid!=b->country->countryid) { osm_warning("node",item_bin_get_nodeid(ib),0,"node (0x%x,0x%x) conflict country ", c->x, c->y); osm_warning("relation",boundary_relid(match),1,"country %d vs ",match->country->countryid); osm_warning("relation",boundary_relid(b),1,"country %d\n",b->country->countryid); |
