Skip to content

Commit

Permalink
Update country data (#21)
Browse files Browse the repository at this point in the history
* Update country data

* Fix compilation errors (#22)

* Add  to Country.Utils

* Fix loading Countries after the structure of the data file has been updated

* Update Country fields to match the new data structure

* Fix tests

* Add Country.Subdivision struct

* Return Country.Subdivision instead of nested tuples
  • Loading branch information
SebastianSzturo authored Oct 14, 2017
1 parent c7317b8 commit 078374e
Show file tree
Hide file tree
Showing 458 changed files with 196,355 additions and 7,126 deletions.
9 changes: 4 additions & 5 deletions lib/country.ex
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
defmodule Countries.Country do
defstruct [:number, :alpha2, :alpha3, :currency, :name, :names,
:latitude, :longitude, :continent, :region, :subregion,
defstruct [:number, :alpha2, :alpha3, :currency, :name, :unofficial_names,
:continent, :region, :subregion, :geo,
:world_region, :country_code, :national_destination_code_lengths,
:national_number_lengths, :international_prefix, :national_prefix,
:address_format, :ioc, :gec, :un_locode, :languages, :nationality,
:ioc, :gec, :un_locode, :languages_official, :languages_spoken, :nationality,
:address_format, :dissolved_on, :eu_member, :alt_currency, :vat_rates,
:postal_code, :min_longitude, :min_latitude, :max_longitude, :max_latitude,
:latitude_dec, :longitude_dec]
:postal_code, :currency_code]
end
41 changes: 26 additions & 15 deletions lib/data/countries/AD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,10 @@ continent: Europe
alpha2: AD
alpha3: AND
country_code: '376'
currency: EUR
international_prefix: '00'
ioc: AND
gec: AN
latitude: 42 30 N
longitude: 1 30 E
name: Andorra
names:
- Andorre
- Andorra
- "アンドラ"
national_destination_code_lengths:
- 2
national_number_lengths:
Expand All @@ -27,13 +20,31 @@ region: Europe
subregion: Southern Europe
world_region: EMEA
un_locode: AD
languages:
- ca
nationality: Andorran
postal_code: true
min_longitude: '1.416667'
min_latitude: '42.433333'
max_longitude: '1.783333'
max_latitude: '42.65'
latitude_dec: '42.5506591796875'
longitude_dec: '1.5762332677841187'
unofficial_names:
- Andorre
- Andorra
- アンドラ
languages_official:
- ca
languages_spoken:
- ca
geo:
latitude: 42.506285
latitude_dec: '42.5506591796875'
longitude: 1.521801
longitude_dec: '1.5762332677841187'
max_latitude: 42.655791
max_longitude: 1.786639
min_latitude: 42.4287488
min_longitude: 1.4087052
bounds:
northeast:
lat: 42.655791
lng: 1.786639
southwest:
lat: 42.4287488
lng: 1.4087052
currency_code: EUR
start_of_week: monday
49 changes: 30 additions & 19 deletions lib/data/countries/AE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,10 @@ address_format: |-
alpha2: AE
alpha3: ARE
country_code: '971'
currency: AED
international_prefix: '00'
ioc: UAE
gec: AE
latitude: 24 00 N
longitude: 54 00 E
name: United Arab Emirates
names:
- United Arab Emirates
- "الإمارات العربية المتحدة"
- Vereinigte Arabische Emirate
- "Émirats Arabes Unis"
- Emiratos Árabes Unidos
- "アラブ首長国連邦"
- Verenigde Arabische Emiraten
national_destination_code_lengths:
- 2
national_number_lengths:
Expand All @@ -35,13 +24,35 @@ region: Asia
subregion: Western Asia
world_region: EMEA
un_locode: AE
languages:
- ar
nationality: Emirian
postal_code: false
min_longitude: '45'
min_latitude: '22.166667'
max_longitude: '58'
max_latitude: '26.133333'
latitude_dec: '23.684776306152344'
longitude_dec: '54.536643981933594'
unofficial_names:
- United Arab Emirates
- الإمارات العربية المتحدة
- Vereinigte Arabische Emirate
- Émirats Arabes Unis
- Emiratos Árabes Unidos
- アラブ首長国連邦
- Verenigde Arabische Emiraten
languages_official:
- ar
languages_spoken:
- ar
geo:
latitude: 23.424076
latitude_dec: '23.684776306152344'
longitude: 53.847818
longitude_dec: '54.536643981933594'
max_latitude: 26.0765
max_longitude: 56.4395001
min_latitude: 22.6315138
min_longitude: 51.4723
bounds:
northeast:
lat: 26.0765
lng: 56.4395001
southwest:
lat: 22.6315138
lng: 51.4723
currency_code: AED
start_of_week: sunday
45 changes: 29 additions & 16 deletions lib/data/countries/AF.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,10 @@ continent: Asia
alpha2: AF
alpha3: AFG
country_code: '93'
currency: AFN
international_prefix: '00'
ioc: AFG
gec: AF
latitude: 33 00 N
longitude: 65 00 E
name: Afghanistan
names:
- Afghanistan
- Afganistán
- "アフガニスタン"
national_destination_code_lengths:
- 2
national_number_lengths:
Expand All @@ -25,15 +18,35 @@ region: Asia
subregion: Southern Asia
world_region: APAC
un_locode: AF
languages:
nationality: Afghan
postal_code: true
unofficial_names:
- Afghanistan
- Afganistán
- アフガニスタン
languages_official:
- ps
- uz
- tk
nationality: Afghan
postal_code: true
min_longitude: '60.566667'
min_latitude: '29.383333'
max_longitude: '74.8868713067'
max_latitude: '38.483611'
latitude_dec: '33.833248138427734'
longitude_dec: '66.02528381347656'
languages_spoken:
- ps
- uz
- tk
geo:
latitude: 33.93911
latitude_dec: '33.833248138427734'
longitude: 67.709953
longitude_dec: '66.02528381347656'
max_latitude: 38.49087670000001
max_longitude: 74.8898619
min_latitude: 29.3772
min_longitude: 60.5170005
bounds:
northeast:
lat: 38.49087670000001
lng: 74.8898619
southwest:
lat: 29.3772
lng: 60.5170005
currency_code: AFN
start_of_week: monday
48 changes: 30 additions & 18 deletions lib/data/countries/AG.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,11 @@ continent: North America
alpha2: AG
alpha3: ATG
country_code: '1'
currency: XCD
nanp_prefix: '1268'
international_prefix: '011'
ioc: ANT
gec: AC
latitude: 17 03 N
longitude: 61 48 W
name: Antigua and Barbuda
names:
- Antigua and Barbuda
- Antigua und Barbuda
- Antigua et Barbuda
- Antigua y Barbuda
- "アンティグア・バーブーダ"
- Antigua en Barbuda
national_destination_code_lengths:
- 3
national_number_lengths:
Expand All @@ -27,13 +18,34 @@ region: Americas
subregion: Caribbean
world_region: AMER
un_locode: AG
languages:
- en
nationality: Antiguan, Barbudan
postal_code: false
min_longitude: "-62.333333"
min_latitude: '16.916667'
max_longitude: "-61.666667"
max_latitude: '17.733333'
latitude_dec: '17.09273910522461'
longitude_dec: "-61.81040954589844"
unofficial_names:
- Antigua and Barbuda
- Antigua und Barbuda
- Antigua et Barbuda
- Antigua y Barbuda
- アンティグア・バーブーダ
- Antigua en Barbuda
languages_official:
- en
languages_spoken:
- en
geo:
latitude: 17.060816
latitude_dec: '17.09273910522461'
longitude: -61.796428
longitude_dec: "-61.81040954589844"
max_latitude: 17.7499946
max_longitude: -61.6394
min_latitude: 16.9018
min_longitude: -62.38100009999999
bounds:
northeast:
lat: 17.7499946
lng: -61.6394
southwest:
lat: 16.9018
lng: -62.38100009999999
currency_code: XCD
start_of_week: monday
42 changes: 27 additions & 15 deletions lib/data/countries/AI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,11 @@ continent: North America
alpha2: AI
alpha3: AIA
country_code: '1'
currency: XCD
nanp_prefix: '1264'
international_prefix: '011'
ioc:
ioc:
gec: AV
latitude: 18 15 N
longitude: 63 10 W
name: Anguilla
names:
- Anguilla
- "アンギラ"
national_destination_code_lengths:
- 3
national_number_lengths:
Expand All @@ -23,13 +18,30 @@ region: Americas
subregion: Caribbean
world_region: AMER
un_locode: AI
languages:
- en
nationality: Anguillian
postal_code: true
min_longitude: "-63.433333"
min_latitude: '18.15'
max_longitude: "-62.916667"
max_latitude: '18.6'
latitude_dec: '18.22646713256836'
longitude_dec: "-63.0473518371582"
unofficial_names:
- Anguilla
- アンギラ
languages_official:
- en
languages_spoken:
- en
geo:
latitude: 18.220554
latitude_dec: '18.22646713256836'
longitude: -63.06861499999999
longitude_dec: "-63.0473518371582"
max_latitude: 18.6332326
max_longitude: -62.91999999999999
min_latitude: 18.1465043
min_longitude: -63.4803
bounds:
northeast:
lat: 18.6332326
lng: -62.91999999999999
southwest:
lat: 18.1465043
lng: -63.4803
currency_code: XCD
start_of_week: monday
45 changes: 28 additions & 17 deletions lib/data/countries/AL.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,10 @@ continent: Europe
alpha2: AL
alpha3: ALB
country_code: '355'
currency: ALL
international_prefix: '00'
ioc: ALB
gec: AL
latitude: 41 00 N
longitude: 20 00 E
name: Albania
names:
- Albania
- Albanien
- Albanie
- "アルバニア"
- Albanië
national_destination_code_lengths:
- 2
national_number_lengths:
Expand All @@ -28,13 +19,33 @@ region: Europe
subregion: Southern Europe
world_region: EMEA
un_locode: AL
languages:
- sq
nationality: Albanian
postal_code: true
min_longitude: '19.266667'
min_latitude: '39.65'
max_longitude: '21.05'
max_latitude: '42.659167'
latitude_dec: '41.11113357543945'
longitude_dec: '20.02745246887207'
unofficial_names:
- Albania
- Albanien
- Albanie
- アルバニア
- Albanië
languages_official:
- sq
languages_spoken:
- sq
geo:
latitude: 41.153332
latitude_dec: '41.11113357543945'
longitude: 20.168331
longitude_dec: '20.02745246887207'
max_latitude: 42.6610819
max_longitude: 21.0572394
min_latitude: 39.6447296
min_longitude: 19.1217
bounds:
northeast:
lat: 42.6610819
lng: 21.0572394
southwest:
lat: 39.6447296
lng: 19.1217
currency_code: ALL
start_of_week: monday
Loading

0 comments on commit 078374e

Please sign in to comment.