summaryrefslogtreecommitdiff
path: root/navit/maptool
diff options
context:
space:
mode:
authormdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-01-05 08:30:47 +0000
committermdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-01-05 08:30:47 +0000
commit67fded096bed8ce5d326e26b869b8a2ccbfadd2b (patch)
tree912567816419cc0c567e2923d1debda78b4fd810 /navit/maptool
parent45e00c486e2fd293a7280d04f730df8de4e59865 (diff)
downloadnavit-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/maptool')
-rw-r--r--navit/maptool/boundaries.c4
-rw-r--r--navit/maptool/osm.c9
2 files changed, 12 insertions, 1 deletions
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);