turkish_cities 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -1
- data/CHANGELOG.md +10 -0
- data/Gemfile.lock +1 -1
- data/README.md +99 -14
- data/{config → lib/config}/locales/en.yml +1 -0
- data/{config → lib/config}/locales/tr.yml +2 -1
- data/lib/turkish_cities/data/cities.yaml +162 -0
- data/lib/turkish_cities/elevation.rb +42 -0
- data/lib/turkish_cities/helpers/decomposer_helper.rb +20 -4
- data/lib/turkish_cities/population.rb +8 -14
- data/lib/turkish_cities/version.rb +1 -1
- data/lib/turkish_cities.rb +7 -2
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 960c3988d72a7f5e012c1e576340e354715433b247664f41c9fce072a4f9eaae
|
4
|
+
data.tar.gz: 602da0c9a6929f9b65a450d67a6342efb9ccc39128ce5a0d828f43b947eeb9ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58d77fb5329d83b9aca19163da82e87f699508f4bdd4ba1f62320d2ba01cfad6a30b0f8bd8360b83204d8d17d88641051c5efbc3d98a71e91baa211679eb866e
|
7
|
+
data.tar.gz: b57f42d6b6b3f926534a2b015913a346ae72a9c7b4623abfe80dbab7f3577f0daff8f8d986843a9f4131bd71d0037152426f9fce3472b19e9e9a615e9e91a758
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 0.7.0 (2022-08-03)
|
4
|
+
|
5
|
+
### New features
|
6
|
+
|
7
|
+
* [#14](https://github.com/sarslanoglu/turkish_cities/issues/14): Add city altitude data and ```find_by_elevation``` method
|
8
|
+
|
9
|
+
### Bug fixes
|
10
|
+
|
11
|
+
* [#116](https://github.com/sarslanoglu/turkish_cities/issues/116): translation missing error on Rails apps
|
12
|
+
|
3
13
|
## 0.6.1 (2022-07-18)
|
4
14
|
|
5
15
|
### Bug fixes
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -51,6 +51,14 @@ https://rubygems.org/gems/turkish_cities
|
|
51
51
|
</ul>
|
52
52
|
</li>
|
53
53
|
<li><a href="#finding-city-district-and-subdistrict-name-by-postcode">Finding city, district and subdistrict name by postcode</a></li>
|
54
|
+
<li>
|
55
|
+
<a href="#finding-city-name-with-elevation-data">Finding city name with elevation data</a>
|
56
|
+
<ul>
|
57
|
+
<li><a href="#below-given">Below given</a></li>
|
58
|
+
<li><a href="#above-given">Above given</a></li>
|
59
|
+
<li><a href="#between-search">Between search</a></li>
|
60
|
+
</ul>
|
61
|
+
</li>
|
54
62
|
<li>
|
55
63
|
<a href="#finding-city-name-with-population-data">Finding city name with population data</a>
|
56
64
|
<ul>
|
@@ -356,8 +364,81 @@ TurkishCities.find_by_postcode('100000') # => Given value [100000] is outside bo
|
|
356
364
|
```
|
357
365
|
</details>
|
358
366
|
|
367
|
+
### Finding city name with elevation data
|
368
|
+
|
369
|
+
The lowest possible altitude for a city in Turkey is 4 meters with Kocaeli. The highest possible altitude is 1923 meters with Erzurum. Being far outside of the range may give errors.
|
370
|
+
|
371
|
+
### Below given
|
372
|
+
|
373
|
+
Search city name with below elevation
|
374
|
+
|
375
|
+
<details>
|
376
|
+
<summary>Expand</summary>
|
377
|
+
|
378
|
+
```rb
|
379
|
+
TurkishCities.find_by_elevation('below', 10)
|
380
|
+
# => ["İzmir", "Kocaeli", "Yalova"]
|
381
|
+
TurkishCities.find_by_elevation('below', 50)
|
382
|
+
# => ["Adana", "Çanakkale" ... "Bartın", "Yalova"]
|
383
|
+
TurkishCities.find_by_elevation('below', 500)
|
384
|
+
# => ["Adana", "Amasya" ... "Karabük", "Osmaniye", "Düzce"]
|
385
|
+
TurkishCities.find_by_elevation('below', 2213)
|
386
|
+
# => ["Adana", "Adıyaman" ... "Kilis", "Osmaniye", "Düzce"]
|
387
|
+
TurkishCities.find_by_elevation('woleb', 213)
|
388
|
+
# => ArgumentError: "Elevation type 'woleb' is unsupported"
|
389
|
+
TurkishCities.find_by_elevation('below', 1)
|
390
|
+
# => RangeError: Given value [1] is outside bounds of 3 to Infinity
|
391
|
+
```
|
392
|
+
</details>
|
393
|
+
|
394
|
+
### Above given
|
395
|
+
|
396
|
+
Search city name with above elevation
|
397
|
+
|
398
|
+
<details>
|
399
|
+
<summary>Expand</summary>
|
400
|
+
|
401
|
+
```rb
|
402
|
+
TurkishCities.find_by_elevation('above', 0)
|
403
|
+
# => ["Adana", "Adıyaman" ... "Osmaniye", "Düzce"]
|
404
|
+
TurkishCities.find_by_elevation('above', 100)
|
405
|
+
# => ["Adıyaman", "Afyon" ... "Osmaniye", "Düzce"]
|
406
|
+
TurkishCities.find_by_elevation('above', 500)
|
407
|
+
# => ["Adıyaman", "Afyon" ... "Iğdır", "Kilis"]
|
408
|
+
TurkishCities.find_by_elevation('above', 1750)
|
409
|
+
# => ["Erzurum", "Hakkari", "Kars", "Ardahan"]
|
410
|
+
TurkishCities.find_by_elevation('abov', 1000)
|
411
|
+
# => ArgumentError: "Elevation type 'abov' is unsupported"
|
412
|
+
TurkishCities.find_by_elevation('above', 2000)
|
413
|
+
# => RangeError: Given value [2000] is outside bounds of 0 to 1924
|
414
|
+
```
|
415
|
+
</details>
|
416
|
+
|
417
|
+
### Between search
|
418
|
+
|
419
|
+
Search city name with between elevation
|
420
|
+
|
421
|
+
<details>
|
422
|
+
<summary>Expand</summary>
|
423
|
+
|
424
|
+
```rb
|
425
|
+
TurkishCities.find_by_elevation('between', 50, 100)
|
426
|
+
# => ["Antalya", "Aydın", "Hatay", "Manisa"]
|
427
|
+
TurkishCities.find_by_elevation('between', 100, 250)
|
428
|
+
# => ["Balıkesir", "Bursa", "Kırklareli", "Osmaniye", "Düzce"]
|
429
|
+
TurkishCities.find_by_elevation('between', 250, 1000)
|
430
|
+
# => ["Adıyaman", "Amasya" ... "Karabük", "Kilis"]
|
431
|
+
TurkishCities.find_by_elevation('between', 0, 2000)
|
432
|
+
# => ["Adana", "Adıyaman" ... "Osmaniye", "Düzce"]
|
433
|
+
TurkishCities.find_by_elevation('between', 2000, 5000)
|
434
|
+
# => []
|
435
|
+
```
|
436
|
+
</details>
|
437
|
+
|
359
438
|
### Finding city name with population data
|
360
439
|
|
440
|
+
The least populated city in Turkey is Tunceli with 83645. The highest populated is Istanbul with 15840900. Being far outside of the range may give errors.
|
441
|
+
|
361
442
|
### Exact search
|
362
443
|
|
363
444
|
Search city name with exact population
|
@@ -368,12 +449,14 @@ Search city name with exact population
|
|
368
449
|
```rb
|
369
450
|
TurkishCities.find_by_population('exact', 15840900)
|
370
451
|
# => ["İstanbul"]
|
452
|
+
TurkishCities.find_by_population('exact', 104320)
|
453
|
+
# => "Couldn't find any city with population data"
|
371
454
|
TurkishCities.find_by_population('exatc', 2130432)
|
372
455
|
# => "Population type 'exatc' is unsupported"
|
373
456
|
TurkishCities.find_by_population('exact', 10432)
|
374
|
-
# => []
|
457
|
+
# => Given value [10432] is outside bounds of 83644 to 15840901
|
375
458
|
TurkishCities.find_by_population('exact', 22130432)
|
376
|
-
# => []
|
459
|
+
# => Given value [22130432] is outside bounds of 83644 to 15840901
|
377
460
|
```
|
378
461
|
</details>
|
379
462
|
|
@@ -389,14 +472,14 @@ TurkishCities.find_by_population('below', 86000)
|
|
389
472
|
# => ["Tunceli", "Bayburt"]
|
390
473
|
TurkishCities.find_by_population('below', 500000)
|
391
474
|
# => ["Amasya", "Artvin" ... "Kilis", "Düzce"]
|
392
|
-
TurkishCities.find_by_population('below',
|
475
|
+
TurkishCities.find_by_population('below', 1000000)
|
476
|
+
# => ["Adıyaman", "Afyon" ... "Kilis", "Osmaniye", "Düzce"]
|
477
|
+
TurkishCities.find_by_population('below', 22130432)
|
393
478
|
# => ["Adana", "Adıyaman" ... "Kilis", "Osmaniye", "Düzce"]
|
394
479
|
TurkishCities.find_by_population('woleb', 2130432)
|
395
480
|
# => "Population type 'woleb' is unsupported"
|
396
481
|
TurkishCities.find_by_population('below', 10432)
|
397
|
-
# => []
|
398
|
-
TurkishCities.find_by_population('below', 22130432)
|
399
|
-
# => []
|
482
|
+
# => Given value [10432] is outside bounds of 83644 to Infinity
|
400
483
|
```
|
401
484
|
</details>
|
402
485
|
|
@@ -414,12 +497,12 @@ TurkishCities.find_by_population('above', 2500000)
|
|
414
497
|
# => ["Ankara", "Antalya", "Bursa", "İstanbul", "İzmir"]
|
415
498
|
TurkishCities.find_by_population('above', 5000000)
|
416
499
|
# => ["Ankara", "İstanbul"]
|
500
|
+
TurkishCities.find_by_population('above', 10432)
|
501
|
+
# => ["Adana", "Adıyaman" ... "Kilis", "Osmaniye", "Düzce"]
|
417
502
|
TurkishCities.find_by_population('abov', 2130432)
|
418
503
|
# => "Population type 'abov' is unsupported"
|
419
|
-
TurkishCities.find_by_population('above', 10432)
|
420
|
-
# => []
|
421
504
|
TurkishCities.find_by_population('above', 22130432)
|
422
|
-
# => []
|
505
|
+
# => Given value [22130432] is outside bounds of 0 to 15840901
|
423
506
|
```
|
424
507
|
</details>
|
425
508
|
|
@@ -431,16 +514,18 @@ Search city name with between population
|
|
431
514
|
<summary>Expand</summary>
|
432
515
|
|
433
516
|
```rb
|
434
|
-
TurkishCities.find_by_population('between',
|
435
|
-
# => ["Ankara", "Bursa", "İzmir"]
|
517
|
+
TurkishCities.find_by_population('between', 15840901, 3000000)
|
518
|
+
# => ["Ankara", "Bursa", "İstanbul", İzmir"]
|
436
519
|
TurkishCities.find_by_population('between', 828369, 985732)
|
437
520
|
# => ["Eskişehir", "Mardin"]
|
438
521
|
TurkishCities.find_by_population('between', 2130432, 3500000)
|
439
522
|
# => ["Adana", "Antalya", "Bursa", "Konya", "Şanlıurfa"]
|
440
523
|
TurkishCities.find_by_population('between', 10432, 100000)
|
441
|
-
# => []
|
442
|
-
TurkishCities.find_by_population('between',
|
443
|
-
# => []
|
524
|
+
# => ["Tunceli", "Bayburt", "Ardahan"]
|
525
|
+
TurkishCities.find_by_population('between', 11304320, 34000000)
|
526
|
+
# => ["İstanbul"]
|
527
|
+
TurkishCities.find_by_population('between', 100000, 100001)
|
528
|
+
# => "Couldn't find any city with population data"
|
444
529
|
```
|
445
530
|
</details>
|
446
531
|
|
@@ -11,6 +11,7 @@ en:
|
|
11
11
|
outside_bounds: "Given value [%{input}] is outside bounds of %{min} to %{max}"
|
12
12
|
postcode_not_found_error: "Couldn't find any subdistrict with postcode '%{postcode_input}'"
|
13
13
|
subdistrict_not_found_error: "Couldn't find subdistrict with '%{subdistrict_input}' of '%{district_input}'/'%{city_input}'"
|
14
|
+
unsupported_elevation_type: "Elevation type '%{input}' is unsupported"
|
14
15
|
unsupported_population_type: "Population type '%{input}' is unsupported"
|
15
16
|
unsupported_travel_method: "Travel method '%{input}' is unsupported"
|
16
17
|
language:
|
@@ -11,7 +11,8 @@ tr:
|
|
11
11
|
outside_bounds: "Girilen değer [%{input}] %{min} ile %{max} değerleri dışında"
|
12
12
|
postcode_not_found_error: "'%{postcode_input}' posta kodu ile kayıt bulunamadı"
|
13
13
|
subdistrict_not_found_error: "'%{subdistrict_input}' ile '%{district_input}'/'%{city_input}' ait bir kayıt bulunamdı"
|
14
|
-
|
14
|
+
unsupported_elevation_type: "'%{input}' ile rakım arama desteklenmiyor"
|
15
|
+
unsupported_population_type: "'%{input}' ile nüfus arama desteklenmiyor"
|
15
16
|
unsupported_travel_method: "'%{input}' yolculuk methodu desteklenmiyor"
|
16
17
|
language:
|
17
18
|
errors:
|
@@ -8,6 +8,8 @@
|
|
8
8
|
region: 'Akdeniz'
|
9
9
|
has_sea_access: true
|
10
10
|
population: 2263373
|
11
|
+
area: 13844
|
12
|
+
altitude: 25
|
11
13
|
districts: ['Aladağ', 'Ceyhan', 'Çukurova', 'Feke', 'İmamoğlu', 'Karaisalı', 'Karataş', 'Kozan', 'Pozantı',
|
12
14
|
'Saimbeyli', 'Sarıçam', 'Seyhan', 'Tufanbeyli', 'Yumurtalık', 'Yüreğir']
|
13
15
|
land_distance: [335, 575, 966, 603, 492, 535, 1035, 874, 903, 773, 636, 732, 690, 657, 842, 1101, 577, 581, 755,
|
@@ -24,6 +26,8 @@
|
|
24
26
|
region: 'Güneydoğu Anadolu'
|
25
27
|
has_sea_access: false
|
26
28
|
population: 632148
|
29
|
+
area: 7337
|
30
|
+
altitude: 701
|
27
31
|
districts: ['Besni', 'Çelikhan', 'Gerger', 'Gölbaşı', 'Kahta', 'Merkez', 'Samsat', 'Sincik', 'Tut']
|
28
32
|
land_distance: [910, 648, 632, 742, 870, 751, 1209, 1238, 1045, 348, 414, 936, 992, 1114, 1385, 771, 696, 1090, 207,
|
29
33
|
1428, 285, 550, 525, 962, 150, 710, 683, 660, 316, 952, 404, 1198, 1236, 728, 877, 424, 1409, 558, 1087, 693,
|
@@ -39,6 +43,8 @@
|
|
39
43
|
region: 'Ege'
|
40
44
|
has_sea_access: false
|
41
45
|
population: 744179
|
46
|
+
area: 14016
|
47
|
+
altitude: 1012
|
42
48
|
districts: ['Başmakçı', 'Bayat', 'Bolvadin', 'Çay', 'Çobanlar', 'Dazkırı', 'Dinar', 'Emirdağ', 'Evciler', 'Hocalar',
|
43
49
|
'İhsaniye', 'İscehisar', 'Kızılören', 'Merkez', 'Sandıklı', 'Sinanpaşa', 'Sultandağı', 'Şuhut']
|
44
50
|
land_distance: [1318, 597, 256, 291, 1243, 345, 328, 212, 1095, 1285, 420, 169, 277, 526, 397, 505, 222, 1100, 684,
|
@@ -55,6 +61,8 @@
|
|
55
61
|
region: 'Doğu Anadolu'
|
56
62
|
has_sea_access: false
|
57
63
|
population: 524644
|
64
|
+
area: 11099
|
65
|
+
altitude: 1630
|
58
66
|
districts: ['Diyadin', 'Doğubayazıt', 'Eleşkirt', 'Hamur', 'Merkez', 'Patnos', 'Taşlıçay', 'Tutak']
|
59
67
|
land_distance: [736, 1054, 1428, 396, 1640, 1567, 1358, 356, 234, 1145, 1423, 1416, 1687, 984, 828, 1517, 441, 1637,
|
60
68
|
496, 370, 183, 1295, 754, 545, 383, 425, 947, 1373, 1035, 1407, 1640, 214, 990, 812, 1618, 942, 1296, 1114, 1373,
|
@@ -70,6 +78,8 @@
|
|
70
78
|
region: 'Karadeniz'
|
71
79
|
has_sea_access: false
|
72
80
|
population: 335331
|
81
|
+
area: 5628
|
82
|
+
altitude: 400
|
73
83
|
districts: ['Göynücek', 'Gümüşhacıköy', 'Hamamözü', 'Merkez', 'Merzifon', 'Suluova', 'Taşova']
|
74
84
|
land_distance: [333, 825, 693, 938, 831, 622, 641, 831, 409, 762, 680, 951, 248, 92, 815, 696, 901, 543, 366, 556,
|
75
85
|
574, 584, 321, 433, 1131, 681, 719, 639, 671, 919, 756, 254, 346, 882, 312, 560, 511, 652, 463, 903, 508, 792, 960,
|
@@ -85,6 +95,8 @@
|
|
85
95
|
region: 'İç Anadolu'
|
86
96
|
has_sea_access: false
|
87
97
|
population: 5747325
|
98
|
+
area: 25632
|
99
|
+
altitude: 905
|
88
100
|
districts: ['Akyurt', 'Altındağ', 'Ayaş', 'Bala', 'Beypazarı', 'Çamlıdere', 'Çankaya', 'Çubuk', 'Elmadağ',
|
89
101
|
'Etimesgut', 'Evren', 'Gölbaşı', 'Güdül', 'Haymana', 'Kahramankazan', 'Kalecik', 'Keçiören', 'Kızılcahamam',
|
90
102
|
'Mamak', 'Nallıhan', 'Polatlı', 'Pursaklar', 'Sincan', 'Şereflikoçhisar', 'Yenimahalle']
|
@@ -102,6 +114,8 @@
|
|
102
114
|
region: 'Akdeniz'
|
103
115
|
has_sea_access: true
|
104
116
|
population: 2619832
|
117
|
+
area: 20177
|
118
|
+
altitude: 62
|
105
119
|
districts: ['Akseki', 'Aksu', 'Alanya', 'Demre', 'Döşemealtı', 'Elmalı', 'Finike', 'Gazipaşa', 'Gündoğmuş', 'İbradı',
|
106
120
|
'Kaş', 'Kemer', 'Kepez', 'Konyaaltı', 'Korkuteli', 'Kumluca', 'Manavgat', 'Muratpaşa', 'Serik']
|
107
121
|
land_distance: [1466, 339, 507, 475, 1171, 1267, 683, 122, 540, 702, 667, 733, 220, 1060, 910, 1029, 1058, 1248, 423,
|
@@ -118,6 +132,8 @@
|
|
118
132
|
region: 'Karadeniz'
|
119
133
|
has_sea_access: true
|
120
134
|
population: 169543
|
135
|
+
area: 7393
|
136
|
+
altitude: 530
|
121
137
|
districts: ['Ardanuç', 'Arhavi', 'Borçka', 'Hopa', 'Kemalpaşa', 'Merkez', 'Murgul', 'Şavşat', 'Yusufeli']
|
122
138
|
land_distance: [1584, 1460, 1251, 403, 562, 1038, 1408, 1309, 1580, 894, 738, 1461, 544, 1530, 543, 408, 226, 1220,
|
123
139
|
857, 372, 336, 761, 1016, 1365, 1104, 1300, 1565, 207, 856, 850, 1511, 949, 1189, 1152, 1298, 639, 1549, 863, 640,
|
@@ -133,6 +149,8 @@
|
|
133
149
|
region: 'Ege'
|
134
150
|
has_sea_access: true
|
135
151
|
population: 1134031
|
152
|
+
area: 8116
|
153
|
+
altitude: 92
|
136
154
|
districts: ['Bozdoğan', 'Buharkent', 'Çine', 'Didim', 'Efeler', 'Germencik', 'İncirliova', 'Karacasu', 'Karpuzlu',
|
137
155
|
'Koçarlı', 'Köşk', 'Kuşadası', 'Kuyucak', 'Nazilli', 'Söke', 'Sultanhisar', 'Yenipazar']
|
138
156
|
land_distance: [296, 520, 1404, 1594, 716, 269, 445, 451, 738, 846, 126, 1399, 659, 1262, 1270, 1460, 477, 1086,
|
@@ -149,6 +167,8 @@
|
|
149
167
|
region: 'Marmara'
|
150
168
|
has_sea_access: true
|
151
169
|
population: 1250610
|
170
|
+
area: 14583
|
171
|
+
altitude: 145
|
152
172
|
districts: ['Altıeylül', 'Ayvalık', 'Balya', 'Bandırma', 'Bigadiç', 'Burhaniye', 'Dursunbey', 'Edremit', 'Erdek',
|
153
173
|
'Gömeç', 'Gönen', 'Havran', 'İvrindi', 'Karesi', 'Kepsut', 'Manyas', 'Marmara', 'Savaştepe', 'Sındırgı',
|
154
174
|
'Susurluk']
|
@@ -166,6 +186,8 @@
|
|
166
186
|
region: 'Marmara'
|
167
187
|
has_sea_access: false
|
168
188
|
population: 228334
|
189
|
+
area: 4179
|
190
|
+
altitude: 513
|
169
191
|
districts: ['Bozüyük', 'Gölpazarı', 'İnhisar', 'Merkez', 'Osmaneli', 'Pazaryeri', 'Söğüt', 'Yenipazar']
|
170
192
|
land_distance: [1194, 1384, 213, 353, 94, 365, 446, 565, 397, 1203, 477, 1052, 988, 1178, 83, 957, 879, 1041, 1643,
|
171
193
|
964, 352, 763, 247, 419, 1378, 458, 620, 458, 486, 136, 421, 112, 954, 384, 881, 1282, 542, 1301, 577, 648, 835,
|
@@ -181,6 +203,8 @@
|
|
181
203
|
region: 'Doğu Anadolu'
|
182
204
|
has_sea_access: false
|
183
205
|
population: 283112
|
206
|
+
area: 8004
|
207
|
+
altitude: 1159
|
184
208
|
districts: ['Adaklı', 'Genç', 'Karlıova', 'Kiğı', 'Merkez', 'Solhan', 'Yayladere', 'Yedisu']
|
185
209
|
land_distance: [194, 1050, 1187, 1264, 1535, 889, 733, 1281, 141, 1542, 144, 275, 177, 1112, 454, 542, 380, 494, 617,
|
186
210
|
1137, 705, 1312, 1421, 380, 895, 574, 1523, 708, 1201, 878, 1190, 240, 1405, 464, 237, 1426, 111, 655, 702, 586,
|
@@ -196,6 +220,8 @@
|
|
196
220
|
region: 'Doğu Anadolu'
|
197
221
|
has_sea_access: false
|
198
222
|
population: 352277
|
223
|
+
area: 8294
|
224
|
+
altitude: 1637
|
199
225
|
districts: ['Adilcevaz', 'Ahlat', 'Güroymak', 'Hizan', 'Merkez', 'Mutki', 'Tatvan']
|
200
226
|
land_distance: [1240, 1377, 1454, 1725, 1079, 923, 1471, 207, 1732, 334, 465, 349, 1302, 520, 711, 549, 328, 713,
|
201
227
|
1327, 801, 1502, 1611, 432, 1085, 764, 1713, 898, 1391, 1068, 1380, 430, 1595, 577, 285, 1578, 83, 845, 892, 755,
|
@@ -211,6 +237,8 @@
|
|
211
237
|
region: 'Karadeniz'
|
212
238
|
has_sea_access: false
|
213
239
|
population: 320014
|
240
|
+
area: 8313
|
241
|
+
altitude: 741
|
214
242
|
districts: ['Dörtdivan', 'Gerede', 'Göynük', 'Kıbrıscık', 'Mengen', 'Merkez', 'Mudurnu', 'Seben', 'Yeniçağa']
|
215
243
|
land_distance: [561, 271, 542, 233, 352, 605, 1095, 492, 944, 775, 965, 291, 849, 666, 828, 1535, 881, 560, 683, 262,
|
216
244
|
596, 1165, 245, 512, 473, 378, 151, 456, 320, 846, 561, 773, 1174, 750, 1157, 469, 545, 622, 877, 114, 472, 1281,
|
@@ -226,6 +254,8 @@
|
|
226
254
|
region: 'Akdeniz'
|
227
255
|
has_sea_access: false
|
228
256
|
population: 273716
|
257
|
+
area: 7175
|
258
|
+
altitude: 963
|
229
259
|
districts: ['Ağlasun', 'Altınyayla', 'Bucak', 'Çavdır', 'Çeltikçi', 'Gölhisar', 'Karamanlı', 'Kemer', 'Merkez',
|
230
260
|
'Tefenni', 'Yeşilova']
|
231
261
|
land_distance: [418, 593, 562, 670, 150, 1182, 801, 1045, 1053, 1243, 301, 869, 1036, 1161, 1555, 848, 51, 588, 595,
|
@@ -242,6 +272,8 @@
|
|
242
272
|
region: 'Marmara'
|
243
273
|
has_sea_access: true
|
244
274
|
population: 3147818
|
275
|
+
area: 10813
|
276
|
+
altitude: 238
|
245
277
|
districts: ['Büyükorhan', 'Gemlik', 'Gürsu', 'Harmancık', 'İnegöl', 'İznik', 'Karacabey', 'Keles', 'Kestel',
|
246
278
|
'Mudanya', 'Mustafakemalpaşa', 'Nilüfer', 'Orhaneli', 'Orhangazi', 'Osmangazi', 'Yenişehir', 'Yıldırım']
|
247
279
|
land_distance: [271, 504, 623, 436, 1272, 419, 1121, 1046, 1236, 152, 1026, 937, 1099, 1712, 1033, 417, 832, 243,
|
@@ -258,6 +290,8 @@
|
|
258
290
|
region: 'Marmara'
|
259
291
|
has_sea_access: true
|
260
292
|
population: 557276
|
293
|
+
area: 9817
|
294
|
+
altitude: 11
|
261
295
|
districts: ['Ayvacık', 'Bayramiç', 'Biga', 'Bozcaada', 'Çan', 'Eceabat', 'Ezine', 'Gelibolu', 'Gökçeada', 'Lapseki',
|
262
296
|
'Merkez', 'Yenice']
|
263
297
|
land_distance: [775, 894, 482, 1543, 216, 1392, 1317, 1507, 423, 1297, 1208, 1370, 1983, 1292, 592, 1091, 318, 327,
|
@@ -274,6 +308,8 @@
|
|
274
308
|
region: 'İç Anadolu'
|
275
309
|
has_sea_access: false
|
276
310
|
population: 196515
|
311
|
+
area: 7542
|
312
|
+
altitude: 730
|
277
313
|
districts: ['Atkaracalar', 'Bayramören', 'Çerkeş', 'Eldivan', 'Ilgaz', 'Kızılırmak', 'Korgun', 'Kurşunlu', 'Merkez',
|
278
314
|
'Orta', 'Şabanözü', 'Yapraklı']
|
279
315
|
land_distance: [156, 615, 916, 725, 763, 614, 804, 374, 684, 522, 681, 1370, 768, 561, 570, 495, 719, 1004, 106, 347,
|
@@ -289,6 +325,8 @@
|
|
289
325
|
region: 'Karadeniz'
|
290
326
|
has_sea_access: false
|
291
327
|
population: 526282
|
328
|
+
area: 12428
|
329
|
+
altitude: 822
|
292
330
|
districts: ['Alaca', 'Bayat', 'Boğazkale', 'Dodurga', 'İskilip', 'Kargı', 'Laçin', 'Mecitözü', 'Merkez', 'Oğuzlar',
|
293
331
|
'Ortaköy', 'Osmancık', 'Sungurlu', 'Uğurludağ']
|
294
332
|
land_distance: [723, 760, 844, 607, 458, 648, 482, 618, 366, 525, 1223, 715, 627, 574, 614, 827, 848, 197, 281, 825,
|
@@ -304,6 +342,8 @@
|
|
304
342
|
region: 'Ege'
|
305
343
|
has_sea_access: false
|
306
344
|
population: 1051056
|
345
|
+
area: 12134
|
346
|
+
altitude: 392
|
307
347
|
districts: ['Acıpayam', 'Babadağ', 'Baklan', 'Bekilli', 'Beyağaç', 'Bozkurt', 'Buldan', 'Çal', 'Çameli', 'Çardak',
|
308
348
|
'Çivril', 'Güney', 'Honaz', 'Kale', 'Merkezefendi', 'Pamukkale', 'Sarayköy', 'Serinhisar', 'Tavas']
|
309
349
|
land_distance: [1280, 690, 1139, 1147, 1337, 354, 967, 1089, 1233, 1653, 946, 165, 686, 639, 224, 1537, 721, 707,
|
@@ -319,6 +359,8 @@
|
|
319
359
|
region: 'Güneydoğu Anadolu'
|
320
360
|
has_sea_access: false
|
321
361
|
population: 1791373
|
362
|
+
area: 15168
|
363
|
+
altitude: 674
|
322
364
|
districts: ['Bağlar', 'Bismil', 'Çermik', 'Çınar', 'Çüngüş', 'Dicle', 'Eğil', 'Ergani', 'Hani', 'Hazro', 'Kayapınar',
|
323
365
|
'Kocaköy', 'Kulp', 'Lice', 'Silvan', 'Sur', 'Yenişehir']
|
324
366
|
land_distance: [1587, 153, 408, 318, 1121, 313, 683, 521, 475, 506, 1142, 594, 1357, 1426, 521, 950, 583, 1568, 717,
|
@@ -334,6 +376,8 @@
|
|
334
376
|
region: 'Marmara'
|
335
377
|
has_sea_access: true
|
336
378
|
population: 412115
|
379
|
+
area: 6145
|
380
|
+
altitude: 50
|
337
381
|
districts: ['Enez', 'Havsa', 'İpsala', 'Keşan', 'Lalapaşa', 'Meriç', 'Merkez', 'Süloğlu', 'Uzunköprü']
|
338
382
|
land_distance: [1436, 1267, 1457, 555, 1341, 1158, 1320, 2027, 1369, 800, 1171, 230, 535, 1657, 737, 1004, 62, 870,
|
339
383
|
341, 893, 584, 1338, 538, 1265, 1666, 757, 1649, 961, 1033, 1114, 1369, 378, 964, 1773, 909, 1121, 140, 1015, 1294,
|
@@ -348,6 +392,8 @@
|
|
348
392
|
region: 'Doğu Anadolu'
|
349
393
|
has_sea_access: false
|
350
394
|
population: 588088
|
395
|
+
area: 9383
|
396
|
+
altitude: 1041
|
351
397
|
districts: ['Ağın', 'Alacakaya', 'Arıcak', 'Baskil', 'Karakoçan', 'Keban', 'Kovancılar', 'Maden', 'Merkez', 'Palu',
|
352
398
|
'Sivrice']
|
353
399
|
land_distance: [267, 317, 970, 342, 562, 400, 628, 475, 995, 563, 1206, 1279, 520, 797, 432, 1417, 566, 1095, 736,
|
@@ -363,6 +409,8 @@
|
|
363
409
|
region: 'Doğu Anadolu'
|
364
410
|
has_sea_access: false
|
365
411
|
population: 237351
|
412
|
+
area: 11815
|
413
|
+
altitude: 1216
|
366
414
|
districts: ['Çayırlı', 'İliç', 'Kemah', 'Kemaliye', 'Merkez', 'Otlukbeli', 'Refahiye', 'Tercan', 'Üzümlü']
|
367
415
|
land_distance: [190, 925, 607, 295, 133, 765, 740, 1003, 739, 1037, 1270, 390, 620, 442, 1248, 572, 926, 744, 1003,
|
368
416
|
363, 1254, 575, 504, 1292, 382, 521, 568, 325, 308, 889, 446, 555, 591, 248, 1168, 305, 233, 131, 574, 1059, 598,
|
@@ -377,6 +425,8 @@
|
|
377
425
|
region: 'Doğu Anadolu'
|
378
426
|
has_sea_access: false
|
379
427
|
population: 756893
|
428
|
+
area: 25006
|
429
|
+
altitude: 1923
|
380
430
|
districts: ['Aşkale', 'Aziziye', 'Çat', 'Hınıs', 'Horasan', 'İspir', 'Karaçoban', 'Karayazı', 'Köprüköy', 'Narman',
|
381
431
|
'Oltu', 'Olur', 'Palandöken', 'Pasinler', 'Pazaryolu', 'Şenkaya', 'Tekman', 'Tortum', 'Uzundere', 'Yakutiye']
|
382
432
|
land_distance: [1115, 631, 365, 203, 608, 790, 1193, 878, 1227, 1460, 203, 810, 632, 1438, 762, 1116, 934, 1193, 413,
|
@@ -392,6 +442,8 @@
|
|
392
442
|
region: 'İç Anadolu'
|
393
443
|
has_sea_access: false
|
394
444
|
population: 898369
|
445
|
+
area: 13960
|
446
|
+
altitude: 796
|
395
447
|
districts: ['Alpu', 'Beylikova', 'Çifteler', 'Günyüzü', 'Han', 'İnönü', 'Mahmudiye', 'Mihalgazi', 'Mihalıççık',
|
396
448
|
'Odunpazarı', 'Sarıcakaya', 'Seyitgazi', 'Sivrihisar', 'Tepebaşı']
|
397
449
|
land_distance: [874, 848, 992, 1560, 881, 300, 680, 325, 410, 1315, 480, 537, 536, 403, 214, 338, 78, 871, 394, 798,
|
@@ -407,6 +459,8 @@
|
|
407
459
|
region: 'Güneydoğu Anadolu'
|
408
460
|
has_sea_access: false
|
409
461
|
population: 2130432
|
462
|
+
area: 6803
|
463
|
+
altitude: 838
|
410
464
|
districts: ['Araban', 'İslahiye', 'Karkamış', 'Nizip', 'Nurdağı', 'Oğuzeli', 'Şahinbey', 'Şehitkamil', 'Yavuzeli']
|
411
465
|
land_distance: [701, 740, 686, 193, 829, 281, 1111, 1113, 834, 790, 337, 1322, 471, 1000, 570, 887, 244, 1097, 76,
|
412
466
|
325, 1058, 565, 418, 419, 688, 890, 963, 701, 495, 842, 403, 1242, 472, 825, 476, 137, 902, 681, 534, 924, 479,
|
@@ -421,6 +475,8 @@
|
|
421
475
|
region: 'Karadeniz'
|
422
476
|
has_sea_access: true
|
423
477
|
population: 450154
|
478
|
+
area: 7025
|
479
|
+
altitude: 14
|
424
480
|
districts: ['Alucra', 'Bulancak', 'Çamoluk', 'Çanakçı', 'Dereli', 'Doğankent', 'Espiye', 'Eynesil', 'Görele', 'Güce',
|
425
481
|
'Keşap', 'Merkez', 'Piraziz', 'Şebinkarahisar', 'Tirebolu', 'Yağlıdere']
|
426
482
|
land_distance: [162, 970, 798, 993, 789, 928, 1193, 565, 484, 492, 1139, 577, 817, 785, 926, 541, 1177, 625, 779,
|
@@ -436,6 +492,8 @@
|
|
436
492
|
region: 'Karadeniz'
|
437
493
|
has_sea_access: false
|
438
494
|
population: 150119
|
495
|
+
area: 6668
|
496
|
+
altitude: 1174
|
439
497
|
districts: ['Kelkit', 'Köse', 'Kürtün', 'Merkez', 'Şiran', 'Torul']
|
440
498
|
land_distance: [808, 856, 1111, 847, 1090, 1337, 403, 646, 550, 1301, 680, 979, 852, 1070, 496, 1321, 683, 617, 1378,
|
441
499
|
466, 629, 676, 206, 175, 942, 356, 645, 511, 356, 1221, 372, 100, 264, 697, 1126, 611, 577, 860, 704, 78, 852, 676,
|
@@ -450,6 +508,8 @@
|
|
450
508
|
region: 'Doğu Anadolu'
|
451
509
|
has_sea_access: false
|
452
510
|
population: 278218
|
511
|
+
area: 7095
|
512
|
+
altitude: 1756
|
453
513
|
districts: ['Çukurca', 'Derecik', 'Merkez', 'Şemdinli', 'Yüksekova']
|
454
514
|
land_distance: [879, 1515, 967, 1797, 1799, 560, 1385, 1023, 2008, 1157, 1686, 1256, 1573, 724, 1783, 762, 386, 1744,
|
455
515
|
383, 1104, 1105, 1014, 864, 1649, 1164, 289, 1319, 951, 1928, 1059, 901, 634, 549, 1588, 197, 1175, 1599, 1165,
|
@@ -464,6 +524,8 @@
|
|
464
524
|
region: 'Akdeniz'
|
465
525
|
has_sea_access: true
|
466
526
|
population: 1670712
|
527
|
+
area: 5524
|
528
|
+
altitude: 89
|
467
529
|
districts: ['Altınözü', 'Antakya', 'Arsuz', 'Belen', 'Defne', 'Dörtyol', 'Erzin', 'Hassa', 'İskenderun', 'Kırıkhan',
|
468
530
|
'Kumlu', 'Payas', 'Reyhanlı', 'Samandağ', 'Yayladağı']
|
469
531
|
land_distance: [808, 260, 1139, 1092, 993, 874, 434, 1350, 568, 1028, 549, 866, 377, 1076, 173, 518, 1037, 724, 480,
|
@@ -479,6 +541,8 @@
|
|
479
541
|
region: 'Akdeniz'
|
480
542
|
has_sea_access: false
|
481
543
|
population: 445678
|
544
|
+
area: 8946
|
545
|
+
altitude: 1058
|
482
546
|
districts: ['Aksu', 'Atabey', 'Eğirdir', 'Gelendost', 'Gönen', 'Keçiborlu', 'Merkez', 'Senirkent', 'Sütçüler',
|
483
547
|
'Şarkikaraağaç', 'Uluborlu', 'Yalvaç', 'Yenişarbademli']
|
484
548
|
land_distance: [564, 594, 382, 1393, 667, 563, 805, 516, 483, 263, 240, 897, 366, 809, 1154, 292, 1244, 482, 501,
|
@@ -494,6 +558,8 @@
|
|
494
558
|
region: 'Akdeniz'
|
495
559
|
has_sea_access: true
|
496
560
|
population: 1891145
|
561
|
+
area: 16010
|
562
|
+
altitude: 18
|
497
563
|
districts: ['Akdeniz', 'Anamur', 'Aydıncık', 'Bozyazı', 'Çamlıyayla', 'Erdemli', 'Gülnar', 'Mezitli', 'Mut',
|
498
564
|
'Silifke', 'Tarsus', 'Toroslar', 'Yenişehir']
|
499
565
|
land_distance: [941, 891, 1081, 676, 328, 1152, 370, 830, 348, 665, 465, 875, 261, 606, 777, 812, 282, 200, 776, 988,
|
@@ -509,6 +575,8 @@
|
|
509
575
|
region: 'Marmara'
|
510
576
|
has_sea_access: true
|
511
577
|
population: 15840900
|
578
|
+
area: 5461
|
579
|
+
altitude: 25
|
512
580
|
districts: ['Adalar', 'Arnavutköy', 'Ataşehir', 'Avcılar', 'Bağcılar', 'Bahçelievler', 'Bakırköy', 'Başakşehir',
|
513
581
|
'Bayrampaşa', 'Beşiktaş', 'Beykoz', 'Beylikdüzü', 'Beyoğlu', 'Büyükçekmece', 'Çatalca', 'Çekmeköy', 'Esenler',
|
514
582
|
'Esenyurt', 'Eyüpsultan', 'Fatih', 'Gaziosmanpaşa', 'Güngören', 'Kadıköy', 'Kağıthane', 'Kartal', 'Küçükçekmece',
|
@@ -527,6 +595,8 @@
|
|
527
595
|
region: 'Ege'
|
528
596
|
has_sea_access: true
|
529
597
|
population: 4425789
|
598
|
+
area: 11891
|
599
|
+
altitude: 9
|
530
600
|
districts: ['Aliağa', 'Balçova', 'Bayındır', 'Bayraklı', 'Bergama', 'Beydağ', 'Bornova', 'Buca', 'Çeşme', 'Çiğli',
|
531
601
|
'Dikili', 'Foça', 'Gaziemir', 'Güzelbahçe', 'Karabağlar', 'Karaburun', 'Karşıyaka', 'Kemalpaşa', 'Kınık', 'Kiraz',
|
532
602
|
'Konak', 'Menderes', 'Menemen', 'Narlıdere', 'Ödemiş', 'Seferihisar', 'Selçuk', 'Tire', 'Torbalı', 'Urla']
|
@@ -543,6 +613,8 @@
|
|
543
613
|
region: 'Doğu Anadolu'
|
544
614
|
has_sea_access: false
|
545
615
|
population: 281077
|
616
|
+
area: 10193
|
617
|
+
altitude: 1756
|
546
618
|
districts: ['Akyaka', 'Arpaçay', 'Digor', 'Kağızman', 'Merkez', 'Sarıkamış', 'Selim', 'Susuz']
|
547
619
|
land_distance: [1010, 832, 1638, 962, 1316, 1134, 1393, 616, 1644, 840, 617, 1682, 349, 911, 958, 609, 360, 1279,
|
548
620
|
759, 528, 914, 638, 1558, 695, 435, 443, 697, 1449, 363, 862, 1224, 986, 325, 1134, 999, 567, 628, 1193, 94, 140,
|
@@ -557,6 +629,8 @@
|
|
557
629
|
region: 'Karadeniz'
|
558
630
|
has_sea_access: true
|
559
631
|
population: 375592
|
632
|
+
area: 13064
|
633
|
+
altitude: 814
|
560
634
|
districts: ['Abana', 'Ağlı', 'Araç', 'Azdavay', 'Bozkurt', 'Cide', 'Çatalzeytin', 'Daday', 'Devrekani', 'Doğanyurt',
|
561
635
|
'Hanönü', 'İhsangazi', 'İnebolu', 'Küre', 'Merkez', 'Pınarbaşı', 'Seydiler', 'Şenpazar', 'Taşköprü', 'Tosya']
|
562
636
|
land_distance: [453, 718, 319, 396, 459, 558, 717, 806, 714, 1046, 866, 1002, 410, 492, 440, 695, 359, 290, 1136,
|
@@ -572,6 +646,8 @@
|
|
572
646
|
region: 'İç Anadolu'
|
573
647
|
has_sea_access: false
|
574
648
|
population: 1434357
|
649
|
+
area: 16970
|
650
|
+
altitude: 1060
|
575
651
|
districts: ['Akkışla', 'Bünyan', 'Develi', 'Felahiye', 'Hacılar', 'İncesu', 'Kocasinan', 'Melikgazi', 'Özvatan',
|
576
652
|
'Pınarbaşı', 'Sarıoğlan', 'Sarız', 'Talas', 'Tomarza', 'Yahyalı', 'Yeşilhisar']
|
577
653
|
land_distance: [985, 134, 663, 304, 616, 334, 831, 261, 662, 852, 681, 81, 128, 479, 691, 626, 453, 769, 547, 194,
|
@@ -586,6 +662,8 @@
|
|
586
662
|
region: 'Marmara'
|
587
663
|
has_sea_access: true
|
588
664
|
population: 366363
|
665
|
+
area: 6459
|
666
|
+
altitude: 231
|
589
667
|
districts: ['Babaeski', 'Demirköy', 'Kofçaz', 'Lüleburgaz', 'Merkez', 'Pehlivanköy', 'Pınarhisar', 'Vize']
|
590
668
|
land_distance: [851, 322, 874, 565, 1319, 555, 1246, 1647, 774, 1630, 942, 1014, 1095, 1350, 359, 945, 1754, 890,
|
591
669
|
1102, 121, 996, 1275, 1379, 1459, 646, 1846, 882, 541, 892, 1337, 987, 742, 1668, 1819, 628, 1619, 1729, 387, 607,
|
@@ -600,6 +678,8 @@
|
|
600
678
|
region: 'İç Anadolu'
|
601
679
|
has_sea_access: false
|
602
680
|
population: 242944
|
681
|
+
area: 6584
|
682
|
+
altitude: 991
|
603
683
|
districts: ['Akçakent', 'Akpınar', 'Boztepe', 'Çiçekdağı', 'Kaman', 'Merkez', 'Mucur']
|
604
684
|
land_distance: [529, 258, 482, 468, 733, 395, 796, 790, 815, 91, 173, 533, 788, 492, 392, 903, 486, 324, 771, 317,
|
605
685
|
713, 700, 608, 538, 1031, 112, 453, 110, 702, 321, 113, 817, 968, 470, 987, 1053, 594, 402, 531, 464, 423]
|
@@ -613,6 +693,8 @@
|
|
613
693
|
region: 'Marmara'
|
614
694
|
has_sea_access: false
|
615
695
|
population: 2033441
|
696
|
+
area: 3397
|
697
|
+
altitude: 4
|
616
698
|
districts: ['Başiskele', 'Çayırova', 'Darıca', 'Derince', 'Dilovası', 'Gebze', 'Gölcük', 'İzmit', 'Kandıra',
|
617
699
|
'Karamürsel', 'Kartepe', 'Körfez']
|
618
700
|
land_distance: [552, 243, 997, 418, 924, 1325, 671, 1308, 620, 692, 773, 1028, 37, 623, 1432, 568, 780, 242, 674,
|
@@ -627,6 +709,8 @@
|
|
627
709
|
region: 'İç Anadolu'
|
628
710
|
has_sea_access: true
|
629
711
|
population: 2277017
|
712
|
+
area: 40838
|
713
|
+
altitude: 1023
|
630
714
|
districts: ['Ahırlı', 'Akören', 'Akşehir', 'Altınekin', 'Beyşehir', 'Bozkır', 'Cihanbeyli', 'Çeltik', 'Çumra',
|
631
715
|
'Derbent', 'Derebucak', 'Doğanhisar', 'Emirgazi', 'Ereğli', 'Güneysınır', 'Hadim', 'Halkapınar', 'Hüyük', 'Ilgın',
|
632
716
|
'Kadınhanı', 'Karapınar', 'Karatay', 'Kulu', 'Meram', 'Sarayönü', 'Selçuklu', 'Seydişehir', 'Taşkent', 'Tuzlukçu',
|
@@ -643,6 +727,8 @@
|
|
643
727
|
region: 'Ege'
|
644
728
|
has_sea_access: false
|
645
729
|
population: 578640
|
730
|
+
area: 11634
|
731
|
+
altitude: 958
|
646
732
|
districts: ['Altıntaş', 'Aslanapa', 'Çavdarhisar', 'Domaniç', 'Dumlupınar', 'Emet', 'Gediz', 'Hisarcık', 'Merkez',
|
647
733
|
'Pazarlar', 'Simav', 'Şaphane', 'Tavşanlı']
|
648
734
|
land_distance: [949, 316, 867, 1212, 430, 1296, 540, 559, 882, 1137, 206, 732, 1382, 730, 758, 485, 698, 1062, 1134,
|
@@ -657,6 +743,8 @@
|
|
657
743
|
region: 'Doğu Anadolu'
|
658
744
|
has_sea_access: false
|
659
745
|
population: 808692
|
746
|
+
area: 12259
|
747
|
+
altitude: 970
|
660
748
|
districts: ['Akçadağ', 'Arapgir', 'Arguvan', 'Battalgazi', 'Darende', 'Doğanşehir', 'Doğanyol', 'Hekimhan', 'Kale',
|
661
749
|
'Kuluncak', 'Pütürge', 'Yazıhan', 'Yeşilyurt']
|
662
750
|
land_distance: [1165, 224, 345, 1186, 347, 415, 462, 557, 671, 960, 580, 435, 721, 243, 1239, 351, 596, 232, 271,
|
@@ -671,6 +759,8 @@
|
|
671
759
|
region: 'Ege'
|
672
760
|
has_sea_access: false
|
673
761
|
population: 1456626
|
762
|
+
area: 13339
|
763
|
+
altitude: 79
|
674
764
|
districts: ['Ahmetli', 'Akhisar', 'Alaşehir', 'Demirci', 'Gölmarmara', 'Gördes', 'Kırkağaç', 'Köprübaşı', 'Kula',
|
675
765
|
'Salihli', 'Sarıgöl', 'Saruhanlı', 'Selendi', 'Soma', 'Şehzadeler', 'Turgutlu', 'Yunusemre']
|
676
766
|
land_distance: [1077, 1422, 253, 1512, 750, 769, 1133, 1388, 447, 983, 1592, 978, 1009, 509, 949, 1313, 1385, 1234,
|
@@ -685,6 +775,8 @@
|
|
685
775
|
region: 'Akdeniz'
|
686
776
|
has_sea_access: false
|
687
777
|
population: 1171298
|
778
|
+
area: 14520
|
779
|
+
altitude: 562
|
688
780
|
districts: ['Afşin', 'Andırın', 'Çağlayancerit', 'Dulkadiroğlu', 'Ekinözü', 'Elbistan', 'Göksun', 'Nurhak',
|
689
781
|
'Onikişubat', 'Pazarcık', 'Türkoğlu']
|
690
782
|
land_distance: [401, 1038, 571, 342, 389, 612, 824, 887, 625, 552, 766, 327, 1166, 396, 749, 456, 213, 882, 738, 458,
|
@@ -699,6 +791,8 @@
|
|
699
791
|
region: 'Güneydoğu Anadolu'
|
700
792
|
has_sea_access: false
|
701
793
|
population: 862757
|
794
|
+
area: 8780
|
795
|
+
altitude: 938
|
702
796
|
districts: ['Artuklu', 'Dargeçit', 'Derik', 'Kızıltepe', 'Mazıdağı', 'Midyat', 'Nusaybin', 'Ömerli', 'Savur',
|
703
797
|
'Yeşilli']
|
704
798
|
land_distance: [1383, 348, 743, 744, 823, 673, 1288, 909, 227, 1050, 572, 1567, 680, 710, 373, 188, 1227, 446, 796,
|
@@ -713,6 +807,8 @@
|
|
713
807
|
region: 'Ege'
|
714
808
|
has_sea_access: true
|
715
809
|
population: 1021141
|
810
|
+
area: 12654
|
811
|
+
altitude: 659
|
716
812
|
districts: ['Bodrum', 'Dalaman', 'Datça', 'Fethiye', 'Kavaklıdere', 'Köyceğiz', 'Marmaris', 'Menteşe', 'Milas',
|
717
813
|
'Ortaca', 'Seydikemer', 'Ula', 'Yatağan']
|
718
814
|
land_distance: [1533, 771, 790, 1190, 1445, 636, 1040, 1553, 1038, 1044, 728, 1006, 1370, 1418, 1195, 295, 1739, 842,
|
@@ -727,6 +823,8 @@
|
|
727
823
|
region: 'Doğu Anadolu'
|
728
824
|
has_sea_access: false
|
729
825
|
population: 405228
|
826
|
+
area: 8650
|
827
|
+
altitude: 1334
|
730
828
|
districts: ['Bulanık', 'Hasköy', 'Korkut', 'Malazgirt', 'Merkez', 'Varto']
|
731
829
|
land_distance: [762, 809, 672, 522, 1271, 822, 179, 973, 574, 1550, 682, 559, 251, 428, 1317, 216, 798, 1216, 837,
|
732
830
|
388, 985, 928, 218, 279, 1185, 411, 388, 1373, 1116, 625, 656, 1202]
|
@@ -740,6 +838,8 @@
|
|
740
838
|
region: 'İç Anadolu'
|
741
839
|
has_sea_access: false
|
742
840
|
population: 308003
|
841
|
+
area: 5485
|
842
|
+
altitude: 1197
|
743
843
|
districts: ['Acıgöl', 'Avanos', 'Derinkuyu', 'Gülşehir', 'Hacıbektaş', 'Kozaklı', 'Merkez', 'Ürgüp']
|
744
844
|
land_distance: [82, 553, 770, 583, 468, 850, 562, 273, 862, 337, 695, 647, 555, 555, 978, 203, 544, 75, 651, 258,
|
745
845
|
204, 764, 915, 561, 936, 1002, 685, 493, 478, 376, 514]
|
@@ -753,6 +853,8 @@
|
|
753
853
|
region: 'İç Anadolu'
|
754
854
|
has_sea_access: false
|
755
855
|
population: 363725
|
856
|
+
area: 7234
|
857
|
+
altitude: 1239
|
756
858
|
districts: ['Altunhisar', 'Bor', 'Çamardı', 'Çiftlik', 'Merkez', 'Ulukışla']
|
757
859
|
land_distance: [605, 817, 655, 546, 897, 640, 320, 934, 389, 742, 694, 556, 574, 1025, 285, 620, 122, 698, 176, 286, 811, 916, 637, 983, 1049, 757, 569, 453, 294, 590]
|
758
860
|
-
|
@@ -765,6 +867,8 @@
|
|
765
867
|
region: 'Karadeniz'
|
766
868
|
has_sea_access: true
|
767
869
|
population: 760872
|
870
|
+
area: 5861
|
871
|
+
altitude: 25
|
768
872
|
districts: ['Akkuş', 'Altınordu', 'Aybastı', 'Çamaş', 'Çatalpınar', 'Çaybaşı', 'Fatsa', 'Gölköy', 'Gülyalı',
|
769
873
|
'Gürgentepe', 'İkizce', 'Kabadüz', 'Kabataş', 'Korgan', 'Kumru', 'Mesudiye', 'Perşembe', 'Ulubey', 'Ünye']
|
770
874
|
land_distance: [255, 736, 150, 851, 305, 314, 1015, 216, 180, 456, 810, 938, 817, 421, 654, 628, 284, 781, 488, 780, 951, 623, 524, 700, 838, 554, 748, 717, 667]
|
@@ -778,6 +882,8 @@
|
|
778
882
|
region: 'Karadeniz'
|
779
883
|
has_sea_access: true
|
780
884
|
population: 345662
|
885
|
+
area: 3835
|
886
|
+
altitude: 11
|
781
887
|
districts: ['Ardeşen', 'Çamlıhemşin', 'Çayeli', 'Derepazarı', 'Fındıklı', 'Güneysu', 'Hemşin', 'İkizdere', 'İyidere',
|
782
888
|
'Kalkandere', 'Merkez', 'Pazar']
|
783
889
|
land_distance: [991, 405, 701, 560, 497, 1270, 471, 75, 439, 753, 1193, 667, 676, 909, 845, 253, 993, 743, 630, 801, 878, 269, 494, 1093, 809, 950, 929, 922]
|
@@ -791,6 +897,8 @@
|
|
791
897
|
region: 'Marmara'
|
792
898
|
has_sea_access: true
|
793
899
|
population: 1060876
|
900
|
+
area: 4824
|
901
|
+
altitude: 41
|
794
902
|
districts: ['Adapazarı', 'Akyazı', 'Arifiye', 'Erenler', 'Ferizli', 'Geyve', 'Hendek', 'Karapürçek', 'Karasu',
|
795
903
|
'Kaynarca', 'Kocaali', 'Pamukova', 'Sapanca', 'Serdivan', 'Söğütlü', 'Taraklı']
|
796
904
|
land_distance: [586, 1395, 531, 743, 279, 637, 916, 1020, 1100, 345, 1487, 523, 182, 533, 978, 628, 383, 1309, 1460, 269, 1260, 1370, 102, 248, 1023, 887, 69]
|
@@ -804,6 +912,8 @@
|
|
804
912
|
region: 'Karadeniz'
|
805
913
|
has_sea_access: true
|
806
914
|
population: 1371274
|
915
|
+
area: 9725
|
916
|
+
altitude: 10
|
807
917
|
districts: ['19 Mayıs', 'Alaçam', 'Asarcık', 'Atakum', 'Ayvacık', 'Bafra', 'Canik', 'Çarşamba', 'Havza', 'İlkadım', 'Kavak',
|
808
918
|
'Ladik', 'Salıpazarı', 'Tekkeköy', 'Terme', 'Vezirköprü', 'Yakakent']
|
809
919
|
land_distance: [999, 155, 337, 865, 229, 330, 577, 833, 788, 967, 280, 504, 502, 434, 702, 338, 913, 1099, 473, 674, 850, 688, 404, 761, 730, 517]
|
@@ -817,6 +927,8 @@
|
|
817
927
|
region: 'Güneydoğu Anadolu'
|
818
928
|
has_sea_access: false
|
819
929
|
population: 331980
|
930
|
+
area: 5717
|
931
|
+
altitude: 887
|
820
932
|
districts: ['Baykan', 'Eruh', 'Kurtalan', 'Merkez', 'Pervari', 'Şirvan', 'Tillo']
|
821
933
|
land_distance: [1140, 662, 1674, 770, 738, 424, 358, 1397, 257, 886, 1350, 925, 567, 999, 1016, 86, 100, 1319, 590, 433, 1497, 1250, 555, 620, 1326]
|
822
934
|
-
|
@@ -829,6 +941,8 @@
|
|
829
941
|
region: 'Karadeniz'
|
830
942
|
has_sea_access: true
|
831
943
|
population: 218408
|
944
|
+
area: 5717
|
945
|
+
altitude: 27
|
832
946
|
districts: ['Ayancık', 'Boyabat', 'Dikmen', 'Durağan', 'Erfelek', 'Gerze', 'Merkez', 'Saraydüzü', 'Türkeli']
|
833
947
|
land_distance: [478, 810, 372, 485, 722, 974, 786, 1122, 374, 397, 588, 589, 742, 382, 1054, 1240, 366, 829, 1005, 633, 297, 902, 871, 462]
|
834
948
|
-
|
@@ -841,6 +955,8 @@
|
|
841
955
|
region: 'İç Anadolu'
|
842
956
|
has_sea_access: false
|
843
957
|
population: 636121
|
958
|
+
area: 28164
|
959
|
+
altitude: 1313
|
844
960
|
districts: ['Akıncılar', 'Altınyayla', 'Divriği', 'Doğanşar', 'Gemerek', 'Gölova', 'Gürün', 'Hafik', 'İmranlı',
|
845
961
|
'Kangal', 'Koyulhisar', 'Merkez', 'Suşehri', 'Şarkışla', 'Ulaş', 'Yıldızeli', 'Zara']
|
846
962
|
land_distance: [1022, 108, 422, 379, 496, 814, 790, 224, 688, 348, 378, 496, 364, 576, 762, 657, 663, 729, 845, 588, 463, 432, 674]
|
@@ -854,6 +970,8 @@
|
|
854
970
|
region: 'Marmara'
|
855
971
|
has_sea_access: true
|
856
972
|
population: 1113400
|
973
|
+
area: 6190
|
974
|
+
altitude: 28
|
857
975
|
districts: ['Çerkezköy', 'Çorlu', 'Ergene', 'Hayrabolu', 'Kapaklı', 'Malkara', 'Marmaraereğlisi', 'Muratlı', 'Saray',
|
858
976
|
'Süleymanpaşa', 'Şarköy']
|
859
977
|
land_distance: [916, 1195, 1299, 1379, 600, 1766, 802, 461, 812, 1257, 907, 662, 1588, 1739, 548, 1539, 1649, 307, 527, 1302, 1166, 348]
|
@@ -867,6 +985,8 @@
|
|
867
985
|
region: 'Karadeniz'
|
868
986
|
has_sea_access: false
|
869
987
|
population: 602567
|
988
|
+
area: 10042
|
989
|
+
altitude: 630
|
870
990
|
districts: ['Almus', 'Artova', 'Başçiftlik', 'Erbaa', 'Merkez', 'Niksar', 'Pazar', 'Reşadiye', 'Sulusaray', 'Turhal',
|
871
991
|
'Yeşilyurt', 'Zile']
|
872
992
|
land_distance: [396, 436, 604, 754, 898, 205, 582, 412, 394, 565, 304, 684, 870, 551, 720, 786, 739, 482, 532, 501, 568]
|
@@ -880,6 +1000,8 @@
|
|
880
1000
|
region: 'Karadeniz'
|
881
1001
|
has_sea_access: true
|
882
1002
|
population: 816684
|
1003
|
+
area: 4628
|
1004
|
+
altitude: 36
|
883
1005
|
districts: ['Akçaabat', 'Araklı', 'Arsin', 'Beşikdüzü', 'Çarşıbaşı', 'Çaykara', 'Dernekpazarı', 'Düzköy', 'Hayrat',
|
884
1006
|
'Köprübaşı', 'Maçka', 'Of', 'Ortahisar', 'Sürmene', 'Şalpazarı', 'Tonya', 'Vakfıkebir', 'Yomra']
|
885
1007
|
land_distance: [364, 790, 1118, 704, 601, 834, 770, 178, 918, 668, 667, 838, 803, 344, 569, 1018, 734, 885, 854, 847]
|
@@ -893,6 +1015,8 @@
|
|
893
1015
|
region: 'Doğu Anadolu'
|
894
1016
|
has_sea_access: false
|
895
1017
|
population: 83645
|
1018
|
+
area: 7582
|
1019
|
+
altitude: 922
|
896
1020
|
districts: ['Çemişgezek', 'Hozat', 'Mazgirt', 'Merkez', 'Nazımiye', 'Ovacık', 'Pertek', 'Pülümür']
|
897
1021
|
land_distance: [443, 1190, 467, 603, 965, 722, 260, 870, 740, 338, 524, 934, 468, 534, 1122, 865, 536, 541, 951]
|
898
1022
|
-
|
@@ -905,6 +1029,8 @@
|
|
905
1029
|
region: 'Güneydoğu Anadolu'
|
906
1030
|
has_sea_access: false
|
907
1031
|
population: 2143020
|
1032
|
+
area: 19242
|
1033
|
+
altitude: 527
|
908
1034
|
districts: ['Akçakale', 'Birecik', 'Bozova', 'Ceylanpınar', 'Eyyübiye', 'Halfeti', 'Haliliye', 'Harran', 'Hilvan',
|
909
1035
|
'Karaköprü', 'Siverek', 'Suruç', 'Viranşehir']
|
910
1036
|
land_distance: [1039, 544, 671, 1061, 616, 619, 641, 721, 272, 360, 1078, 727, 720, 1202, 1010, 197, 262, 1031]
|
@@ -918,6 +1044,8 @@
|
|
918
1044
|
region: 'Ege'
|
919
1045
|
has_sea_access: false
|
920
1046
|
population: 373183
|
1047
|
+
area: 5555
|
1048
|
+
altitude: 915
|
921
1049
|
districts: ['Banaz', 'Eşme', 'Karahallı', 'Merkez', 'Sivaslı', 'Ulubey']
|
922
1050
|
land_distance: [1533, 590, 527, 480, 1148, 451, 450, 1311, 1399, 614, 1462, 1540, 375, 558, 936, 777, 414]
|
923
1051
|
-
|
@@ -930,6 +1058,8 @@
|
|
930
1058
|
region: 'Doğu Anadolu'
|
931
1059
|
has_sea_access: false
|
932
1060
|
population: 1141015
|
1061
|
+
area: 20921
|
1062
|
+
altitude: 1728
|
933
1063
|
districts: ['Bahçesaray', 'Başkale', 'Çaldıran', 'Çatak', 'Edremit', 'Erciş', 'Gevaş', 'Gürpınar', 'İpekyolu',
|
934
1064
|
'Muradiye', 'Özalp', 'Saray', 'Tuşba']
|
935
1065
|
land_distance: [1014, 1432, 1053, 533, 1185, 1144, 296, 357, 1401, 451, 223, 1589, 1332, 741, 806, 1418]
|
@@ -943,6 +1073,8 @@
|
|
943
1073
|
region: 'İç Anadolu'
|
944
1074
|
has_sea_access: false
|
945
1075
|
population: 418500
|
1076
|
+
area: 13690
|
1077
|
+
altitude: 1317
|
946
1078
|
districts: ['Akdağmadeni', 'Aydıncık', 'Boğazlıyan', 'Çandır', 'Çayıralan', 'Çekerek', 'Kadışehri', 'Merkez',
|
947
1079
|
'Saraykent', 'Sarıkaya', 'Sorgun', 'Şefaatli', 'Yenifakılı', 'Yerköy']
|
948
1080
|
land_distance: [484, 222, 599, 433, 140, 800, 986, 484, 887, 953, 625, 415, 594, 563, 454]
|
@@ -956,6 +1088,8 @@
|
|
956
1088
|
region: 'Karadeniz'
|
957
1089
|
has_sea_access: true
|
958
1090
|
population: 589684
|
1091
|
+
area: 3342
|
1092
|
+
altitude: 10
|
959
1093
|
districts: ['Alaplı', 'Çaycuma', 'Devrek', 'Ereğli', 'Gökçebey', 'Kilimli', 'Kozlu', 'Merkez']
|
960
1094
|
land_distance: [498, 923, 642, 344, 1264, 1421, 87, 1178, 1315, 284, 100, 984, 852, 113]
|
961
1095
|
-
|
@@ -968,6 +1102,8 @@
|
|
968
1102
|
region: 'İç Anadolu'
|
969
1103
|
has_sea_access: false
|
970
1104
|
population: 429069
|
1105
|
+
area: 7659
|
1106
|
+
altitude: 1228
|
971
1107
|
districts: ['Ağaçören', 'Eskil', 'Gülağaç', 'Güzelyurt', 'Merkez', 'Ortaköy', 'Sarıyahşi', 'Sultanhanı']
|
972
1108
|
land_distance: [726, 211, 210, 839, 976, 515, 1011, 1077, 635, 447, 513, 354, 468]
|
973
1109
|
-
|
@@ -980,6 +1116,8 @@
|
|
980
1116
|
region: 'Karadeniz'
|
981
1117
|
has_sea_access: false
|
982
1118
|
population: 85042
|
1119
|
+
area: 3746
|
1120
|
+
altitude: 1555
|
983
1121
|
districts: ['Aydıntepe', 'Demirözü', 'Merkez']
|
984
1122
|
land_distance: [874, 698, 496, 667, 892, 350, 416, 1080, 823, 796, 801, 909]
|
985
1123
|
-
|
@@ -992,6 +1130,8 @@
|
|
992
1130
|
region: 'İç Anadolu'
|
993
1131
|
has_sea_access: false
|
994
1132
|
population: 258838
|
1133
|
+
area: 8678
|
1134
|
+
altitude: 1063
|
995
1135
|
districts: ['Ayrancı', 'Başyayla', 'Ermenek', 'Kazımkarabekir', 'Merkez', 'Sarıveliler']
|
996
1136
|
land_distance: [364, 913, 1001, 659, 1159, 1225, 660, 591, 538, 379, 612]
|
997
1137
|
-
|
@@ -1004,6 +1144,8 @@
|
|
1004
1144
|
region: 'İç Anadolu'
|
1005
1145
|
has_sea_access: false
|
1006
1146
|
population: 275968
|
1147
|
+
area: 4791
|
1148
|
+
altitude: 746
|
1007
1149
|
districts: ['Bahşılı', 'Balışeyh', 'Çelebi', 'Delice', 'Karakeçili', 'Keskin', 'Merkez', 'Sulakyurt', 'Yahşihan']
|
1008
1150
|
land_distance: [930, 1081, 361, 1012, 1090, 485, 293, 644, 564, 314]
|
1009
1151
|
-
|
@@ -1016,6 +1158,8 @@
|
|
1016
1158
|
region: 'Güneydoğu Anadolu'
|
1017
1159
|
has_sea_access: false
|
1018
1160
|
population: 626319
|
1161
|
+
area: 4477
|
1162
|
+
altitude: 570
|
1019
1163
|
districts: ['Beşiri', 'Gercüş', 'Hasankeyf', 'Kozluk', 'Merkez', 'Sason']
|
1020
1164
|
land_distance: [186, 1233, 604, 472, 1411, 1164, 469, 534, 1240]
|
1021
1165
|
-
|
@@ -1028,6 +1172,8 @@
|
|
1028
1172
|
region: 'Güneydoğu Anadolu'
|
1029
1173
|
has_sea_access: false
|
1030
1174
|
population: 546589
|
1175
|
+
area: 7078
|
1176
|
+
altitude: 1343
|
1031
1177
|
districts: ['Beytüşşebap', 'Cizre', 'Güçlükonak', 'İdil', 'Merkez', 'Silopi', 'Uludere']
|
1032
1178
|
land_distance: [1419, 690, 533, 1562, 1350, 557, 622, 1391]
|
1033
1179
|
-
|
@@ -1040,6 +1186,8 @@
|
|
1040
1186
|
region: 'Karadeniz'
|
1041
1187
|
has_sea_access: true
|
1042
1188
|
population: 201711
|
1189
|
+
area: 2330
|
1190
|
+
altitude: 12
|
1043
1191
|
districts: ['Amasra', 'Kurucaşile', 'Merkez', 'Ulus']
|
1044
1192
|
land_distance: [1147, 1284, 371, 89, 1001, 869, 200]
|
1045
1193
|
-
|
@@ -1052,6 +1200,8 @@
|
|
1052
1200
|
region: 'Doğu Anadolu'
|
1053
1201
|
has_sea_access: false
|
1054
1202
|
population: 94932
|
1203
|
+
area: 4934
|
1204
|
+
altitude: 1799
|
1055
1205
|
districts: ['Çıldır', 'Damal', 'Göle', 'Hanak', 'Merkez', 'Posof']
|
1056
1206
|
land_distance: [228, 1362, 1078, 924, 955, 1191]
|
1057
1207
|
-
|
@@ -1064,6 +1214,8 @@
|
|
1064
1214
|
region: 'Doğu Anadolu'
|
1065
1215
|
has_sea_access: false
|
1066
1216
|
population: 203159
|
1217
|
+
area: 3664
|
1218
|
+
altitude: 860
|
1067
1219
|
districts: ['Aralık', 'Karakoyunlu', 'Merkez', 'Tuzluca']
|
1068
1220
|
land_distance: [1472, 1215, 917, 982, 1301]
|
1069
1221
|
-
|
@@ -1076,6 +1228,8 @@
|
|
1076
1228
|
region: 'Marmara'
|
1077
1229
|
has_sea_access: true
|
1078
1230
|
population: 291001
|
1231
|
+
area: 798
|
1232
|
+
altitude: 8
|
1079
1233
|
districts: ['Altınova', 'Armutlu', 'Çınarcık', 'Çiftlikköy', 'Merkez', 'Termal']
|
1080
1234
|
land_distance: [350, 1125, 986, 171]
|
1081
1235
|
-
|
@@ -1088,6 +1242,8 @@
|
|
1088
1242
|
region: 'Karadeniz'
|
1089
1243
|
has_sea_access: false
|
1090
1244
|
population: 249287
|
1245
|
+
area: 4142
|
1246
|
+
altitude: 264
|
1091
1247
|
districts: ['Eflani', 'Eskipazar', 'Merkez', 'Ovacık', 'Safranbolu', 'Yenice']
|
1092
1248
|
land_distance: [933, 801, 179]
|
1093
1249
|
-
|
@@ -1100,6 +1256,8 @@
|
|
1100
1256
|
region: 'Güneydoğu Anadolu'
|
1101
1257
|
has_sea_access: false
|
1102
1258
|
population: 145826
|
1259
|
+
area: 1412
|
1260
|
+
altitude: 660
|
1103
1261
|
districts: ['Elbeyli', 'Merkez', 'Musabeyli', 'Polateli']
|
1104
1262
|
land_distance: [159, 954]
|
1105
1263
|
-
|
@@ -1112,6 +1270,8 @@
|
|
1112
1270
|
region: 'Akdeniz'
|
1113
1271
|
has_sea_access: false
|
1114
1272
|
population: 553012
|
1273
|
+
area: 3320
|
1274
|
+
altitude: 121
|
1115
1275
|
districts: ['Bahçe', 'Düziçi', 'Hasanbeyli', 'Kadirli', 'Merkez', 'Sumbas', 'Toprakkale']
|
1116
1276
|
land_distance: [822]
|
1117
1277
|
-
|
@@ -1124,5 +1284,7 @@
|
|
1124
1284
|
region: 'Karadeniz'
|
1125
1285
|
has_sea_access: true
|
1126
1286
|
population: 400976
|
1287
|
+
area: 2492
|
1288
|
+
altitude: 149
|
1127
1289
|
districts: ['Akçakoca', 'Cumayeri', 'Çilimli', 'Gölyaka', 'Gümüşova', 'Kaynaşlı', 'Merkez', 'Yığılca']
|
1128
1290
|
land_distance: []
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Elevation
|
4
|
+
include DecomposerHelper
|
5
|
+
|
6
|
+
file_path = File.join(File.dirname(__FILE__), 'data/cities.yaml')
|
7
|
+
CITY_LIST = YAML.load_file(file_path)
|
8
|
+
|
9
|
+
MIN_ELEVATION = 3
|
10
|
+
MAX_ELEVATION = 1924
|
11
|
+
|
12
|
+
def find_by_elevation(type, elevation_one, elevation_two = nil)
|
13
|
+
city_list = CITY_LIST
|
14
|
+
|
15
|
+
case type
|
16
|
+
when 'below'
|
17
|
+
check_input_range(elevation_one, self.class::MIN_ELEVATION, Float::INFINITY)
|
18
|
+
below_elevation(city_list, elevation_one)
|
19
|
+
when 'above'
|
20
|
+
check_input_range(elevation_one, 0, self.class::MAX_ELEVATION)
|
21
|
+
above_elevation(city_list, elevation_one)
|
22
|
+
when 'between'
|
23
|
+
between_elevation(city_list, elevation_one.to_i, elevation_two.to_i)
|
24
|
+
else
|
25
|
+
unsupported_elevation_type(type)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def below_elevation(city_list, elevation)
|
32
|
+
city_list.map { |city| city['name'] if city['altitude'] < elevation }.compact
|
33
|
+
end
|
34
|
+
|
35
|
+
def above_elevation(city_list, elevation)
|
36
|
+
city_list.map { |city| city['name'] if city['altitude'] > elevation }.compact
|
37
|
+
end
|
38
|
+
|
39
|
+
def between_elevation(city_list, elevation_one, elevation_two)
|
40
|
+
find_by_between('altitude', city_list, elevation_one, elevation_two)
|
41
|
+
end
|
42
|
+
end
|
@@ -7,10 +7,6 @@ module DecomposerHelper
|
|
7
7
|
raise RangeError, I18n.t('errors.outside_bounds', input: input, min: min, max: max)
|
8
8
|
end
|
9
9
|
|
10
|
-
def check_population_range(input, min, max)
|
11
|
-
input.to_i.between?(min, max)
|
12
|
-
end
|
13
|
-
|
14
10
|
def city_not_found_error(input)
|
15
11
|
I18n.t('errors.city_not_found_error', input: input)
|
16
12
|
end
|
@@ -46,6 +42,14 @@ module DecomposerHelper
|
|
46
42
|
I18n.t('errors.district_not_found_error', district_input: district_input, city_input: city_input)
|
47
43
|
end
|
48
44
|
|
45
|
+
def find_by_between(search_type, city_list, input_one, input_two)
|
46
|
+
sorted_inputs = sort_input_numbers(input_one, input_two)
|
47
|
+
|
48
|
+
city_list.map do |city|
|
49
|
+
city['name'] if city[search_type] > sorted_inputs[0] && city[search_type] < sorted_inputs[1]
|
50
|
+
end.compact
|
51
|
+
end
|
52
|
+
|
49
53
|
def postcode_not_found_error(postcode_input)
|
50
54
|
I18n.t('errors.postcode_not_found_error', postcode_input: postcode_input)
|
51
55
|
end
|
@@ -83,6 +87,14 @@ module DecomposerHelper
|
|
83
87
|
end
|
84
88
|
end
|
85
89
|
|
90
|
+
def sort_input_numbers(input_one, input_two)
|
91
|
+
if input_one > input_two
|
92
|
+
[input_two, input_one]
|
93
|
+
else
|
94
|
+
[input_one, input_two]
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
86
98
|
def subdistrict_not_found_error(subdistrict_input, district_input, city_input)
|
87
99
|
I18n.t('errors.subdistrict_not_found_error', subdistrict_input: subdistrict_input, district_input: district_input,
|
88
100
|
city_input: city_input)
|
@@ -108,6 +120,10 @@ module DecomposerHelper
|
|
108
120
|
result[:metropolitan_municipality_since] = city['metropolitan_municipality_since']
|
109
121
|
end
|
110
122
|
|
123
|
+
def unsupported_elevation_type(input)
|
124
|
+
raise ArgumentError, I18n.t('errors.unsupported_elevation_type', input: input)
|
125
|
+
end
|
126
|
+
|
111
127
|
def unsupported_population_type(input)
|
112
128
|
I18n.t('errors.unsupported_population_type', input: input)
|
113
129
|
end
|
@@ -11,11 +11,10 @@ class Population
|
|
11
11
|
file_path = File.join(File.dirname(__FILE__), 'data/cities.yaml')
|
12
12
|
CITY_LIST = YAML.load_file(file_path)
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
return [] if !population_two.nil? && !check_population_range(population_two, 83_645, 15_840_900)
|
14
|
+
MIN_POPULATION = 83_644
|
15
|
+
MAX_POPULATION = 15_840_901
|
18
16
|
|
17
|
+
def find_by_population(type, population_one, population_two = nil)
|
19
18
|
result = find_population(type, population_one, population_two)
|
20
19
|
|
21
20
|
result.length.positive? ? result : city_population_not_found_error
|
@@ -28,13 +27,16 @@ class Population
|
|
28
27
|
|
29
28
|
case type
|
30
29
|
when 'exact'
|
30
|
+
check_input_range(population_one, self.class::MIN_POPULATION, self.class::MAX_POPULATION)
|
31
31
|
exact_population(city_list, population_one)
|
32
32
|
when 'below'
|
33
|
+
check_input_range(population_one, self.class::MIN_POPULATION, Float::INFINITY)
|
33
34
|
below_population(city_list, population_one)
|
34
35
|
when 'above'
|
36
|
+
check_input_range(population_one, 0, self.class::MAX_POPULATION)
|
35
37
|
above_population(city_list, population_one)
|
36
38
|
when 'between'
|
37
|
-
between_population(city_list, population_one, population_two)
|
39
|
+
between_population(city_list, population_one.to_i, population_two.to_i)
|
38
40
|
else
|
39
41
|
unsupported_population_type(type)
|
40
42
|
end
|
@@ -53,14 +55,6 @@ class Population
|
|
53
55
|
end
|
54
56
|
|
55
57
|
def between_population(city_list, population_one, population_two)
|
56
|
-
|
57
|
-
bigger = population_one
|
58
|
-
smaller = population_two
|
59
|
-
else
|
60
|
-
smaller = population_one
|
61
|
-
bigger = population_two
|
62
|
-
end
|
63
|
-
|
64
|
-
city_list.map { |city| city['name'] if city['population'] > smaller && city['population'] < bigger }.compact
|
58
|
+
find_by_between('population', city_list, population_one, population_two)
|
65
59
|
end
|
66
60
|
end
|
data/lib/turkish_cities.rb
CHANGED
@@ -3,14 +3,15 @@
|
|
3
3
|
require_relative '../lib/turkish_cities/city'
|
4
4
|
require_relative '../lib/turkish_cities/distance'
|
5
5
|
require_relative '../lib/turkish_cities/district'
|
6
|
+
require_relative '../lib/turkish_cities/elevation'
|
6
7
|
require_relative '../lib/turkish_cities/population'
|
7
8
|
require_relative '../lib/turkish_cities/postcode'
|
8
9
|
require_relative '../lib/turkish_cities/version'
|
9
10
|
|
10
11
|
require 'i18n'
|
11
12
|
|
12
|
-
I18n.load_path << "#{File.
|
13
|
-
I18n.load_path << "#{File.
|
13
|
+
I18n.load_path << "#{File.dirname(__FILE__)}/config/locales/en.yml"
|
14
|
+
I18n.load_path << "#{File.dirname(__FILE__)}/config/locales/tr.yml"
|
14
15
|
|
15
16
|
class TurkishCities
|
16
17
|
PLATE_NUMBER = 'plate_number'
|
@@ -60,6 +61,10 @@ class TurkishCities
|
|
60
61
|
District.new(city_name, district_name).neighborhoods(subdistrict_name)
|
61
62
|
end
|
62
63
|
|
64
|
+
def self.find_by_elevation(type, elevation_one, elevation_two = nil)
|
65
|
+
Elevation.new.find_by_elevation(type, elevation_one, elevation_two)
|
66
|
+
end
|
67
|
+
|
63
68
|
def self.find_by_population(type, population_one, population_two = nil)
|
64
69
|
Population.new.find_by_population(type, population_one, population_two)
|
65
70
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: turkish_cities
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Semih Arslanoglu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -127,8 +127,8 @@ files:
|
|
127
127
|
- LICENSE.txt
|
128
128
|
- README.md
|
129
129
|
- Rakefile
|
130
|
-
- config/locales/en.yml
|
131
|
-
- config/locales/tr.yml
|
130
|
+
- lib/config/locales/en.yml
|
131
|
+
- lib/config/locales/tr.yml
|
132
132
|
- lib/turkish_cities.rb
|
133
133
|
- lib/turkish_cities/city.rb
|
134
134
|
- lib/turkish_cities/data/cities.yaml
|
@@ -216,6 +216,7 @@ files:
|
|
216
216
|
- lib/turkish_cities/data/neighborhoods_parser.rb
|
217
217
|
- lib/turkish_cities/distance.rb
|
218
218
|
- lib/turkish_cities/district.rb
|
219
|
+
- lib/turkish_cities/elevation.rb
|
219
220
|
- lib/turkish_cities/helpers/decomposer_helper.rb
|
220
221
|
- lib/turkish_cities/population.rb
|
221
222
|
- lib/turkish_cities/postcode.rb
|
@@ -249,7 +250,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
249
250
|
- !ruby/object:Gem::Version
|
250
251
|
version: '0'
|
251
252
|
requirements: []
|
252
|
-
rubygems_version: 3.
|
253
|
+
rubygems_version: 3.3.7
|
253
254
|
signing_key:
|
254
255
|
specification_version: 4
|
255
256
|
summary: List and find Turkish cities
|