From 22337661750f1335924e314d475c895f7f954fd9 Mon Sep 17 00:00:00 2001 From: Carla Date: Wed, 14 Jan 2015 16:49:45 +0100 Subject: [PATCH] Updates docs and changes ranks --- geocoder/admin0/README.md | 4 ++-- geocoder/admin0/sql/build_synonym_table.sql | 22 ++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/geocoder/admin0/README.md b/geocoder/admin0/README.md index 3df7217..cc93286 100644 --- a/geocoder/admin0/README.md +++ b/geocoder/admin0/README.md @@ -58,11 +58,11 @@ INSERT INTO admin0_synonym_additions (adm0_a3, name, notes, rank) VALUES ($iso3_ | 1 | natural earth 10m countries | name_alt | alternate name | | 2 | wiki country navive names | country_endonym | local variation | | 3 | natural earth 10m countries | adm0_a3 | 3 digit country code | -| 4 | natural earth 10m countries | abbrev | abbreviation | +| 4 | natural earth 10m countries | iso_a2 | 2 digit country code | | 5 | natural earth 10m countries | formal_en | formal english | | 6 | natural earth 10m countries | brk_name | ? | | 7 | natural earth 10m countries | formal_fr | formal french | -| 8 | natural earth 10m countries | iso_a2 | 2 digit country code | +| 8 | natural earth 10m countries | abbrev | abbreviation | | 9 | natural earth 10m countries | subunit | complete literal name | | 10 | admin0_synonym_additions | n/a | manually curated additions | diff --git a/geocoder/admin0/sql/build_synonym_table.sql b/geocoder/admin0/sql/build_synonym_table.sql index a4f1a2d..f13c29f 100644 --- a/geocoder/admin0/sql/build_synonym_table.sql +++ b/geocoder/admin0/sql/build_synonym_table.sql @@ -46,12 +46,13 @@ SELECT FROM ne_admin0_v3; --- insert abbrv as name with a rank = 4 -INSERT INTO admin0_synonyms (name, rank, adm0_a3) -SELECT - abbrev, 4, adm0_a3 + -- insert iso_a2 as name with a rank = 4 +INSERT INTO admin0_synonyms (name, rank, adm0_a3) +SELECT + iso_a2, 4, adm0_a3 FROM - ne_admin0_v3; + ne_admin0_v3 + WHERE iso_a2 NOT LIKE '-99'; -- insert formal_en as name with a rank = 5 INSERT INTO admin0_synonyms (name, rank, adm0_a3) @@ -74,13 +75,12 @@ SELECT FROM ne_admin0_v3; --- insert iso_a2 as name with a rank = 8 -INSERT INTO admin0_synonyms (name, rank, adm0_a3) -SELECT - iso_a2, 8, adm0_a3 +-- insert abbrv as name with a rank = 8 +INSERT INTO admin0_synonyms (name, rank, adm0_a3) +SELECT + abbrev, 8, adm0_a3 FROM - ne_admin0_v3 - WHERE iso_a2 NOT LIKE '-99'; + ne_admin0_v3; -- insert subunit as name with a rank = 9 INSERT INTO admin0_synonyms (name, rank, adm0_a3)