diff --git a/.gitignore b/.gitignore index 8568134..84926fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store *.pyc /node_modules +/vendor /topojson/*.geojson diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..0511d80 --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source 'https://rubygems.org' + +gem 'dbf' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..151411a --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,13 @@ +GEM + remote: https://rubygems.org/ + specs: + dbf (4.2.4) + +PLATFORMS + universal-darwin-23 + +DEPENDENCIES + dbf + +BUNDLED WITH + 2.3.12 diff --git a/boundaries/ca_qc_districts/Districts_Quartiers_Mun_election_2021_region.dbf b/boundaries/ca_qc_districts/Districts_Quartiers_Mun_election_2021_region.dbf new file mode 100644 index 0000000..a57107e Binary files /dev/null and b/boundaries/ca_qc_districts/Districts_Quartiers_Mun_election_2021_region.dbf differ diff --git a/boundaries/ca_qc_districts/Districts_Quartiers_Mun_election_2021_region.prj b/boundaries/ca_qc_districts/Districts_Quartiers_Mun_election_2021_region.prj new file mode 100644 index 0000000..9083bc4 --- /dev/null +++ b/boundaries/ca_qc_districts/Districts_Quartiers_Mun_election_2021_region.prj @@ -0,0 +1 @@ +PROJCS["NAD_1983_MTQ_Lambert",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",800000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-70.0],PARAMETER["Standard_Parallel_1",50.0],PARAMETER["Standard_Parallel_2",46.0],PARAMETER["Latitude_Of_Origin",44.0],UNIT["Meter",1.0]] \ No newline at end of file diff --git a/boundaries/ca_qc_districts/Districts_Quartiers_Mun_election_2021_region.shp b/boundaries/ca_qc_districts/Districts_Quartiers_Mun_election_2021_region.shp new file mode 100644 index 0000000..38a38da Binary files /dev/null and b/boundaries/ca_qc_districts/Districts_Quartiers_Mun_election_2021_region.shp differ diff --git a/boundaries/ca_qc_districts/Districts_Quartiers_Mun_election_2021_region.shx b/boundaries/ca_qc_districts/Districts_Quartiers_Mun_election_2021_region.shx new file mode 100644 index 0000000..9b7e81f Binary files /dev/null and b/boundaries/ca_qc_districts/Districts_Quartiers_Mun_election_2021_region.shx differ diff --git a/boundaries/ca_qc_districts/definition.py b/boundaries/ca_qc_districts/definition.py index 9bca056..7a05830 100644 --- a/boundaries/ca_qc_districts/definition.py +++ b/boundaries/ca_qc_districts/definition.py @@ -43,6 +43,7 @@ 22005: ["Sainte-Catherine-de-la-Jacques-Cartier", "districts"], 22010: ["Fossambault-sur-le-Lac", "districts"], 22015: ["Lac-Saint-Joseph", "districts"], + 22020: ["Shannon", "districts"], 22035: ["Stoneham-et-Tewkesbury", "districts"], 22040: ["Lac-Beauport", "districts"], 22045: ["Sainte-Brigitte-de-Laval", "districts"], @@ -68,11 +69,11 @@ 32013: ["Saint-Ferdinand", "districts"], 32033: ["Princeville", "districts"], 32040: ["Plessisville", "districts"], + 32045: ["Plessisville", "districts"], 32065: ["Lyster", "districts"], 33045: ["Saint-Agapit", "districts"], 33052: ["Saint-Flavien", "districts"], 34030: ["Cap-Santé", "districts"], - 34038: ["Saint-Basile", "districts"], 34120: ["Lac-Sergent", "quartiers"], 35027: ["Saint-Tite", "districts"], 36033: ["Shawinigan", "districts"], @@ -94,16 +95,18 @@ 44071: ["Compton", "districts"], 45060: ["Sainte-Catherine-de-Hatley", "districts"], 45072: ["Magog", "districts"], + 45115: ["Orford", "districts"], 46050: ["Dunham", "districts"], 46058: ["Sutton", "districts"], 46075: ["Lac-Brome", "districts"], 46078: ["Bromont", "districts"], - 46080: ["Cowansville", "quartiers"], + 46080: ["Cowansville", "districts"], 46112: ["Farnham", "districts"], 47017: ["Granby", "districts"], 47025: ["Waterloo", "districts"], 47047: ["Roxton Pond", "districts"], 48028: ["Acton Vale", "districts"], + 48038: ["Upton", "districts"], 49048: ["Saint-Germain-de-Grantham", "districts"], 49058: ["Drummondville", "districts"], 49070: ["Saint-Cyrille-de-Wendover", "districts"], @@ -152,7 +155,6 @@ 60005: ["Charlemagne", "districts"], 60013: ["Repentigny", "districts"], 60028: ["L'Assomption", "districts"], - 60035: ["L'Épiphanie", "districts"], 61025: ["Joliette", "districts"], 61027: ["Saint-Thomas", "districts"], 61030: ["Notre-Dame-des-Prairies", "districts"], @@ -187,7 +189,7 @@ 67010: ["Saint-Philippe", "districts"], 67015: ["La Prairie", "districts"], 67020: ["Candiac", "districts"], - 67025: ["Delson", "quartiers"], + 67025: ["Delson", "districts"], 67030: ["Sainte-Catherine", "districts"], 67035: ["Saint-Constant", "districts"], 67045: ["Mercier", "districts"], @@ -225,6 +227,7 @@ 72025: ["Saint-Joseph-du-Lac", "districts"], 72032: ["Oka", "districts"], 72043: ["Saint-Placide", "districts"], + 72802: ["Kanesatake", "districts"], 73005: ["Boisbriand", "districts"], 73010: ["Sainte-Thérèse", "districts"], 73015: ["Blainville", "districts"], @@ -241,12 +244,14 @@ 77035: ["Sainte-Anne-des-Lacs", "districts"], 77055: ["Lac-des-Seize-Îles", "districts"], 77060: ["Wentworth-Nord", "districts"], + 77065: ["Saint-Adolphe-d'Howard", "districts"], 78010: ["Val-David", "districts"], 78047: ["Saint-Faustin—Lac-Carré", "districts"], 78055: ["Montcalm", "districts"], 78070: ["Amherst", "districts"], 78095: ["Lac-Supérieur", "districts"], 78102: ["Mont-Tremblant", "districts"], + 79037: ["Rivière-Rouge", "districts"], 79078: ["Lac-des-Écorces", "districts"], 8053: ["Matane", "districts"], 81017: ["Gatineau", "districts"], @@ -265,8 +270,13 @@ 89008: ["Val-d'Or", "districts"], 89015: ["Malartic", "districts"], 89040: ["Senneterre", "quartiers"], + 89804: ["Lac-Simon", "districts"], 90012: ["La Tuque", "districts"], 9077: ["Mont-Joli", "districts"], + 90801: ["", "districts"], + 90802: ["Wemotaci", "districts"], + 90804: ["Obedjiwan", "districts"], + 9092: ["Sainte-Luce", "districts"], 93005: ["Desbiens", "quartiers"], 93012: ["Métabetchouan—Lac-à-la-Croix", "districts"], 93020: ["Hébertville", "districts"], @@ -286,6 +296,8 @@ 96030: ["Pointe-aux-Outardes", "districts"], 96040: ["Ragueneau", "districts"], 97007: ["Sept-Îles", "districts"], + 97802: ["Uashat", "districts"], + 97804: ["Maliotenam", "districts"], 99060: ["Eeyou Istchee Baie-James", "quartiers"], } @@ -425,7 +437,7 @@ def district_ider(f): boundaries.register('{} {}'.format(name, type), domain='%s, QC' % name, - last_updated=date(2017, 11, 30), + last_updated=date(2023, 5, 1), name_func=district_namer, id_func=district_ider, authority='Directeur général des élections du Québec', @@ -438,7 +450,7 @@ def district_ider(f): boundaries.register('Paroisse de Plessisville districts', domain='Plessisville, QC', - last_updated=date(2017, 11, 30), + last_updated=date(2023, 5, 1), name_func=district_namer, id_func=district_ider, authority='Directeur général des élections du Québec', @@ -540,7 +552,7 @@ def district_ider(f): boundaries.register('%s districts' % name, domain='{}, {}, QC'.format(name, geographic_name), - last_updated=date(2017, 11, 30), + last_updated=date(2023, 5, 1), name_func=district_namer, id_func=district_ider, authority='Directeur général des élections du Québec', @@ -553,7 +565,7 @@ def district_ider(f): boundaries.register('%s boroughs' % geographic_name, domain='%s, QC' % geographic_name, - last_updated=date(2017, 11, 30), + last_updated=date(2023, 5, 1), name_func=borough_namer, id_func=lambda f: int(f.get('NO_ARON')), authority='Directeur général des élections du Québec', diff --git a/boundaries/ca_qc_districts/sets.rb b/boundaries/ca_qc_districts/sets.rb old mode 100644 new mode 100755 index 0450b2f..15db796 --- a/boundaries/ca_qc_districts/sets.rb +++ b/boundaries/ca_qc_districts/sets.rb @@ -1,3 +1,4 @@ +#!/usr/bin/env ruby require 'csv' require 'open-uri' @@ -15,12 +16,12 @@ sets = {} -DBF::Table.new(File.expand_path('Districts_Mun_2017_11_30.dbf', __dir__)).each do |record| +DBF::Table.new(File.expand_path('Districts_Quartiers_Mun_election_2021_region.dbf', __dir__)).each do |record| unless %w(ÉI RI).include?(record['CO_DESIGN'].force_encoding('iso-8859-1').encode('utf-8')) sets[record['CO_MUNCP']] = record['MODE_SUFRG'] end end -sets.each do |k,v| +sets.sort_by{|k,v| k.to_s}.each do |k,v| puts %( #{k}: ["#{names[k]}", "#{v == 'Q' ? 'quartiers' : 'districts'}"],) end