nl_api 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -1
- data/data/BAG_gemeententabel.csv +4 -3
- data/data/{gemeentenalfabetisch2016.csv → gemeentenalfabetisch2017.csv} +2 -4
- data/lib/nl_api/historic_municipality.rb +7 -6
- data/lib/nl_api/municipality.rb +11 -10
- data/lib/nl_api/province.rb +3 -4
- data/lib/nl_api/version.rb +1 -1
- data/nl_api.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43aae0ab9e6df8d5d7ba326302beae097c103941
|
4
|
+
data.tar.gz: 0ef45bf8e7fb582d40a63da463c99363ebacd817
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92542a1a637ffd8cd8b71cb08cd74b7114f8a1f45391646a2e99c86c68ac7aa91230c0fdd19d49f39f80aa688199de6d73ae06b2abe34501308444d5fb27eb60
|
7
|
+
data.tar.gz: '07684606ea119dc657950361280d927522183c1922912035b063b188e5172437cf42ca0e8bb106f59266623c1e755f8010b689720baee69a6d6a0c84f942053d'
|
data/README.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
CBS data on Dutch municipalities packaged as simple gem
|
4
4
|
|
5
|
+
Sources:
|
6
|
+
* [Historic municipality data](http://publicaties.rvig.nl/Landelijke_tabellen/Landelijke_tabellen_32_t_m_60_excl_tabel_35/Landelijke_Tabellen_32_t_m_60_in_csv_formaat)
|
7
|
+
* [Current data](https://www.cbs.nl/nl-nl/onze-diensten/methoden/classificaties/overig/gemeentelijke-indelingen-per-jaar/indeling%20per%20jaar/gemeentelijke-indeling-op-1-januari-2017)
|
8
|
+
|
5
9
|
## Installation
|
6
10
|
|
7
11
|
Add this line to your application's Gemfile:
|
@@ -55,9 +59,10 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
55
59
|
|
56
60
|
- v1.1 Add class to deal with no longer existing municipalities
|
57
61
|
- v1.0 first release
|
62
|
+
|
58
63
|
## Contributing
|
59
64
|
|
60
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
65
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/maartenvanvliet/nl_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
61
66
|
|
62
67
|
|
63
68
|
## License
|
data/data/BAG_gemeententabel.csv
CHANGED
@@ -736,6 +736,7 @@
|
|
736
736
|
"1111","Meeuwen","0771","","19230501",""
|
737
737
|
"1265","Meeuwen, Hill en Babyloniënbroek","1111","","19080801",""
|
738
738
|
"0813","Megen, Haren en Macharen","0828","","19940101",""
|
739
|
+
"1948","Meierijstad","","20170101","",""
|
739
740
|
"0941","Meijel","1894","","20100101",""
|
740
741
|
"0939","Melick en Herkenbosch","1669","","19930101",""
|
741
742
|
"1112","Meliskerke","0686","","19660701",""
|
@@ -1061,7 +1062,7 @@
|
|
1061
1062
|
"1170","Schiebroek","0599","","19410801",""
|
1062
1063
|
"0606","Schiedam","","","",""
|
1063
1064
|
"0088","Schiermonnikoog","","","",""
|
1064
|
-
"0844","Schijndel","","","",""
|
1065
|
+
"0844","Schijndel","1948","","20170101",""
|
1065
1066
|
"0961","Schimmert","0951","","19820101",""
|
1066
1067
|
"1171","Schin op Geul","0982","","19401001",""
|
1067
1068
|
"0962","Schinnen","","","",""
|
@@ -1108,7 +1109,7 @@
|
|
1108
1109
|
"0708","Sint-Annaland","0716","","19710701",""
|
1109
1110
|
"0711","Sint-Maartensdijk","0716","","19710701",""
|
1110
1111
|
"0845","Sint-Michielsgestel","","","",""
|
1111
|
-
"0846","Sint-Oedenrode","","","",""
|
1112
|
+
"0846","Sint-Oedenrode","1948","","20170101",""
|
1112
1113
|
"0968","Sittard","1883","","20010101",""
|
1113
1114
|
"1883","Sittard-Geleen","","20010101","",""
|
1114
1115
|
"0051","Skarsterlân","1921","19850301","20140101",""
|
@@ -1246,7 +1247,7 @@
|
|
1246
1247
|
"0345","Veenendaal","","","",""
|
1247
1248
|
"1384","Veenhuizen","0398","","18540413",""
|
1248
1249
|
"0717","Veere","","","",""
|
1249
|
-
"0860","Veghel","","","",""
|
1250
|
+
"0860","Veghel","1948","","20170101",""
|
1250
1251
|
"0861","Veldhoven","","19210101","",""
|
1251
1252
|
"1206","Veldhoven en Meerveldhoven","0861","","19210501",""
|
1252
1253
|
"1207","Veldhuizen","0347","","19540101",""
|
@@ -208,6 +208,7 @@ Gemeentecode;Gemeentenaam;Provincienaam;Provinciecode
|
|
208
208
|
0025;Marum;Groningen;20
|
209
209
|
0420;Medemblik;Noord-Holland;27
|
210
210
|
0938;Meerssen;Limburg;31
|
211
|
+
1948;Meierijstad;Noord-Brabant;30
|
211
212
|
1908;Menameradiel;Friesland;21
|
212
213
|
1987;Menterwolde;Groningen;20
|
213
214
|
0119;Meppel;Drenthe;22
|
@@ -285,13 +286,11 @@ Gemeentecode;Gemeentenaam;Provincienaam;Provinciecode
|
|
285
286
|
0279;Scherpenzeel;Gelderland;25
|
286
287
|
0606;Schiedam;Zuid-Holland;28
|
287
288
|
0088;Schiermonnikoog;Friesland;21
|
288
|
-
0844;Schijndel;Noord-Brabant;30
|
289
289
|
0962;Schinnen;Limburg;31
|
290
290
|
1676;Schouwen-Duiveland;Zeeland;29
|
291
291
|
0965;Simpelveld;Limburg;31
|
292
292
|
1702;Sint Anthonis;Noord-Brabant;30
|
293
293
|
0845;Sint-Michielsgestel;Noord-Brabant;30
|
294
|
-
0846;Sint-Oedenrode;Noord-Brabant;30
|
295
294
|
1883;Sittard-Geleen;Limburg;31
|
296
295
|
0610;Sliedrecht;Zuid-Holland;28
|
297
296
|
0040;Slochteren;Groningen;20
|
@@ -308,7 +307,7 @@ Gemeentecode;Gemeentenaam;Provincienaam;Provinciecode
|
|
308
307
|
0971;Stein;Limburg;31
|
309
308
|
1904;Stichtse Vecht;Utrecht;26
|
310
309
|
0617;Strijen;Zuid-Holland;28
|
311
|
-
1900;
|
310
|
+
1900;S�dwest-Frysl�n;Friesland;21
|
312
311
|
0715;Terneuzen;Zeeland;29
|
313
312
|
0093;Terschelling;Friesland;21
|
314
313
|
0448;Texel;Noord-Holland;27
|
@@ -332,7 +331,6 @@ Gemeentecode;Gemeentenaam;Provincienaam;Provinciecode
|
|
332
331
|
0047;Veendam;Groningen;20
|
333
332
|
0345;Veenendaal;Utrecht;26
|
334
333
|
0717;Veere;Zeeland;29
|
335
|
-
0860;Veghel;Noord-Brabant;30
|
336
334
|
0861;Veldhoven;Noord-Brabant;30
|
337
335
|
0453;Velsen;Noord-Holland;27
|
338
336
|
0983;Venlo;Limburg;31
|
@@ -34,12 +34,13 @@ class NlApi::HistoricMunicipality
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def read_csv
|
37
|
-
@store ||= CSV.read(path, headers: true, col_sep: ',').map
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
37
|
+
@store ||= CSV.read(path, headers: true, col_sep: ',').map do |line|
|
38
|
+
NlApi::HistoricMunicipality.new(
|
39
|
+
code: line[0].to_i,
|
40
|
+
name: line[1],
|
41
|
+
code_after_merge: line[2].to_i
|
42
|
+
)
|
43
|
+
end
|
43
44
|
end
|
44
45
|
|
45
46
|
def all
|
data/lib/nl_api/municipality.rb
CHANGED
@@ -32,13 +32,14 @@ class NlApi::Municipality
|
|
32
32
|
end
|
33
33
|
|
34
34
|
def read_csv
|
35
|
-
@store ||= CSV.read(path, headers: true, col_sep: ';').map
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
35
|
+
@store ||= CSV.read(path, headers: true, col_sep: ';').map do |line|
|
36
|
+
NlApi::Municipality.new(
|
37
|
+
code: line[0].to_i,
|
38
|
+
name: line[1],
|
39
|
+
province_name: line[2],
|
40
|
+
province_code: line[3].to_i
|
41
|
+
)
|
42
|
+
end
|
42
43
|
end
|
43
44
|
|
44
45
|
def provinces
|
@@ -58,14 +59,14 @@ class NlApi::Municipality
|
|
58
59
|
field = where.keys.first
|
59
60
|
value = where.values.first
|
60
61
|
|
61
|
-
find{ |i| i.send(field.to_sym) == value }
|
62
|
+
find { |i| i.send(field.to_sym) == value }
|
62
63
|
end
|
63
64
|
|
64
65
|
def find_all_by(where)
|
65
66
|
field = where.keys.first
|
66
67
|
value = where.values.first
|
67
68
|
|
68
|
-
find_all{ |i| i.send(field.to_sym) == value }
|
69
|
+
find_all { |i| i.send(field.to_sym) == value }
|
69
70
|
end
|
70
71
|
end
|
71
|
-
end
|
72
|
+
end
|
data/lib/nl_api/province.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
class NlApi::Province
|
2
|
-
|
3
2
|
attr_accessor :province_code, :province_name
|
4
3
|
|
5
4
|
def initialize(province_code, province_name)
|
@@ -8,7 +7,7 @@ class NlApi::Province
|
|
8
7
|
end
|
9
8
|
|
10
9
|
def municipalities
|
11
|
-
@municipalities ||=
|
10
|
+
@municipalities ||=
|
11
|
+
NlApi::Municipality.find_all_by(province_code: province_code)
|
12
12
|
end
|
13
|
-
|
14
|
-
end
|
13
|
+
end
|
data/lib/nl_api/version.rb
CHANGED
data/nl_api.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
|
12
12
|
spec.summary = %q{Simple wrapper for CBS municipality data}
|
13
13
|
spec.description = %q{Simple wrapper for CBS municipality data. Useful for finding province/municipalities by their codes or vice versa}
|
14
|
-
spec.homepage = "https://
|
14
|
+
spec.homepage = "https://github.com/maartenvanvliet/nl_api"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nl_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maarten van Vliet
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -70,14 +70,14 @@ files:
|
|
70
70
|
- bin/console
|
71
71
|
- bin/setup
|
72
72
|
- data/BAG_gemeententabel.csv
|
73
|
-
- data/
|
73
|
+
- data/gemeentenalfabetisch2017.csv
|
74
74
|
- lib/nl_api.rb
|
75
75
|
- lib/nl_api/historic_municipality.rb
|
76
76
|
- lib/nl_api/municipality.rb
|
77
77
|
- lib/nl_api/province.rb
|
78
78
|
- lib/nl_api/version.rb
|
79
79
|
- nl_api.gemspec
|
80
|
-
homepage: https://
|
80
|
+
homepage: https://github.com/maartenvanvliet/nl_api
|
81
81
|
licenses:
|
82
82
|
- MIT
|
83
83
|
metadata: {}
|
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
97
|
version: '0'
|
98
98
|
requirements: []
|
99
99
|
rubyforge_project:
|
100
|
-
rubygems_version: 2.
|
100
|
+
rubygems_version: 2.5.2
|
101
101
|
signing_key:
|
102
102
|
specification_version: 4
|
103
103
|
summary: Simple wrapper for CBS municipality data
|