From: Mischa POSLAWSKY Date: Sun, 1 Feb 2015 07:16:28 +0000 (+0100) Subject: countries: hardcode reservations X-Git-Tag: v1.6~53 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/b4ce208aa528529fbc34a035cf76b3f3e817e94a countries: hardcode reservations Missing in GeoNames import, or anywhere. Official ISO data cannot be downloaded either, so manually copy it for now. --- diff --git a/tools/mkcountries-geonames b/tools/mkcountries-geonames index d9b938a..592ce75 100755 --- a/tools/mkcountries-geonames +++ b/tools/mkcountries-geonames @@ -3,6 +3,40 @@ use 5.012; use warnings; my %cc; # map of country code to info array +%cc = ( + # exceptional reservations + ac => ["Ascension Island", "c-oc Xr", undef, 'sh'], + cp => ["Clipperton Island", "c-na Xr"], + dg => ["Diego Garcia", "c-as Xr", undef, 'io'], + ea => ["Ceuta and Melilla", "c-af Xr"], + eu => ["European Union", "c-eu Xr"], + fx => ["Metropolitan France", "c-eu Xr", undef, 'fr'], + ic => ["Canary Islands", "c-af Xr"], + su => ["former USSR", "c-eu Xr"], + ta => ["Tristan da Cunha", "c-oc Xr", undef, 'sh'], + uk => ["(United Kingdom)", "c-eu Xr", undef, 'gb'], + + # indeterminate reservations + dy => ["(Benin)", "c-af Xr", undef, 'bj'], + ew => ["(Estonia)", "c-eu Xr", undef, 'ee'], + fl => ["(Liechtenstein)", "c-eu Xr", undef, 'li'], + ja => ["(Jamaica)", "c-na Xr", undef, 'jm'], + lf => ["Libya Fezzan", "c-af Xr", "Fezzan", 'ly'], + pi => ["(Philippines)", "c-as Xr", undef, 'ph'], + ra => ["(Argentina)", "c-sa Xr", undef, 'ar'], + rb => ["Bolivia/Botswana", "c-xx Xr"], + rc => ["(RoC)", "c-as Xr", undef, 'tw'], + rh => ["(Haiti)", "c-na Xr",undef, 'ht'], + ri => ["(Indonesia)", "c-as Xr", undef, 'id'], + rl => ["(Lebanon)", "c-as Xr", undef, 'lb'], + rm => ["(Madagascar)", "c-af Xr", undef, 'mg'], + rn => ["(Niger)", "c-af Xr",undef, 'ne'], + rp => ["(Philippines)", "c-as Xr", undef, 'ph'], + wg => ["(Grenada)", "c-na Xr", undef, 'gd'], + wl => ["(Saint Lucia)", "c-na Xr", "(Saint Luc.)", 'lc'], + wv => ["(Saint Vincent)", "c-na Xr", "(Saint Vin.)", 'vc'], + yv => ["(Venezuela)", "c-sa Xr", undef, 've'], +); while (<>) { /^#/ and next; # skip comments @@ -11,6 +45,9 @@ while (<>) { $cc{ lc $iso } = [ $name, $class ]; } +$cc{io}->[2] = "Chagos Islands"; +$cc{um}->[2] = "U.S. isl."; + for (values %cc) { for ($_->[2] //= $_->[0]) { s/,.*//;