Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Canada NT districts #376

Merged
merged 2 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added ParlinfoRidings.xlsx
Binary file not shown.
38 changes: 19 additions & 19 deletions identifiers/country-ca.csv
Original file line number Diff line number Diff line change
Expand Up @@ -12171,41 +12171,41 @@ ocd-division/country:ca/region:4,Prairies,,,,,,,Prairies,,,,,,,
ocd-division/country:ca/region:5,British Columbia,,,,,,,Colombie-Britannique,,,,,,,
ocd-division/country:ca/region:6,Territories,,,,,,,Territoires,,,,,,,
ocd-division/country:ca/territory:nt,Northwest Territories,,,N.W.T.,T.N.-O.,,,Territoires du Nord-Ouest,,,,,61,,
ocd-division/country:ca/territory:nt/ed:1,Nunakput,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:10,Thebacha,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:11,Weledeh,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:12,Hay River South,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:13,Hay River North,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:14,Range Lake,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:15,Yellowknife South,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:16,Kam Lake,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:17,Frame Lake,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:18,Yellowknife Centre,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:19,Great Slave,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:2,Inuvik Boot Lake,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:3,Inuvik Twin Lakes,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:4,Mackenzie-Delta,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:5,Sahtu,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:6,Nahendeh,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:7,Monfwi,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:8,Tu Nedhe,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:9,Deh Cho,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:alberta_provisional_district,Alberta (Provisional District),,1908-09-16,,,,,,,,,,,,1886-06-02
ocd-division/country:ca/territory:nt/ed:assiniboia_east,Assiniboia East,,1908-09-16,,,,,,,,,,,,1886-06-02
ocd-division/country:ca/territory:nt/ed:assiniboia_west,Assiniboia West,,1908-09-16,,,,,,,,,,,,1886-06-02
ocd-division/country:ca/territory:nt/ed:calgary,Calgary,,1908-09-16,,,,,,,,,,,,1904-09-20
ocd-division/country:ca/territory:nt/ed:dehcho,Dehcho,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:edmonton,Edmonton,,1908-09-16,,,,,,,,,,,,1904-09-20
ocd-division/country:ca/territory:nt/ed:frame_lake,Frame Lake,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:great_slave,Great Slave,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:hay_river_north,Hay River North,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:hay_river_south,Hay River South,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:humboldt,Humboldt,,1908-09-16,,,,,,,,,,,,1904-09-20
ocd-division/country:ca/territory:nt/ed:inuvik_boot_lake,Inuvik Boot Lake,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:inuvik_twin_lakes,Inuvik Twin Lakes,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:kam_lake,Kam Lake,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:mackenzie,Mackenzie,,1908-09-16,,,,,,,,,,,,1904-09-20
ocd-division/country:ca/territory:nt/ed:mackenzie_delta,Mackenzie Delta,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:mackenzie_river,Mackenzie River,,1962-04-07,,,,,,,,,,,,1953-06-13
ocd-division/country:ca/territory:nt/ed:monfwi,Monfwi,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:nahendeh,Nahendeh,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:northwest_territories,Northwest Territories,,1979-03-25,,,,,,,,,,,,1962-03-23
ocd-division/country:ca/territory:nt/ed:northwest_territories-2015,Northwest Territories,,,,,,,,,,,,,,2015-08-02
ocd-division/country:ca/territory:nt/ed:nunakput,Nunakput,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:nunatsiaq,Nunatsiaq,,1997-04-26,,,,,,,,,,,,1979-03-26
ocd-division/country:ca/territory:nt/ed:nunavut,Nunavut,,1999-03-30,,,,,,,,,,,,1997-04-27
ocd-division/country:ca/territory:nt/ed:qu~appelle,Qu'Appelle,,1908-09-16,,,,,,,,,,,,1904-09-20
ocd-division/country:ca/territory:nt/ed:range_lake,Range Lake,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:sahtu,Sahtu,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:saskatchewan_provisional_district,Saskatchewan (Provisional District),,1908-09-16,,,,,,,,,,,,1886-06-02
ocd-division/country:ca/territory:nt/ed:strathcona,Strathcona,,1908-09-16,,,,,,,,,,,,1904-09-20
ocd-division/country:ca/territory:nt/ed:thebacha,Thebacha,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:tu_nedhé-wiilideh,Tu Nedhé-Wiilideh,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:western_arctic,Western Arctic,,2015-08-01,,,,,,,,,,,,1979-03-26
ocd-division/country:ca/territory:nt/ed:yellowknife_centre,Yellowknife Centre,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:yellowknife_north,Yellowknife North,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:yellowknife_south,Yellowknife South,,,,,,,,,,,,,,
ocd-division/country:ca/territory:nt/ed:yukon-mackenzie_river,Yukon—Mackenzie River,,1953-06-12,,,,,,,,,,,,1949-04-30
ocd-division/country:ca/territory:nu,Nunavut,,,Nvt.,Nt,,,Nunavut,,,,,62,,
ocd-division/country:ca/territory:nu/ed:nunavut,Nunavut,,,,,,,,,,,,,,1999-04-01
Expand Down
38 changes: 19 additions & 19 deletions identifiers/country-ca/territory-nt-electoral_districts.csv
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
id,name
ocd-division/country:ca/territory:nt/ed:1,Nunakput
ocd-division/country:ca/territory:nt/ed:2,Inuvik Boot Lake
ocd-division/country:ca/territory:nt/ed:3,Inuvik Twin Lakes
ocd-division/country:ca/territory:nt/ed:4,Mackenzie-Delta
ocd-division/country:ca/territory:nt/ed:5,Sahtu
ocd-division/country:ca/territory:nt/ed:6,Nahendeh
ocd-division/country:ca/territory:nt/ed:7,Monfwi
ocd-division/country:ca/territory:nt/ed:8,Tu Nedhe
ocd-division/country:ca/territory:nt/ed:9,Deh Cho
ocd-division/country:ca/territory:nt/ed:10,Thebacha
ocd-division/country:ca/territory:nt/ed:11,Weledeh
ocd-division/country:ca/territory:nt/ed:12,Hay River South
ocd-division/country:ca/territory:nt/ed:13,Hay River North
ocd-division/country:ca/territory:nt/ed:14,Range Lake
ocd-division/country:ca/territory:nt/ed:15,Yellowknife South
ocd-division/country:ca/territory:nt/ed:16,Kam Lake
ocd-division/country:ca/territory:nt/ed:17,Frame Lake
ocd-division/country:ca/territory:nt/ed:18,Yellowknife Centre
ocd-division/country:ca/territory:nt/ed:19,Great Slave
ocd-division/country:ca/territory:nt/ed:dehcho,Dehcho
ocd-division/country:ca/territory:nt/ed:frame_lake,Frame Lake
ocd-division/country:ca/territory:nt/ed:great_slave,Great Slave
ocd-division/country:ca/territory:nt/ed:hay_river_north,Hay River North
ocd-division/country:ca/territory:nt/ed:hay_river_south,Hay River South
ocd-division/country:ca/territory:nt/ed:inuvik_boot_lake,Inuvik Boot Lake
ocd-division/country:ca/territory:nt/ed:inuvik_twin_lakes,Inuvik Twin Lakes
ocd-division/country:ca/territory:nt/ed:kam_lake,Kam Lake
ocd-division/country:ca/territory:nt/ed:mackenzie_delta,Mackenzie Delta
ocd-division/country:ca/territory:nt/ed:monfwi,Monfwi
ocd-division/country:ca/territory:nt/ed:nahendeh,Nahendeh
ocd-division/country:ca/territory:nt/ed:nunakput,Nunakput
ocd-division/country:ca/territory:nt/ed:range_lake,Range Lake
ocd-division/country:ca/territory:nt/ed:sahtu,Sahtu
ocd-division/country:ca/territory:nt/ed:thebacha,Thebacha
ocd-division/country:ca/territory:nt/ed:tu_nedhé-wiilideh,Tu Nedhé-Wiilideh
ocd-division/country:ca/territory:nt/ed:yellowknife_centre,Yellowknife Centre
ocd-division/country:ca/territory:nt/ed:yellowknife_north,Yellowknife North
ocd-division/country:ca/territory:nt/ed:yellowknife_south,Yellowknife South
7 changes: 4 additions & 3 deletions scripts/country-ca/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ GEM
net-http-digest_auth (1.4.1)
net-http-persistent (4.0.2)
connection_pool (~> 2.2)
nokogiri (1.15.6-arm64-darwin)
nokogiri (1.13.10-arm64-darwin)
racc (~> 1.4)
nokogiri (1.15.6-x86_64-darwin)
nokogiri (1.13.10-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.15.6-x86_64-linux)
nokogiri (1.13.10-x86_64-linux)
racc (~> 1.4)
public_suffix (5.0.1)
racc (1.7.3)
Expand All @@ -57,6 +57,7 @@ GEM

PLATFORMS
universal-darwin-22
universal-darwin-23
x86_64-linux

DEPENDENCIES
Expand Down
15 changes: 12 additions & 3 deletions scripts/country-ca/ca_nt_electoral_districts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,22 @@

# Scrapes Northwest Territories electoral district codes and names

# https://newsinteractives.cbc.ca/elections/northwest-territories/2023/results/
# https://en.wikipedia.org/wiki/Category:Northwest_Territories_territorial_electoral_districts
REPLACEMENTS = {
"Mackenzie-Delta" => "Mackenzie Delta",
"Tu Nedhé - Wiilideh" => "Tu Nedhé-Wiilideh",
}

class NT < Runner
def names
ShapefileParser.new(
"http://represent.opennorth.ca.s3.amazonaws.com/data/nt_ed.zip",
"https://www.geomatics.gov.nt.ca/en/electoral-district-boundaries",
"territory:nt/ed:", {
:id => "EDNWTF_ID",
:name => "ED",
:name => lambda { |record|
name = record.attributes["ED"].force_encoding("utf-8").encode("utf-8")
REPLACEMENTS.fetch(name, name)
},
}
).run
end
Expand Down
6 changes: 4 additions & 2 deletions scripts/country-ca/run-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ $DIR/ca_bc_electoral_districts.rb names > $DIR/../../identifiers/country-ca
# $DIR/ca_mb_electoral_districts.rb names > $DIR/../../identifiers/country-ca/province-mb-electoral_districts.csv
echo 'ca_nb_electoral_districts'
$DIR/ca_nb_electoral_districts.rb names > $DIR/../../identifiers/country-ca/province-nb-electoral_districts.csv
echo 'ca_ns_electoral_districts'
$DIR/ca_ns_electoral_districts.rb names > $DIR/../../identifiers/country-ca/province-ns-electoral_districts.csv
echo 'ca_nl_electoral_districts'
$DIR/ca_nl_electoral_districts.rb names > $DIR/../../identifiers/country-ca/province-nl-electoral_districts.csv
echo 'ca_ns_electoral_districts'
$DIR/ca_ns_electoral_districts.rb names > $DIR/../../identifiers/country-ca/province-ns-electoral_districts.csv
echo 'ca_nt_electoral_districts'
$DIR/ca_nt_electoral_districts.rb names > $DIR/../../identifiers/country-ca/province-nt-electoral_districts.csv
echo 'ca_on_electoral_districts'
$DIR/ca_on_electoral_districts.rb names > $DIR/../../identifiers/country-ca/province-on-electoral_districts.csv
echo 'ca_pe_electoral_districts'
Expand Down
Loading