├── .gitattributes ├── .github └── FUNDING.yml ├── .gitignore ├── LICENSE ├── README.md ├── biome.jsonc ├── index.js ├── package.json └── src ├── constants ├── errors.js └── index.js ├── controller ├── data │ └── index.js ├── index.js └── kandilli │ └── index.js ├── db ├── MongoDB.js ├── index.js ├── locations │ ├── airports.js │ ├── geojsons │ │ ├── adriyatik-denizi.js │ │ ├── arnavutluk.js │ │ ├── azerbaycan.js │ │ ├── bosna-hersek.js │ │ ├── bulgaristan.js │ │ ├── ermenistan.js │ │ ├── filistin.js │ │ ├── gurcistan.js │ │ ├── hirvatistan.js │ │ ├── index.js │ │ ├── irak.js │ │ ├── iran.js │ │ ├── israil.js │ │ ├── kibris.js │ │ ├── libya.js │ │ ├── lubnan.js │ │ ├── makedonya.js │ │ ├── misir.js │ │ ├── mixed-locations.js │ │ ├── montenegro.js │ │ ├── rusya.js │ │ ├── sirbistan.js │ │ ├── suriye.js │ │ ├── urdun.js │ │ └── yunanistan.js │ └── index.js ├── nopeRedis.js └── populations.js ├── helpers ├── crawler │ ├── helpers.js │ ├── index.js │ └── kandilli.js ├── date │ ├── index.js │ └── moment.js ├── earthquakes.js └── index.js ├── middlewares ├── cron.js ├── index.js ├── stats.js └── swagger.js ├── repositories ├── data │ ├── index.js │ └── stats.js ├── index.js ├── kandilli │ └── index.js └── rate │ └── index.js ├── routes ├── data │ └── index.js ├── index.js ├── int │ └── index.js ├── kandilli │ └── index.js └── statics │ └── index.js └── services ├── data ├── get.js ├── index.js ├── search.js └── statsGeneral.js ├── index.js ├── int ├── earthquakes.js └── index.js ├── kandilli ├── archive.js ├── index.js └── live.js └── statics ├── cities.js └── index.js /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [orhanayd] -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | env.php 2 | node_modules 3 | old 4 | .env 5 | tools/tester.js 6 | yarn.lock 7 | package-lock.json 8 | yarn.lock 9 | .DS_Store 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Orhan AYDOĞDU 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ### Kandilli Rasathanesi API 3 | 4 | Bu API, Kandilli Rasathanesi tarafından yayınlanan son depremler listesini halka açık ve ücretsiz olarak sunar. Deprem verileri her dakika güncellenmektedir. API üzerinden hem geçmiş depremlere ait arşiv verilerine ulaşabilir, hem de son depremleri canlı olarak takip edebilirsiniz. 5 | 6 | Gereksiz isteklerin önüne geçmek amacıyla rate limiting uygulanmaktadır. Lütfen kullanım sırasında bu sınırlamalara dikkat ediniz. 7 | 8 | ##### Ticari kullanım hakkında uyarı: 9 | Söz konusu bilgi, veri ve haritalar Boğaziçi Üniversitesi Rektörlüğü’nün yazılı izni ve onayı olmadan herhangi bir şekilde ticari amaçlı kullanılamaz. 10 | 11 | Sorularınız için lütfen info@orhanaydogdu.com.tr adresinden iletişime geçiniz. 12 | 13 | ##### Servis hakkında duyuruları takip etmen için Whatsapp Topluluk Grubu: 14 | 15 | ```bash 16 | https://chat.whatsapp.com/KOkShApC4lc9HlMtFFN3kQ 17 | ``` 18 | 19 | 20 | 21 | #### API DOC: 22 | ```bash 23 | https://api.orhanaydogdu.com.tr/deprem/api-docs/ 24 | ``` 25 | 26 | #### API durumu: 27 | ```bash 28 | https://api.orhanaydogdu.com.tr/deprem/status 29 | ``` 30 | 31 | 32 | 33 | ### Özellikleri: 34 | 35 | - **GeoJson** ile haritaya kolay aktırabilir, 36 | 37 | - Depremin **nerede** olduğunu, 38 | 39 | - Deprem noktasına **en yakın il sınırı bilgisi**, 40 | 41 | - Deprem noktasına yakın **Havalimanları** ve **Uzaklıkları** 42 | 43 | - Depremin zaman bilgileri ve depreme özel ID. 44 | 45 | - **Tarih bazlı** deprem listesi 46 | 47 | 48 | 49 | ##### https://api.orhanaydogdu.com.tr/deprem/kandilli/live 50 | 51 | ##### https://api.orhanaydogdu.com.tr/deprem/kandilli/archive 52 | 53 | ##### https://api.orhanaydogdu.com.tr/deprem/data/search 54 | 55 | ##### https://api.orhanaydogdu.com.tr/deprem/statics/cities 56 | 57 | Endpoint kullanım detayları için Dökümanı ziyaret etmeyi unutmayın :) 58 | 59 | 60 | 61 | ##### https://api.orhanaydogdu.com.tr/deprem/kandilli/live 62 | 63 | ##### Örnek cevap: 64 | 65 | 66 | 67 | ```json 68 | { 69 | "earthquake_id": "EoIrMsfMSC19f", -> benzersiz deprem id 70 | "provider": "kandilli", -> deprem bilgi sağlayıcı 71 | "title": "CALIS-ELBISTAN (KAHRAMANMARAS)", -> sağlayıcı tarafından belirlenen başlık 72 | "date": "2023.03.08 02:54:44", -> deprem zaman bilgisi 73 | "mag": 2, -> deprem büyüklüğü 74 | "depth": 5, -> deprem derinliği 75 | "geojson": { -> depremin konum noktası 76 | "type": "Point", 77 | "coordinates": [37.0132, 38.1355] (long, lat) 78 | }, 79 | "location_properties": { -> deprem konum noktası detayları 80 | "closestCity": { -> depreme en yakın sınırı bulunan şehir 81 | "name": "Malatya", -> şehir adı 82 | "cityCode": 44, -> şehir plaka kodu 83 | "distance": 107595.23337847003, -> deprem noktasına uzaklığı km 84 | "population": 812580 -> ilgili şehrin nüfusu 85 | }, 86 | "epiCenter": { -> depremin yaşandığı bölge 87 | "name": "Kahramanmaraş", -> depremin yaşandığı şehir / null gelebilir 88 | "cityCode": 46, -> şehirin plaka kodu 89 | "population": 1177436 -> şehirin nufüsü 90 | }, 91 | "closestCities": [{ -> deprem noktasına yakın diğer şehirler 92 | "name": "Malatya", 93 | "cityCode": 44, 94 | "distance": 107595.23337847003, 95 | "population": 812580 96 | }, { 97 | "name": "Kayseri", 98 | "cityCode": 38, 99 | "distance": 108413.76040441653, 100 | "population": 1441523 101 | }, { 102 | "name": "Osmaniye", 103 | "cityCode": 80, 104 | "distance": 112348.6815543367, 105 | "population": 559405 106 | }, { 107 | "name": "Gaziantep", 108 | "cityCode": 27, 109 | "distance": 116916.3602226536, 110 | "population": 2154051 111 | }, { 112 | "name": "Adıyaman", 113 | "cityCode": 2, 114 | "distance": 120785.66951649316, 115 | "population": 635169 116 | }], 117 | "airports": [{ -> depreme yakıun havalimanları 118 | "distance": 66757.09191032092, -> depremin yaşandığı noktaya uzaklığı 119 | "name": "Kahramanmaraş Havalimanı", 120 | "code": "KCM", 121 | "coordinates": { 122 | "type": "Point", 123 | "coordinates": [36.9473, 37.5374] (long, lat) 124 | } 125 | }, { 126 | "distance": 99806.23459651197, 127 | "name": "Erhaç Havalimanı", 128 | "code": "MLX", 129 | "coordinates": { 130 | "type": "Point", 131 | "coordinates": [38.091, 38.4354] 132 | } 133 | }, { 134 | "distance": 135359.60289478218, 135 | "name": "Adıyaman Havalimanı", 136 | "code": "ADF", 137 | "coordinates": { 138 | "type": "Point", 139 | "coordinates": [38.4691, 37.7314] 140 | } 141 | }] 142 | }, 143 | "rev": null, -> null değilse revize edilmiş bir deprem bilgisi 144 | "date_time": "2023-03-08 02:54:44", -> date time YYYY-MM-DD HH:mm:ss 145 | "created_at": 1678240484, -> unix timestamp 146 | "location_tz": "Europe/Istanbul" -1 statik bilgi 147 | } 148 | 149 | ``` 150 | 151 | 152 | 153 | ## Not 154 | 155 | Ticari amaçlı kullanmak isteyenlere: "Söz konusu bilgi, veri ve haritalar Boğaziçi Üniversitesi Rektörlüğü’nün yazılı izni ve onayı olmadan herhangi bir şekilde ticari amaçlı kullanılamaz." - İsteklerinizi veya sorularınızı info@orhanaydogdu.com.tr den iletebilirsiniz. -------------------------------------------------------------------------------- /biome.jsonc: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json", 3 | "organizeImports": { 4 | "enabled": true 5 | }, 6 | "files": { 7 | "maxSize": 100048576, 8 | "ignore": [] 9 | }, 10 | "linter": { 11 | "enabled": true, 12 | "rules": { 13 | "suspicious": { 14 | "noRedeclare": "error" 15 | }, 16 | "recommended": true, 17 | "performance": { 18 | "noDelete": "off" 19 | }, 20 | "complexity": { 21 | "useLiteralKeys": "off" 22 | }, 23 | "correctness": { 24 | "noInvalidUseBeforeDeclaration": "error", 25 | "noUndeclaredVariables": "error" 26 | }, 27 | "style": { 28 | "useNumberNamespace": "off", 29 | "useDefaultParameterLast": "off" 30 | } 31 | } 32 | }, 33 | "javascript": { 34 | "formatter": { 35 | "jsxQuoteStyle": "single", 36 | "quoteStyle": "single", 37 | "lineWidth": 150 38 | }, 39 | "parser": { 40 | "unsafeParameterDecoratorsEnabled": true 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const cors = require('cors'); 3 | const logger = require('morgan'); 4 | const expressJSDocSwagger = require('express-jsdoc-swagger'); 5 | 6 | const app = express(); 7 | const middlewares = require('./src/middlewares'); 8 | const helpers = require('./src/helpers'); 9 | const db = require('./src/db'); 10 | const port = 7979; 11 | 12 | // connectors for db, cache etc.; 13 | async function connector() { 14 | await db.MongoDB.connector(); 15 | } 16 | 17 | connector(); 18 | 19 | app.set('trust proxy', true); 20 | app.use((req, res, next) => { 21 | const ipFromExpress = req.ip; 22 | const ipFromCF = req.headers['cf-connecting-ip']; 23 | req.ip = ipFromCF || ipFromExpress; 24 | next(); 25 | }); 26 | 27 | logger.token('real-ip', (req) => req.ip); 28 | logger.token('datetime', () => new helpers.kk_date().format('YYYY-MM-DD HH:mm:ss')); 29 | 30 | app.use(cors()); 31 | app.use(logger(':datetime - :real-ip - :method :url :status :response-time ms')); 32 | app.use(express.json({ limit: 1000000 })); 33 | app.use(express.urlencoded({ extended: false })); 34 | 35 | expressJSDocSwagger(app)(middlewares.swagger); 36 | app.use(express.json({ limit: '50mb' })); 37 | 38 | //routes; 39 | app.use(require('./src/routes')); 40 | app.use((err, req, res, next) => { 41 | if (err instanceof SyntaxError && err.status === 400 && 'body' in err) { 42 | console.error(err); 43 | const response = { 44 | status: false, 45 | desc: err.message || '', 46 | httpStatus: err.httpStatus || 500, 47 | }; 48 | return res.status(response.httpStatus).send(response); // Bad request 49 | } 50 | return next(); 51 | }); 52 | 53 | /** 54 | * 404 55 | */ 56 | app.use((req, res) => { 57 | const response = { 58 | httpStatus: 404, 59 | status: false, 60 | }; 61 | response.desc = 'No endpoint!'; 62 | return res.status(response.httpStatus).json(response); 63 | }); 64 | 65 | app.listen(port, () => { 66 | console.log(`Kandilli Rasathanesi API Service API - PORT: ${port}`); 67 | }); 68 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "kandilli-service-api", 3 | "version": "1.0.0", 4 | "description": "Kandilli Rasathanesi'nin yayınladığı son depremler listesi için API. (last minute earthquakes in turkey parsing from Kandilli Observatory XML)", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "NODE_ENV=PROD pm2 start index.js --name kandilli-service -i 4", 8 | "dev": "NODE_ENV=DEV pm2 start index.js --name kandilli-service-dev -i 1 --watch", 9 | "test": "echo \"Error: no test specified\" && exit 1" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "git+https://github.com/orhanayd/kandilli-rasathanesi-api.git" 14 | }, 15 | "author": "", 16 | "license": "ISC", 17 | "bugs": { 18 | "url": "https://github.com/orhanayd/kandilli-rasathanesi-api/issues" 19 | }, 20 | "homepage": "https://github.com/orhanayd/kandilli-rasathanesi-api#readme", 21 | "dependencies": { 22 | "@turf/turf": "^6.5.0", 23 | "axios": "^1.8.4", 24 | "cors": "^2.8.5", 25 | "dotenv": "^16.5.0", 26 | "express": "^4.21.2", 27 | "express-jsdoc-swagger": "^1.8.0", 28 | "fast-xml-parser": "^5.2.1", 29 | "kk-date": "^3.2.1", 30 | "md5": "^2.3.0", 31 | "moment-timezone": "^0.5.48", 32 | "mongodb": "^6.16.0", 33 | "morgan": "^1.10.0", 34 | "nanoid": "3.3.8", 35 | "nope-redis": "^1.3.7" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/constants/errors.js: -------------------------------------------------------------------------------- 1 | function paramsAdder(thiss, params) { 2 | if (params.length === 0) { 3 | return thiss; 4 | } 5 | for (const key in params[0]) { 6 | thiss[key] = params[0][key]; 7 | } 8 | return thiss; 9 | } 10 | 11 | class ServerError extends Error { 12 | constructor(operation = '', message = '', ...params) { 13 | super(...params); 14 | if (Error.captureStackTrace) { 15 | Error.captureStackTrace(this, ServerError); 16 | } 17 | this.name = 'ServerError'; 18 | this.operation = `${operation}`; 19 | this.errorCode = 1; 20 | this.httpStatus = 500; 21 | this.message = `${message}`; 22 | this.date = new Date(); 23 | paramsAdder(this, params); 24 | } 25 | } 26 | 27 | class MissingField extends Error { 28 | constructor(operation = '', message = '', ...params) { 29 | super(...params); 30 | if (Error.captureStackTrace) { 31 | Error.captureStackTrace(this, MissingField); 32 | } 33 | this.name = 'MissingField'; 34 | this.operation = `${operation}`; 35 | this.httpStatus = 406; 36 | this.errorCode = 2; 37 | this.message = `${message}`; 38 | this.date = new Date(); 39 | paramsAdder(this, params); 40 | } 41 | } 42 | 43 | class UnAuth extends Error { 44 | constructor(operation = '', message = '', ...params) { 45 | super(...params); 46 | if (Error.captureStackTrace) { 47 | Error.captureStackTrace(this, UnAuth); 48 | } 49 | this.name = 'UnAuth'; 50 | this.operation = `${operation}`; 51 | this.errorCode = 3; 52 | this.message = `${message}`; 53 | this.httpStatus = 401; 54 | this.date = new Date(); 55 | paramsAdder(this, params); 56 | } 57 | } 58 | 59 | class Forbidden extends Error { 60 | constructor(operation = '', message = '', ...params) { 61 | super(...params); 62 | if (Error.captureStackTrace) { 63 | Error.captureStackTrace(this, Forbidden); 64 | } 65 | this.name = 'Forbidden'; 66 | this.operation = `${operation}`; 67 | this.errorCode = 4; 68 | this.httpStatus = 403; 69 | this.message = `${message}`; 70 | this.date = new Date(); 71 | paramsAdder(this, params); 72 | } 73 | } 74 | 75 | class WrongParam extends Error { 76 | constructor(operation = '', message = '', ...params) { 77 | super(...params); 78 | if (Error.captureStackTrace) { 79 | Error.captureStackTrace(this, WrongParam); 80 | } 81 | this.name = 'WrongParam'; 82 | this.operation = `${operation}`; 83 | this.errorCode = 5; 84 | this.httpStatus = 422; 85 | this.message = `${message}`; 86 | this.date = new Date(); 87 | paramsAdder(this, params); 88 | } 89 | } 90 | 91 | class TooManyRequest extends Error { 92 | constructor(operation = '', message = '', ...params) { 93 | super(...params); 94 | if (Error.captureStackTrace) { 95 | Error.captureStackTrace(this, TooManyRequest); 96 | } 97 | this.name = 'WrongParam'; 98 | this.operation = `${operation}`; 99 | this.errorCode = 7; 100 | this.httpStatus = 429; 101 | this.message = `${message}`; 102 | this.date = new Date(); 103 | paramsAdder(this, params); 104 | } 105 | } 106 | 107 | class NotFound extends Error { 108 | constructor(operation = '', message = '', ...params) { 109 | super(...params); 110 | if (Error.captureStackTrace) { 111 | Error.captureStackTrace(this, NotFound); 112 | } 113 | this.name = 'NotFound'; 114 | this.operation = `${operation}`; 115 | this.errorCode = 8; 116 | this.httpStatus = 404; 117 | this.message = `${message}`; 118 | this.date = new Date(); 119 | paramsAdder(this, params); 120 | } 121 | } 122 | module.exports = { 123 | ServerError, 124 | MissingField, 125 | UnAuth, 126 | Forbidden, 127 | WrongParam, 128 | TooManyRequest, 129 | NotFound, 130 | }; 131 | -------------------------------------------------------------------------------- /src/constants/index.js: -------------------------------------------------------------------------------- 1 | require('dotenv').config(); 2 | 3 | module.exports.CONFIG = { 4 | CRON_KEY: process.env.CRON_KEY, 5 | STATS_KEY: process.env.STATS_KEY, 6 | BYPASS_IPS: process.env.BYPASS_IPS.split(','), 7 | }; 8 | 9 | module.exports.STAGES = { 10 | DEV: 'DEV', 11 | PROD: 'PROD', 12 | }; 13 | 14 | module.exports.stats = { 15 | dateBy: 'dateBy', 16 | hourBy: 'hourBy', 17 | epiCenterBy: 'epiCenterBy', 18 | airportsBy: 'airportsBy', 19 | magBy: 'magBy', 20 | dateByEarthQuakes: 'dateByEarthQuakes', 21 | }; 22 | 23 | module.exports.statsRange = { 24 | TODAY: 'TODAY', 25 | YESTERDAY: 'YESTERDAY', 26 | LAST3DAYS: 'LAST3DAYS', 27 | LAST5DAYS: 'LAST5DAYS', 28 | LAST7DAYS: 'LAST7DAYS', 29 | THISMONTH: 'THISMONTH', 30 | LASTMONTH: 'LASTMONTH', 31 | LAST2MONTHS: 'LAST2MONTHS', 32 | LAST3MONTHS: 'LAST3MONTHS', 33 | DATE: 'DATE', 34 | }; 35 | 36 | module.exports.providers = { 37 | KANDILLI: 'kandilli', 38 | AFAD: 'afad', 39 | }; 40 | 41 | module.exports.response = () => { 42 | return { 43 | status: true, 44 | httpStatus: 200, 45 | desc: '', 46 | }; 47 | }; 48 | 49 | module.exports.errors = require('./errors'); 50 | -------------------------------------------------------------------------------- /src/controller/data/index.js: -------------------------------------------------------------------------------- 1 | const helpers = require('../../helpers'); 2 | const constants = require('../../constants'); 3 | 4 | module.exports.statsGeneral = (req, res, next) => { 5 | const response = constants.response(); 6 | try { 7 | const body = { 8 | match: { 9 | date_time: {}, 10 | }, 11 | }; 12 | body.match.provider = constants.providers.KANDILLI; 13 | body.provider = constants.providers.KANDILLI; 14 | 15 | if (typeof req.body.range !== 'string') { 16 | throw new constants.errors.MissingField('data.statsGeneral', 'range missing !'); 17 | } 18 | if (req.body.range in constants.statsRange === false) { 19 | throw new constants.errors.WrongParam('data.statsGeneral', 'range wrong !'); 20 | } 21 | body.range = req.body.range; 22 | if (req.body.range === 'DATE') { 23 | try { 24 | body.date = JSON.parse(req.body.date); 25 | } catch (error) { 26 | console.error(error); 27 | throw new constants.errors.ServerError('data.statsGeneral', 'req body date parse error !'); 28 | } 29 | } 30 | if (typeof req.body.provider === 'string') { 31 | if (req.body.provider in constants.providers === false) { 32 | throw new constants.errors.WrongParam('data.statsGeneral', 'provider wrong !'); 33 | } 34 | body.match.provider = req.body.provider.toString(); 35 | body.provider = body.match.provider; 36 | } 37 | 38 | if (typeof req.body.epiCenter === 'string') { 39 | body.match['location_properties.epiCenter.name'] = req.body.epiCenter.toString(); 40 | } 41 | 42 | if (typeof req.body.types === 'undefined' || Array.isArray(req.body.types) === false) { 43 | req.body.types = []; 44 | } 45 | body.types = []; 46 | const type_length = req.body.types.length; 47 | for (let index = 0; index < type_length; index++) { 48 | if (req.body.types[index] in constants.stats === false) { 49 | throw new constants.errors.WrongParam('data.statsGeneral', 'type value wrong !'); 50 | } 51 | body.types.push(req.body.types[index].toString()); 52 | } 53 | 54 | switch (req.body.range) { 55 | case constants.statsRange.TODAY: 56 | body.match.date_time = { 57 | $gte: helpers.date.moment.moment().tz('Europe/Istanbul').startOf('day').format('YYYY-MM-DD HH:mm:ss'), 58 | $lte: helpers.date.moment.moment().tz('Europe/Istanbul').endOf('day').format('YYYY-MM-DD HH:mm:ss'), 59 | }; 60 | break; 61 | case constants.statsRange.YESTERDAY: 62 | body.match.date_time = { 63 | $gte: helpers.date.moment.moment().tz('Europe/Istanbul').add(-1, 'days').startOf('day').format('YYYY-MM-DD HH:mm:ss'), 64 | $lte: helpers.date.moment.moment().tz('Europe/Istanbul').add(-1, 'days').endOf('day').format('YYYY-MM-DD HH:mm:ss'), 65 | }; 66 | break; 67 | case constants.statsRange.LAST3DAYS: 68 | body.match.date_time = { 69 | $gte: helpers.date.moment.moment().tz('Europe/Istanbul').add(-3, 'days').startOf('day').format('YYYY-MM-DD HH:mm:ss'), 70 | $lte: helpers.date.moment.moment().tz('Europe/Istanbul').endOf('day').format('YYYY-MM-DD HH:mm:ss'), 71 | }; 72 | break; 73 | case constants.statsRange.LAST5DAYS: 74 | body.match.date_time = { 75 | $gte: helpers.date.moment.moment().tz('Europe/Istanbul').add(-5, 'days').startOf('day').format('YYYY-MM-DD HH:mm:ss'), 76 | $lte: helpers.date.moment.moment().tz('Europe/Istanbul').endOf('day').format('YYYY-MM-DD HH:mm:ss'), 77 | }; 78 | break; 79 | case constants.statsRange.LAST7DAYS: 80 | body.match.date_time = { 81 | $gte: helpers.date.moment.moment().tz('Europe/Istanbul').add(-7, 'days').startOf('day').format('YYYY-MM-DD HH:mm:ss'), 82 | $lte: helpers.date.moment.moment().tz('Europe/Istanbul').endOf('day').format('YYYY-MM-DD HH:mm:ss'), 83 | }; 84 | break; 85 | case constants.statsRange.THISMONTH: 86 | body.match.date_time = { 87 | $gte: helpers.date.moment.moment().tz('Europe/Istanbul').startOf('month').format('YYYY-MM-DD HH:mm:ss'), 88 | $lte: helpers.date.moment.moment().tz('Europe/Istanbul').endOf('month').format('YYYY-MM-DD HH:mm:ss'), 89 | }; 90 | break; 91 | case constants.statsRange.LASTMONTH: 92 | body.match.date_time = { 93 | $gte: helpers.date.moment.moment().tz('Europe/Istanbul').add(-1, 'month').startOf('month').format('YYYY-MM-DD HH:mm:ss'), 94 | $lte: helpers.date.moment.moment().tz('Europe/Istanbul').add(-1, 'month').endOf('month').format('YYYY-MM-DD HH:mm:ss'), 95 | }; 96 | break; 97 | case constants.statsRange.LAST2MONTHS: 98 | body.match.date_time = { 99 | $gte: helpers.date.moment.moment().tz('Europe/Istanbul').add(-2, 'month').startOf('month').format('YYYY-MM-DD HH:mm:ss'), 100 | $lte: helpers.date.moment.moment().tz('Europe/Istanbul').endOf('month').format('YYYY-MM-DD HH:mm:ss'), 101 | }; 102 | break; 103 | case constants.statsRange.LAST3MONTHS: 104 | body.match.date_time = { 105 | $gte: helpers.date.moment.moment().tz('Europe/Istanbul').add(-3, 'month').startOf('month').format('YYYY-MM-DD HH:mm:ss'), 106 | $lte: helpers.date.moment.moment().tz('Europe/Istanbul').endOf('month').format('YYYY-MM-DD HH:mm:ss'), 107 | }; 108 | break; 109 | case constants.statsRange.DATE: { 110 | const total = new helpers.kk_date(body.date.starts_date).diff(body.date.ends_date, 'days'); 111 | if (total > 7) { 112 | throw new constants.errors.WrongParam('data.statsGeneral', 'date range cant be big than 7 days !'); 113 | } 114 | body.match.date_time = { 115 | $gte: helpers.date.moment.moment(body.date.starts_date).tz('Europe/Istanbul').startOf('day').format('YYYY-MM-DD HH:mm:ss'), 116 | $lte: helpers.date.moment.moment(body.date.ends_date).endOf('day').tz('Europe/Istanbul').format('YYYY-MM-DD HH:mm:ss'), 117 | }; 118 | break; 119 | } 120 | default: 121 | throw new constants.errors.WrongParam('data.statsGeneral', 'no range type !'); 122 | } 123 | 124 | req.body = body; 125 | return next(); 126 | } catch (error) { 127 | console.error(error); 128 | response.desc = error.message || ''; 129 | response.httpStatus = error.httpStatus || 500; 130 | response.status = false; 131 | return res.status(response.httpStatus).json(response); 132 | } 133 | }; 134 | 135 | module.exports.search = (req, res, next) => { 136 | const response = constants.response(); 137 | try { 138 | const body = { 139 | skip: 0, 140 | limit: 10, 141 | geoNear: null, 142 | match: {}, 143 | sort: { date_time: -1 }, 144 | }; 145 | 146 | if (typeof req.body.skip === 'number') { 147 | body.skip = parseInt(req.body.skip, 10); 148 | if (Number.isNaN(body.skip)) { 149 | throw new constants.errors.WrongParam('data.search', 'isNaN skip !'); 150 | } 151 | } 152 | 153 | if (typeof req.body.limit === 'number') { 154 | body.limit = parseInt(req.body.limit, 10); 155 | if (Number.isNaN(body.limit)) { 156 | throw new constants.errors.WrongParam('data.search', 'isNaN limit !'); 157 | } 158 | if (body.limit > 1000) { 159 | throw new constants.errors.WrongParam('data.search', 'limit maximum can be 1000 !'); 160 | } 161 | } 162 | 163 | if (typeof req.body.geoNear === 'object') { 164 | if (typeof req.body.geoNear.lon !== 'number' && typeof req.body.geoNear.lat !== 'number') { 165 | throw new constants.errors.WrongParam('data.search', 'lat or lon is not a number !'); 166 | } 167 | if (typeof req.body.geoNear.radiusMeter !== 'number') { 168 | req.body.geoNear.radiusMeter = parseInt(req.body.geoNear.radiusMeter, 10); 169 | if (Number.isNaN(req.body.geoNear.radiusMeter)) { 170 | throw new constants.errors.WrongParam('data.search', 'radiusMeter isNaN !'); 171 | } 172 | } 173 | body.geoNear = { 174 | geojson: { $geoWithin: { $centerSphere: [[], 0] } }, 175 | }; 176 | body.geoNear.geojson['$geoWithin']['$centerSphere'][0][0] = parseFloat(req.body.geoNear.lon); 177 | body.geoNear.geojson['$geoWithin']['$centerSphere'][0][1] = parseFloat(req.body.geoNear.lat); 178 | body.geoNear.geojson['$geoWithin']['$centerSphere'][1] = helpers.metersToRadios(req.body.geoNear.radiusMeter); 179 | if (body.geoNear.geojson['$geoWithin']['$centerSphere'][1] === false) { 180 | throw new constants.errors.WrongParam('data.search', 'meters is false !'); 181 | } 182 | } 183 | 184 | if (typeof req.body.sort === 'string') { 185 | if (req.body.sort === 'date_1') { 186 | body.sort = { date_time: 1 }; 187 | } else if (req.body.sort === 'date_-1') { 188 | body.sort = { date_time: -1 }; 189 | } else if (req.body.sort === 'mag_1') { 190 | body.sort = { mag: 1 }; 191 | } else if (req.body.sort === 'mag_-1') { 192 | body.sort = { mag: -1 }; 193 | } 194 | } 195 | 196 | if (typeof req.body.match === 'object') { 197 | if (req.body.match.mag && typeof req.body.match.mag === 'number') { 198 | body.match.mag = { $gte: parseInt(req.body.match.mag, 10) }; 199 | if (Number.isNaN(body.match.mag['$gte'])) { 200 | throw new constants.errors.WrongParam('data.search', 'isNaN mag !'); 201 | } 202 | } 203 | if (typeof req.body.match.date_starts === 'string' && typeof req.body.match.date_ends === 'string') { 204 | if ( 205 | !helpers.kk_date.isValid(req.body.match.date_starts, 'YYYY-MM-DD HH:mm:ss') || 206 | !helpers.kk_date.isValid(req.body.match.date_ends, 'YYYY-MM-DD HH:mm:ss') 207 | ) { 208 | throw new constants.errors.WrongParam('data.search', 'date_starts or date_ends is not valid !'); 209 | } 210 | body.match.date_time = { 211 | $gte: req.body.search.date_starts.toStrings(), 212 | $lte: req.body.match.date_ends.toStrings(), 213 | }; 214 | } 215 | 216 | if (typeof req.body.match.cityCode === 'number') { 217 | body.match['location_properties.epiCenter.cityCode'] = parseInt(req.body.match.cityCode, 10); 218 | if (Number.isNaN(body.match['location_properties.epiCenter.cityCode'])) { 219 | throw new constants.errors.WrongParam('data.search', 'cityCode isNaN !'); 220 | } 221 | } 222 | } 223 | 224 | req.body = body; 225 | return next(); 226 | } catch (error) { 227 | console.error(error); 228 | response.desc = error.message || ''; 229 | response.httpStatus = error.httpStatus || 500; 230 | response.status = false; 231 | return res.status(response.httpStatus).json(response); 232 | } 233 | }; 234 | 235 | module.exports.get = (req, res, next) => { 236 | const response = constants.response(); 237 | 238 | try { 239 | const query = {}; 240 | 241 | if (typeof req.query.earthquake_id === 'undefined') { 242 | throw new constants.errors.MissingField('data.search', 'earthquake_id missing param !'); 243 | } 244 | query.earthquake_id = req.query.earthquake_id.toString(); 245 | req.query = query; 246 | return next(); 247 | } catch (error) { 248 | console.error(error); 249 | response.desc = error.message || ''; 250 | response.httpStatus = error.httpStatus || 500; 251 | response.status = false; 252 | return res.status(response.httpStatus).json(response); 253 | } 254 | }; 255 | -------------------------------------------------------------------------------- /src/controller/index.js: -------------------------------------------------------------------------------- 1 | module.exports.kandilli = require('./kandilli'); 2 | module.exports.data = require('./data'); 3 | -------------------------------------------------------------------------------- /src/controller/kandilli/index.js: -------------------------------------------------------------------------------- 1 | const helpers = require('../../helpers'); 2 | const repositories = require('../../repositories'); 3 | const constants = require('../../constants'); 4 | 5 | module.exports.live = async (req, res, next) => { 6 | const response = constants.response(); 7 | 8 | try { 9 | const query = { 10 | skip: 0, 11 | limit: 100, 12 | }; 13 | await repositories.rate.check(req.ip); 14 | 15 | if (req.query.skip && typeof req.query.skip === 'string') { 16 | query.skip = parseInt(req.query.skip, 10); 17 | if (Number.isNaN(query.skip)) { 18 | throw new constants.errors.WrongParam('kandilli.live', 'isNaN skip !'); 19 | } 20 | } 21 | 22 | if (req.query.limit && typeof req.query.limit === 'string') { 23 | query.limit = parseInt(req.query.limit, 10); 24 | if (Number.isNaN(query.limit)) { 25 | throw new constants.errors.WrongParam('kandilli.live', 'isNaN limit !'); 26 | } 27 | if (query.limit > 100) { 28 | query.limit = 100; 29 | } 30 | } 31 | 32 | req.query = query; 33 | return next(); 34 | } catch (error) { 35 | console.error(error); 36 | response.desc = error.message || ''; 37 | response.httpStatus = error.httpStatus || 500; 38 | response.status = false; 39 | return res.status(response.httpStatus).json(response); 40 | } 41 | }; 42 | 43 | module.exports.archive = async (req, res, next) => { 44 | const response = constants.response(); 45 | 46 | try { 47 | const query = { 48 | skip: 0, 49 | limit: 100, 50 | date: helpers.date.moment.moment().tz('Europe/Istanbul').add(-24, 'hours').format('YYYY-MM-DD HH:mm:ss'), 51 | date_end: helpers.date.moment.moment().tz('Europe/Istanbul').format('YYYY-MM-DD HH:mm:ss'), 52 | }; 53 | 54 | await repositories.rate.check(req.ip); 55 | 56 | if (req.query.limit && typeof req.query.limit === 'string') { 57 | query.limit = parseInt(req.query.limit, 10); 58 | if (Number.isNaN(query.limit)) { 59 | throw new constants.errors.WrongParam('kandilli.archive', 'isNaN limit !'); 60 | } 61 | if (query.limit > 1000) { 62 | throw new constants.errors.WrongParam('kandilli.archive', 'limit maximum can be 1000 !'); 63 | } 64 | } 65 | if (req.query.skip && typeof req.query.skip === 'string') { 66 | query.skip = parseInt(req.query.skip, 10); 67 | if (Number.isNaN(query.skip)) { 68 | throw new constants.errors.WrongParam('kandilli.archive', 'isNaN skip !'); 69 | } 70 | } 71 | 72 | if (req.query.date && typeof req.query.date === 'string') { 73 | req.query.date = req.query.date.toString(); 74 | if (!helpers.kk_date.isValid(req.query.date, 'YYYY-MM-DD')) { 75 | throw new constants.errors.WrongParam('kandilli.archive', 'date wrong param !'); 76 | } 77 | query.date = helpers.date.moment.moment(req.query.date).startOf('day').format('YYYY-MM-DD HH:mm:ss'); 78 | } 79 | if (req.query.date_end && typeof req.query.date_end === 'string') { 80 | req.query.date_end = req.query.date_end.toString(); 81 | if (!helpers.kk_date.isValid(req.query.date_end, 'YYYY-MM-DD')) { 82 | throw new constants.errors.WrongParam('kandilli.archive', 'date_end wrong param !'); 83 | } 84 | query.date_end = helpers.date.moment.moment(req.query.date_end).endOf('day').format('YYYY-MM-DD HH:mm:ss'); 85 | } 86 | 87 | req.query = query; 88 | return next(); 89 | } catch (error) { 90 | console.error(error); 91 | response.desc = error.message || ''; 92 | response.httpStatus = error.httpStatus || 500; 93 | response.status = false; 94 | return res.status(response.httpStatus).json(response); 95 | } 96 | }; 97 | -------------------------------------------------------------------------------- /src/db/MongoDB.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created from @orhanayd 3 | * For MongoDB easy use! 4 | */ 5 | 6 | const { MongoClient, ObjectId } = require('mongodb'); 7 | const { customAlphabet } = require('nanoid'); 8 | const constants = require('../constants'); 9 | 10 | /* 11 | * @class 12 | * @alias module:Bar 13 | * @param {connection} MongoClient 14 | */ 15 | let connection; 16 | let retry = 0; 17 | const maxRetry = 3; 18 | 19 | module.exports.connector = async (connectionString = null) => { 20 | if (retry < maxRetry) { 21 | try { 22 | retry++; 23 | const uri = connectionString 24 | ? connectionString 25 | : `mongodb://${process.env.MONGODB_USER}:${encodeURIComponent(process.env.MONGODB_PASS)}@${process.env.MONGODB_HOST}:${process.env.MONGODB_PORT}/admin`; 26 | const mongoClient = new MongoClient(uri, { 27 | minPoolSize: 5, 28 | maxPoolSize: 10, 29 | connectTimeoutMS: 5 * 1000, 30 | }); 31 | connection = await mongoClient.connect(); 32 | console.log('MongoDB -> Connected'); 33 | return connection; 34 | } catch (error) { 35 | console.error(error); 36 | } 37 | } 38 | if (maxRetry >= retry) { 39 | console.error('MongoDB -> NOT CONNECT'); 40 | } 41 | connection = false; 42 | }; 43 | 44 | /** 45 | * MongoDB CRUD Operation class 46 | */ 47 | class CRUD { 48 | /** 49 | * constructor for mongodb 50 | * 51 | * @param {String} db 52 | * @param {String} collection 53 | */ 54 | constructor(db, collection) { 55 | if (!connection) { 56 | throw new constants.errors.ServerError('db.connector', 'db connection error !'); 57 | } 58 | this.db = db; 59 | this.collection = collection; 60 | if (process.env.NODE_ENV === constants.STAGES.DEV) { 61 | this.db = `dev_${this.db}`; 62 | } 63 | } 64 | 65 | /** 66 | * 67 | * Find operator for mongodb 68 | * 69 | * @param {Object} query 70 | * @param {Array} limit 71 | * @param {Object} project 72 | * @param {Object} sort 73 | * @param {Object} options 74 | * @returns {Promise} 75 | */ 76 | async find(query = {}, limit = [0, 10], project = {}, sort = {}, collation = {}) { 77 | return await connection 78 | .db(this.db) 79 | .collection(this.collection) 80 | .find(query) 81 | .sort(sort) 82 | .collation(collation) 83 | .skip(limit[0]) 84 | .limit(limit[1]) 85 | .project(project) 86 | .toArray(); 87 | } 88 | 89 | /** 90 | * Count data with query 91 | * 92 | * @param {Object} query 93 | * @returns 94 | */ 95 | async count(query = {}) { 96 | return await connection.db(this.db).collection(this.collection).countDocuments(query); 97 | } 98 | 99 | /** 100 | * mongodb insert operator for object 101 | * 102 | * @param {Object} data 103 | * @returns 104 | */ 105 | async insert(data) { 106 | await connection.db(this.db).collection(this.collection).insertOne(data); 107 | return true; 108 | } 109 | 110 | /** 111 | * mongodb insert operator for array 112 | * 113 | * @param {Array} data 114 | * @returns 115 | */ 116 | async insertMany(data) { 117 | if (Array.isArray(data) === false) { 118 | return false; 119 | } 120 | await connection.db(this.db).collection(this.collection).insertMany(data); 121 | return true; 122 | } 123 | 124 | /** 125 | * mongodb update operator for multiple or single 126 | * 127 | * @param {Object} query 128 | * @param {Object} update 129 | * @param {Boolean} multiple 130 | * @returns 131 | */ 132 | async update(query = null, update = null, multiple = false) { 133 | if (multiple) { 134 | await connection.db(this.db).collection(this.collection).updateMany(query, update); 135 | } else { 136 | await connection.db(this.db).collection(this.collection).updateOne(query, update); 137 | } 138 | return true; 139 | } 140 | 141 | /** 142 | * mongodb delete operation for delete multiple document 143 | * 144 | * @param {Object} query 145 | * @returns 146 | */ 147 | async delete(query) { 148 | await connection.db(this.db).collection(this.collection).deleteMany(query); 149 | return true; 150 | } 151 | 152 | /** 153 | * mongodb aggregation pipelines 154 | * 155 | * @param {Object} pipeline aggregation pipeline stages 156 | */ 157 | async aggregate(pipeline) { 158 | return await connection.db(this.db).collection(this.collection).aggregate(pipeline, { allowDiskUse: true }).toArray(); 159 | } 160 | 161 | /** 162 | * mongodb get collection list 163 | * 164 | * @param {Object} pipeline aggregation pipeline stages 165 | */ 166 | async listCollection() { 167 | return await connection.db(this.db).listCollections().toArray(); 168 | } 169 | 170 | async createIndex(data) { 171 | return await connection.db(this.db).collection(this.collection).createIndex(data); 172 | } 173 | } 174 | 175 | module.exports.id = customAlphabet('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz', 13); 176 | module.exports.CRUD = CRUD; 177 | module.exports.ObjectId = ObjectId; 178 | -------------------------------------------------------------------------------- /src/db/index.js: -------------------------------------------------------------------------------- 1 | module.exports.MongoDB = require('./MongoDB'); 2 | module.exports.nopeRedis = require('./nopeRedis'); 3 | module.exports.locations = require('./locations'); 4 | module.exports.populations = require('./populations'); 5 | -------------------------------------------------------------------------------- /src/db/locations/airports.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | { 3 | name: 'Atatürk Havalimanı', 4 | number: 34, 5 | code: 'IST', 6 | city: 'İstanbul', 7 | coordinates: { 8 | type: 'Point', 9 | coordinates: [28.819198608398438, 40.9788613095528], 10 | }, 11 | }, 12 | { 13 | name: 'İstanbul Havalimanı', 14 | number: 34, 15 | code: 'IST', 16 | city: 'İstanbul', 17 | coordinates: { 18 | type: 'Point', 19 | coordinates: [28.69640724873047, 41.26284442553171], 20 | }, 21 | }, 22 | { 23 | name: 'Sabiha Gökçen Havalimanı', 24 | number: 34, 25 | code: 'SAW', 26 | city: 'İstanbul', 27 | coordinates: { 28 | type: 'Point', 29 | coordinates: [29.30843353271484, 40.89976036643661], 30 | }, 31 | }, 32 | { 33 | name: 'Gökçeada Havalimanı', 34 | number: 17, 35 | code: 'GKD', 36 | city: 'Çanakkale', 37 | coordinates: { 38 | type: 'Point', 39 | coordinates: [25.8837, 40.1996], 40 | }, 41 | }, 42 | { 43 | name: 'Çanakkale Havalimanı', 44 | number: 17, 45 | code: 'CKZ', 46 | city: 'Çanakkale', 47 | coordinates: { 48 | type: 'Point', 49 | coordinates: [26.4268, 40.1377], 50 | }, 51 | }, 52 | { 53 | name: 'Çiğli Havalimanı', 54 | number: 35, 55 | code: 'IGL', 56 | city: 'İzmir', 57 | coordinates: { 58 | type: 'Point', 59 | coordinates: [27.01, 38.513], 60 | }, 61 | }, 62 | { 63 | name: 'Adnan Menderes Havalimanı', 64 | number: 35, 65 | code: 'ADB', 66 | city: 'İzmir', 67 | coordinates: { 68 | type: 'Point', 69 | coordinates: [27.157, 38.2924], 70 | }, 71 | }, 72 | { 73 | name: 'Tekirdağ Çorlu Havalimanı', 74 | number: 59, 75 | code: 'TEQ', 76 | city: 'Tekirdağ', 77 | coordinates: { 78 | type: 'Point', 79 | coordinates: [27.921, 41.1392], 80 | }, 81 | }, 82 | { 83 | name: 'Bandırma Havalimanı', 84 | number: 10, 85 | code: 'BDM', 86 | city: 'Balıkesir', 87 | coordinates: { 88 | type: 'Point', 89 | coordinates: [27.9777, 40.318], 90 | }, 91 | }, 92 | { 93 | name: 'Balıkesir Merkez Havalimanı', 94 | number: 10, 95 | code: 'BZI', 96 | city: 'Balıkesir', 97 | coordinates: { 98 | type: 'Point', 99 | coordinates: [27.926, 39.6193], 100 | }, 101 | }, 102 | { 103 | name: 'Balıkesir Koca Seyit Havalimanı', 104 | number: 10, 105 | code: 'EDO', 106 | city: 'Balıkesir', 107 | coordinates: { 108 | type: 'Point', 109 | coordinates: [27.0138, 39.5546], 110 | }, 111 | }, 112 | { 113 | name: 'Aydın Çıldır Havalimanı', 114 | number: 9, 115 | code: 'CII', 116 | city: 'Aydın', 117 | coordinates: { 118 | type: 'Point', 119 | coordinates: [27.8885, 37.816], 120 | }, 121 | }, 122 | { 123 | name: 'Milas Bodrum Havalimanı', 124 | number: 48, 125 | code: 'BJV', 126 | city: 'Muğla', 127 | coordinates: { 128 | type: 'Point', 129 | coordinates: [27.6643, 37.2506], 130 | }, 131 | }, 132 | { 133 | name: 'Bursa Havalimanı', 134 | number: 16, 135 | code: 'BTZ', 136 | city: 'Bursa', 137 | coordinates: { 138 | type: 'Point', 139 | coordinates: [29.0094, 40.2326], 140 | }, 141 | }, 142 | { 143 | name: 'Dalaman Havalimanı', 144 | number: 48, 145 | code: 'DLM', 146 | city: 'Muğla', 147 | coordinates: { 148 | type: 'Point', 149 | coordinates: [28.7925, 36.7131], 150 | }, 151 | }, 152 | { 153 | name: 'Bursa Yenişehir Havalimanı', 154 | number: 16, 155 | code: 'YEI', 156 | city: 'Bursa', 157 | coordinates: { 158 | type: 'Point', 159 | coordinates: [29.5625, 40.2553], 160 | }, 161 | }, 162 | { 163 | name: 'Uşak Havalimanı', 164 | number: 64, 165 | code: 'USQ', 166 | city: 'Uşak', 167 | coordinates: { 168 | type: 'Point', 169 | coordinates: [29.4717, 38.6815], 170 | }, 171 | }, 172 | { 173 | name: 'Çardak Havalimanı', 174 | number: 20, 175 | code: 'DNZ', 176 | city: 'Denizli', 177 | coordinates: { 178 | type: 'Point', 179 | coordinates: [29.7013, 37.7856], 180 | }, 181 | }, 182 | { 183 | name: 'Cengiz Topel Havalimanı', 184 | number: 41, 185 | code: 'KCO', 186 | city: 'Kocaeli', 187 | coordinates: { 188 | type: 'Point', 189 | coordinates: [30.0833, 40.735], 190 | }, 191 | }, 192 | { 193 | name: 'Zafer Havalimanı', 194 | number: 43, 195 | code: 'KZR', 196 | city: 'Kütahya', 197 | coordinates: { 198 | type: 'Point', 199 | coordinates: [30.0183, 39.4242], 200 | }, 201 | }, 202 | { 203 | name: 'Eskişehir Anadolu Havalimanı', 204 | number: 26, 205 | code: 'AOE', 206 | city: 'Eskişehir', 207 | coordinates: { 208 | type: 'Point', 209 | coordinates: [30.5193, 39.8098], 210 | }, 211 | }, 212 | { 213 | name: 'Afyon Havalimanı', 214 | number: 3, 215 | code: 'AFY', 216 | city: 'Afyon', 217 | coordinates: { 218 | type: 'Point', 219 | coordinates: [30.6011, 38.7264], 220 | }, 221 | }, 222 | { 223 | name: 'Süleyman Demirel Havalimanı', 224 | number: 32, 225 | code: 'ISE', 226 | city: 'Isparta', 227 | coordinates: { 228 | type: 'Point', 229 | coordinates: [30.3684, 37.8554], 230 | }, 231 | }, 232 | { 233 | name: 'Antalya Havalimanı', 234 | number: 7, 235 | code: 'AYT', 236 | city: 'Antalya', 237 | coordinates: { 238 | type: 'Point', 239 | coordinates: [30.8005, 36.8987], 240 | }, 241 | }, 242 | { 243 | name: 'Sivrihisar Havalimanı', 244 | number: 26, 245 | code: 'KYA', 246 | city: 'Eskişehir', 247 | coordinates: { 248 | type: 'Point', 249 | coordinates: [31.3649, 39.4519], 250 | }, 251 | }, 252 | { 253 | name: 'Zonguldak Havalimanı', 254 | number: 67, 255 | code: 'ONQ', 256 | city: 'Zonguldak', 257 | coordinates: { 258 | type: 'Point', 259 | coordinates: [32.0855, 41.5046], 260 | }, 261 | }, 262 | { 263 | name: 'Esenboğa Havalimanı', 264 | number: 6, 265 | code: 'ESB', 266 | city: 'Ankara', 267 | coordinates: { 268 | type: 'Point', 269 | coordinates: [32.9951, 40.1281], 270 | }, 271 | }, 272 | { 273 | name: 'Konya Havalimanı', 274 | number: 42, 275 | code: 'KYA', 276 | city: 'Konya', 277 | coordinates: { 278 | type: 'Point', 279 | coordinates: [32.5619, 37.979], 280 | }, 281 | }, 282 | { 283 | name: 'Gazipaşa Havalimanı', 284 | number: 7, 285 | code: 'GZP', 286 | city: 'Antalya', 287 | coordinates: { 288 | type: 'Point', 289 | coordinates: [32.3006, 36.2992], 290 | }, 291 | }, 292 | { 293 | name: 'Kastamonu Havalimanı', 294 | number: 37, 295 | code: 'KFS', 296 | city: 'Kastamonu', 297 | coordinates: { 298 | type: 'Point', 299 | coordinates: [33.7958, 41.3142], 300 | }, 301 | }, 302 | { 303 | name: 'Nevşehir Kapadokya Havalimanı', 304 | number: 50, 305 | code: 'NAV', 306 | city: 'Nevşehir', 307 | coordinates: { 308 | type: 'Point', 309 | coordinates: [34.5346, 38.7719], 310 | }, 311 | }, 312 | { 313 | name: 'Sinop Havalimanı', 314 | number: 57, 315 | code: 'NOP', 316 | city: 'Sinop', 317 | coordinates: { 318 | type: 'Point', 319 | coordinates: [35.0806, 42.0209], 320 | }, 321 | }, 322 | { 323 | name: 'Amasya Merzifon Havalimanı', 324 | number: 5, 325 | code: 'MZH', 326 | city: 'Amasya', 327 | coordinates: { 328 | type: 'Point', 329 | coordinates: [35.522, 40.8294], 330 | }, 331 | }, 332 | { 333 | name: 'Kayseri Erkilet Havalimanı', 334 | number: 38, 335 | code: 'ASR', 336 | city: 'Kayseri', 337 | coordinates: { 338 | type: 'Point', 339 | coordinates: [35.4954, 38.7704], 340 | }, 341 | }, 342 | { 343 | name: 'Şakirpaşa Havalimanı', 344 | number: 1, 345 | code: 'ADA', 346 | city: 'Adana', 347 | coordinates: { 348 | type: 'Point', 349 | coordinates: [35.2804, 36.9822], 350 | }, 351 | }, 352 | { 353 | name: 'Samsun Çarşamba Havalimanı', 354 | number: 55, 355 | code: 'SZF', 356 | city: 'Samsun', 357 | coordinates: { 358 | type: 'Point', 359 | coordinates: [36.556, 41.2585], 360 | }, 361 | }, 362 | { 363 | name: 'Tokat Havalimanı', 364 | number: 60, 365 | code: 'TJK', 366 | city: 'Tokat', 367 | coordinates: { 368 | type: 'Point', 369 | coordinates: [36.3711, 40.3063], 370 | }, 371 | }, 372 | { 373 | name: 'Hatay Havalimanı', 374 | number: 31, 375 | code: 'HTY', 376 | city: 'Hatay', 377 | coordinates: { 378 | type: 'Point', 379 | coordinates: [36.2835, 36.3619], 380 | }, 381 | }, 382 | { 383 | name: 'Sivas Nuri Demirağ Havalimanı', 384 | number: 58, 385 | code: 'VAS', 386 | city: 'Sivas', 387 | coordinates: { 388 | type: 'Point', 389 | coordinates: [36.9035, 39.8138], 390 | }, 391 | }, 392 | { 393 | name: 'Kahramanmaraş Havalimanı', 394 | number: 46, 395 | code: 'KCM', 396 | city: 'Kahramanmaraş', 397 | coordinates: { 398 | type: 'Point', 399 | coordinates: [36.9473, 37.5374], 400 | }, 401 | }, 402 | { 403 | name: 'Gaziantep Havalimanı', 404 | number: 27, 405 | code: 'GZT', 406 | city: 'Gaziantep', 407 | coordinates: { 408 | type: 'Point', 409 | coordinates: [37.4787, 36.9472], 410 | }, 411 | }, 412 | { 413 | name: 'Ordu Giresun Havalimanı', 414 | number: 52, 415 | code: 'OGU', 416 | city: 'Ordu', 417 | coordinates: { 418 | type: 'Point', 419 | coordinates: [38.0802, 40.9647], 420 | }, 421 | }, 422 | { 423 | name: 'Erhaç Havalimanı', 424 | number: 44, 425 | code: 'MLX', 426 | city: 'Malatya', 427 | coordinates: { 428 | type: 'Point', 429 | coordinates: [38.091, 38.4354], 430 | }, 431 | }, 432 | { 433 | name: 'Adıyaman Havalimanı', 434 | number: 2, 435 | code: 'ADF', 436 | city: 'Adıyaman', 437 | coordinates: { 438 | type: 'Point', 439 | coordinates: [38.4691, 37.7314], 440 | }, 441 | }, 442 | { 443 | name: 'GAP Havalimanı', 444 | number: 63, 445 | code: 'GNY', 446 | city: 'Şanlıurfa', 447 | coordinates: { 448 | type: 'Point', 449 | coordinates: [38.9022, 37.4456], 450 | }, 451 | }, 452 | { 453 | name: 'Elazığ Havalimanı', 454 | number: 23, 455 | code: 'EZS', 456 | city: 'Elazığ', 457 | coordinates: { 458 | type: 'Point', 459 | coordinates: [39.296, 38.6041], 460 | }, 461 | }, 462 | { 463 | name: 'Erzincan Havalimanı', 464 | number: 24, 465 | code: 'ERC', 466 | city: 'Erzincan', 467 | coordinates: { 468 | type: 'Point', 469 | coordinates: [39.527, 39.7102], 470 | }, 471 | }, 472 | { 473 | name: 'Trabzon Havalimanı', 474 | number: 61, 475 | code: 'TZX', 476 | city: 'Trabzon', 477 | coordinates: { 478 | type: 'Point', 479 | coordinates: [39.7897, 40.9951], 480 | }, 481 | }, 482 | { 483 | name: 'Diyarbakır Havalimanı', 484 | number: 21, 485 | code: 'DIY', 486 | city: 'Diyarbakır', 487 | coordinates: { 488 | type: 'Point', 489 | coordinates: [40.201, 37.8939], 490 | }, 491 | }, 492 | { 493 | name: 'Mardin Havalimanı', 494 | number: 47, 495 | code: 'MQM', 496 | city: 'Mardin', 497 | coordinates: { 498 | type: 'Point', 499 | coordinates: [40.6319, 37.2234], 500 | }, 501 | }, 502 | { 503 | name: 'Bingöl Havalimanı', 504 | number: 12, 505 | code: 'BGG', 506 | city: 'Bingöl', 507 | coordinates: { 508 | type: 'Point', 509 | coordinates: [40.5941, 38.8602], 510 | }, 511 | }, 512 | { 513 | name: 'Erzurum Havalimanı', 514 | number: 25, 515 | code: 'ERZ', 516 | city: 'Erzurum', 517 | coordinates: { 518 | type: 'Point', 519 | coordinates: [41.1702, 39.9565], 520 | }, 521 | }, 522 | { 523 | name: 'Batman Havalimanı', 524 | number: 72, 525 | code: 'BAL', 526 | city: 'Batman', 527 | coordinates: { 528 | type: 'Point', 529 | coordinates: [41.1166, 37.929], 530 | }, 531 | }, 532 | { 533 | name: 'Muş Havalimanı', 534 | number: 49, 535 | code: 'MSR', 536 | city: 'Muş', 537 | coordinates: { 538 | type: 'Point', 539 | coordinates: [41.6612, 38.7478], 540 | }, 541 | }, 542 | { 543 | name: 'Siirt Havalimanı', 544 | number: 56, 545 | code: 'SXZ', 546 | city: 'Siirt', 547 | coordinates: { 548 | type: 'Point', 549 | coordinates: [41.8382, 37.9784], 550 | }, 551 | }, 552 | { 553 | name: 'Şırnak Şerafettin Elçi Havalimanı', 554 | number: 73, 555 | code: 'NKT', 556 | city: 'Şırnak', 557 | coordinates: { 558 | type: 'Point', 559 | coordinates: [42.0599, 37.3639], 560 | }, 561 | }, 562 | { 563 | name: 'Kars Havalimanı', 564 | number: 36, 565 | code: 'KSY', 566 | city: 'Kars', 567 | coordinates: { 568 | type: 'Point', 569 | coordinates: [43.115, 40.5622], 570 | }, 571 | }, 572 | { 573 | name: 'Ağrı Havalimanı', 574 | number: 4, 575 | code: 'AJI', 576 | city: 'Ağrı', 577 | coordinates: { 578 | type: 'Point', 579 | coordinates: [43.026, 39.6545], 580 | }, 581 | }, 582 | { 583 | name: 'Van Ferit Melen Havalimanı', 584 | number: 65, 585 | code: 'VAN', 586 | city: 'Van', 587 | coordinates: { 588 | type: 'Point', 589 | coordinates: [43.3323, 38.4682], 590 | }, 591 | }, 592 | { 593 | name: 'Iğdır Havalimanı', 594 | number: 76, 595 | code: 'IGD', 596 | city: 'Iğdır', 597 | coordinates: { 598 | type: 'Point', 599 | coordinates: [43.8794, 39.975], 600 | }, 601 | }, 602 | { 603 | name: 'Hakkari Yüksekova Havalimanı', 604 | number: 30, 605 | code: 'YKO', 606 | city: 'Hakkari', 607 | coordinates: { 608 | type: 'Point', 609 | coordinates: [44.2377, 37.5501], 610 | }, 611 | }, 612 | { 613 | name: 'Ercan Havalimanı', 614 | number: 82, 615 | code: 'ECN', 616 | city: 'KKTC', 617 | coordinates: { 618 | type: 'Point', 619 | coordinates: [33.4961, 35.1547], 620 | }, 621 | }, 622 | ]; 623 | -------------------------------------------------------------------------------- /src/db/locations/geojsons/filistin.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'Filistin', 3 | number: 970, 4 | coordinates: { 5 | type: 'MultiPolygon', 6 | coordinates: [ 7 | [ 8 | [ 9 | [34.37203276, 31.3724097], 10 | [34.37143588, 31.36969495], 11 | [34.37046313, 31.36899233], 12 | [34.36808825, 31.36989355], 13 | [34.36741543, 31.36972177], 14 | [34.36685693, 31.36929274], 15 | [34.36597717, 31.36741507], 16 | [34.36518955, 31.36162162], 17 | [34.37337363, 31.30884326], 18 | [34.36939704, 31.29636884], 19 | [34.36825454, 31.29381525], 20 | [34.36456347, 31.28983486], 21 | [34.34383631, 31.27949226], 22 | [34.33084404, 31.26156175], 23 | [34.32587123, 31.25706124], 24 | [34.32205975, 31.25490177], 25 | [34.29124165, 31.24082565], 26 | [34.28543091, 31.23402893], 27 | [34.26730967, 31.21941078], 28 | [34.24022293, 31.29609525], 29 | [34.2354238, 31.29660475], 30 | [34.21707654, 31.32439351], 31 | [34.2172811, 31.32477665], 32 | [34.2237277, 31.32954097], 33 | [34.24420464, 31.34650004], 34 | [34.26099324, 31.36053574], 35 | [34.29659104, 31.39301026], 36 | [34.29867065, 31.39481211], 37 | [34.32452345, 31.416049], 38 | [34.33196175, 31.4206624], 39 | [34.33430028, 31.42278671], 40 | [34.35263145, 31.44106865], 41 | [34.35421741, 31.44405675], 42 | [34.37380314, 31.46484375], 43 | [34.37398255, 31.46484375], 44 | [34.37541425, 31.46652555], 45 | [34.41807437, 31.50827396], 46 | [34.42973173, 31.52138984], 47 | [34.42935133, 31.5237236], 48 | [34.4337815, 31.52509677], 49 | [34.45258546, 31.54576433], 50 | [34.45306158, 31.54664028], 51 | [34.45957661, 31.55372143], 52 | [34.46453452, 31.56211722], 53 | [34.48596442, 31.58976304], 54 | [34.49053574, 31.59622431], 55 | [34.50113332, 31.58800006], 56 | [34.53233194, 31.56699824], 57 | [34.55801463, 31.54736447], 58 | [34.56821096, 31.54092717], 59 | [34.56640828, 31.53320253], 60 | [34.55404377, 31.52056932], 61 | [34.55442142, 31.51727021], 62 | [34.55074024, 31.51598275], 63 | [34.54736316, 31.51239395], 64 | [34.53101575, 31.50648773], 65 | [34.52497637, 31.50302756], 66 | [34.51600444, 31.50139213], 67 | [34.51020312, 31.49951935], 68 | [34.48651755, 31.48085105], 69 | [34.47839344, 31.47239685], 70 | [34.47406316, 31.47132385], 71 | [34.44704282, 31.44512415], 72 | [34.43738496, 31.4409399], 73 | [34.42682672, 31.42689586], 74 | [34.42630923, 31.42668188], 75 | [34.42499507, 31.42656624], 76 | [34.42398834, 31.42601335], 77 | [34.41037714, 31.41519058], 78 | [34.40200484, 31.41049135], 79 | [34.39461255, 31.40334594], 80 | [34.38360047, 31.39201641], 81 | [34.38126242, 31.38931274], 82 | [34.38068485, 31.38836324], 83 | [34.38102424, 31.38686645], 84 | [34.37855375, 31.38525045], 85 | [34.37362945, 31.37777925], 86 | [34.37345362, 31.37394905], 87 | [34.37203276, 31.3724097], 88 | ], 89 | ], 90 | [ 91 | [ 92 | [35.23718393, 32.53627884], 93 | [35.2525984, 32.52313614], 94 | [35.27477086, 32.51532555], 95 | [35.29472208, 32.50991821], 96 | [35.3019495, 32.50991821], 97 | [35.32117415, 32.51275063], 98 | [35.34142256, 32.51881945], 99 | [35.34985948, 32.51806128], 100 | [35.35534167, 32.51899076], 101 | [35.35638666, 32.51884592], 102 | [35.36673093, 32.51660085], 103 | [35.36881125, 32.51472998], 104 | [35.37279296, 32.51421106], 105 | [35.38574326, 32.50502574], 106 | [35.40218604, 32.50137258], 107 | [35.40371263, 32.49932075], 108 | [35.4041419, 32.49843562], 109 | [35.40671432, 32.48302627], 110 | [35.40697432, 32.48243415], 111 | [35.40967107, 32.47658896], 112 | [35.41563535, 32.46863365], 113 | [35.41610956, 32.46777785], 114 | [35.41677725, 32.46476054], 115 | [35.42021072, 32.46122003], 116 | [35.42001987, 32.45844376], 117 | [35.4176023, 32.45637417], 118 | [35.41137505, 32.43627536], 119 | [35.41286194, 32.42777824], 120 | [35.41846704, 32.41821885], 121 | [35.42899072, 32.40885246], 122 | [35.43896985, 32.40695262], 123 | [35.44319105, 32.40614891], 124 | [35.44547844, 32.40952837], 125 | [35.45195377, 32.41215706], 126 | [35.45510554, 32.41275775], 127 | [35.45688474, 32.41271496], 128 | [35.47768891, 32.41159916], 129 | [35.47959483, 32.41117001], 130 | [35.50288415, 32.39919662], 131 | [35.53294301, 32.39155757], 132 | [35.53782213, 32.38786685], 133 | [35.54280293, 32.38623607], 134 | [35.54656374, 32.38803864], 135 | [35.55357623, 32.3879528], 136 | [35.55509448, 32.38911414], 137 | [35.55647182, 32.38743782], 138 | [35.55794537, 32.38632202], 139 | [35.56251884, 32.38464832], 140 | [35.56325364, 32.38314617], 141 | [35.56284702, 32.38160133], 142 | [35.56231546, 32.38100052], 143 | [35.55911422, 32.37958431], 144 | [35.55987644, 32.37782466], 145 | [35.56277287, 32.37623692], 146 | [35.56368756, 32.37439156], 147 | [35.56376183, 32.37241745], 148 | [35.56363738, 32.36932755], 149 | [35.56091595, 32.36374855], 150 | [35.55685043, 32.36666667], 151 | [35.55298805, 32.36649513], 152 | [35.55408621, 32.36495006], 153 | [35.55418766, 32.35898495], 154 | [35.55657566, 32.35722542], 155 | [35.55512261, 32.35499382], 156 | [35.55840385, 32.34915733], 157 | [35.55510223, 32.34310615], 158 | [35.55754888, 32.33224857], 159 | [35.55535674, 32.32945907], 160 | [35.55383325, 32.32220638], 161 | [35.56008804, 32.31808662], 162 | [35.56343973, 32.30873096], 163 | [35.55972445, 32.30521202], 164 | [35.55998635, 32.30315196], 165 | [35.55637336, 32.30117786], 166 | [35.55540884, 32.29903221], 167 | [35.55566263, 32.29791641], 168 | [35.56200826, 32.29508388], 169 | [35.56741035, 32.28547084], 170 | [35.56284285, 32.27457035], 171 | [35.55810094, 32.27298248], 172 | [35.55959487, 32.26444244], 173 | [35.56424224, 32.26216793], 174 | [35.56251681, 32.25156784], 175 | [35.56500316, 32.24942195], 176 | [35.56972206, 32.25152493], 177 | [35.57119358, 32.24925041], 178 | [35.56774306, 32.24174023], 179 | [35.56322718, 32.24255562], 180 | [35.56129897, 32.24186885], 181 | [35.56091428, 32.24101055], 182 | [35.56277061, 32.23882186], 183 | [35.56314743, 32.23671913], 184 | [35.56223392, 32.23114014], 185 | [35.56335044, 32.22925174], 186 | [35.56527877, 32.22805023], 187 | [35.57011974, 32.22955215], 188 | [35.57199657, 32.22890854], 189 | [35.57225025, 32.22835064], 190 | [35.57174301, 32.22744942], 191 | [35.56651807, 32.22440243], 192 | [35.56768477, 32.22169864], 193 | [35.56477153, 32.21912384], 194 | [35.56578577, 32.21749306], 195 | [35.56925738, 32.21599102], 196 | [35.56913316, 32.21311557], 197 | [35.57177055, 32.21328735], 198 | [35.57349503, 32.21260071], 199 | [35.57387245, 32.21169937], 200 | [35.57379925, 32.21088398], 201 | [35.57258213, 32.20985413], 202 | [35.56809103, 32.21139896], 203 | [35.56702602, 32.20702171], 204 | [35.56286716, 32.20513344], 205 | [35.56243861, 32.20401764], 206 | [35.56499732, 32.20178604], 207 | [35.56507576, 32.20015526], 208 | [35.56677234, 32.19697952], 209 | [35.56956172, 32.19693661], 210 | [35.56991673, 32.19547737], 211 | [35.56565773, 32.18736637], 212 | [35.56444073, 32.18715191], 213 | [35.56101835, 32.18959796], 214 | [35.55866015, 32.18775272], 215 | [35.55921793, 32.18539226], 216 | [35.5624125, 32.18393326], 217 | [35.55896437, 32.17792511], 218 | [35.55939555, 32.17329025], 219 | [35.55675805, 32.17397678], 220 | [35.55475664, 32.17668045], 221 | [35.55361354, 32.17689514], 222 | [35.55313432, 32.17633724], 223 | [35.55232322, 32.17032897], 224 | [35.55627751, 32.17088687], 225 | [35.55784905, 32.16882706], 226 | [35.55724084, 32.16711044], 227 | [35.55401945, 32.16633785], 228 | [35.55151212, 32.16745365], 229 | [35.54862225, 32.16702461], 230 | [35.552019, 32.16367722], 231 | [35.55024457, 32.15981483], 232 | [35.55425036, 32.16037273], 233 | [35.55820405, 32.15844154], 234 | [35.55850816, 32.15582371], 235 | [35.5559231, 32.1527338], 236 | [35.55906558, 32.15075958], 237 | [35.55845737, 32.14797008], 238 | [35.55703831, 32.14436531], 239 | [35.55359173, 32.14389324], 240 | [35.55247664, 32.14578152], 241 | [35.55100691, 32.14595306], 242 | [35.54913163, 32.14153278], 243 | [35.54598916, 32.14312065], 244 | [35.54388988, 32.14033115], 245 | [35.54593861, 32.13535297], 246 | [35.55075264, 32.13380814], 247 | [35.54619193, 32.1306324], 248 | [35.55100596, 32.12882996], 249 | [35.55118835, 32.12805736], 250 | [35.5508033, 32.12694156], 251 | [35.54842186, 32.12531078], 252 | [35.54943526, 32.12247837], 253 | [35.54895842, 32.12144852], 254 | [35.54517925, 32.11853015], 255 | [35.54082215, 32.11084843], 256 | [35.53367853, 32.10767257], 257 | [35.53570545, 32.10020542], 258 | [35.53935206, 32.094841], 259 | [35.53925085, 32.09269524], 260 | [35.54310036, 32.09003437], 261 | [35.54328227, 32.08565712], 262 | [35.54541004, 32.08213794], 263 | [35.54064822, 32.08119392], 264 | [35.53752911, 32.07548606], 265 | [35.53487325, 32.07664478], 266 | [35.53337586, 32.07600105], 267 | [35.53347731, 32.07432735], 268 | [35.53629148, 32.07261086], 269 | [35.53464222, 32.06887722], 270 | [35.53084362, 32.06896305], 271 | [35.53140044, 32.06475735], 272 | [35.52876735, 32.0640707], 273 | [35.53112447, 32.05999374], 274 | [35.52988136, 32.05492973], 275 | [35.52831185, 32.05389965], 276 | [35.52983081, 32.04999435], 277 | [35.52805865, 32.04913604], 278 | [35.52375472, 32.05012322], 279 | [35.52213442, 32.04780567], 280 | [35.52026093, 32.04759121], 281 | [35.51866865, 32.04548836], 282 | [35.52150953, 32.04231262], 283 | [35.52150381, 32.04175472], 284 | [35.51861811, 32.03574646], 285 | [35.52080071, 32.03175545], 286 | [35.52039564, 32.02960956], 287 | [35.52292705, 32.02806473], 288 | [35.52162075, 32.02270031], 289 | [35.52480936, 32.01930988], 290 | [35.52778733, 32.01896656], 291 | [35.52738225, 32.01656342], 292 | [35.52222824, 32.01463223], 293 | [35.52268374, 32.01248646], 294 | [35.52343333, 32.01141346], 295 | [35.52464843, 32.01184273], 296 | [35.52658105, 32.01424587], 297 | [35.52759314, 32.00132835], 298 | [35.53493011, 31.99712265], 299 | [35.53589141, 31.99536324], 300 | [35.53568912, 31.98888302], 301 | [35.54595816, 31.96733952], 302 | [35.54221535, 31.96502197], 303 | [35.54459214, 31.96197498], 304 | [35.54165792, 31.95931435], 305 | [35.54317558, 31.95270526], 306 | [35.54145646, 31.95060253], 307 | [35.54307437, 31.94463718], 308 | [35.54347873, 31.93579674], 309 | [35.53614652, 31.92365158], 310 | [35.52795601, 31.92369461], 311 | [35.52603483, 31.92210674], 312 | [35.52684355, 31.91648483], 313 | [35.52426732, 31.9088459], 314 | [35.52578402, 31.90481186], 315 | [35.53205335, 31.8979454], 316 | [35.53536046, 31.88841808], 317 | [35.54156101, 31.88112247], 318 | [35.54701841, 31.86927795], 319 | [35.54701841, 31.86704636], 320 | [35.54247046, 31.85932148], 321 | [35.54732728, 31.82653415], 322 | [35.54662025, 31.82387352], 323 | [35.54242694, 31.82031155], 324 | [35.54318452, 31.81756485], 325 | [35.54060924, 31.81717873], 326 | [35.53995371, 31.81537616], 327 | [35.54126692, 31.81511867], 328 | [35.54136777, 31.81288707], 329 | [35.54429698, 31.81357384], 330 | [35.54333615, 31.80494785], 331 | [35.54744816, 31.79965854], 332 | [35.55142462, 31.79833877], 333 | [35.55116236, 31.79014206], 334 | [35.54750752, 31.78327024], 335 | [35.55146503, 31.77464962], 336 | [35.55615962, 31.77078724], 337 | [35.55308986, 31.76713943], 338 | [35.55757284, 31.76430702], 339 | [35.55851424, 31.76156116], 340 | [35.5591042, 31.75752628], 341 | [35.538715, 31.73079407], 342 | [35.53027344, 31.71972644], 343 | [35.51054263, 31.66534507], 344 | [35.50077474, 31.640625], 345 | [35.47753894, 31.57519531], 346 | [35.47553694, 31.5300585], 347 | [35.47708476, 31.49642944], 348 | [35.45533752, 31.48681641], 349 | [35.43197918, 31.47994995], 350 | [35.40378821, 31.46827686], 351 | [35.39884305, 31.46666121], 352 | [35.36960387, 31.45645356], 353 | [35.35626614, 31.45179737], 354 | [35.32421875, 31.4375], 355 | [35.29574847, 31.42175674], 356 | [35.23683441, 31.38021457], 357 | [35.23361695, 31.37506485], 358 | [35.20727491, 31.37111664], 359 | [35.18135965, 31.36248004], 360 | [35.15561152, 31.36133194], 361 | [35.04323804, 31.34946585], 362 | [35, 31.35020757], 363 | [34.99083555, 31.35051715], 364 | [34.96585524, 31.34646165], 365 | [34.95248544, 31.34631145], 366 | [34.93826306, 31.34330738], 367 | [34.93201637, 31.3399111], 368 | [34.91775382, 31.34468067], 369 | [34.91006517, 31.35102677], 370 | [34.91081905, 31.35392356], 371 | [34.90422368, 31.35971725], 372 | [34.89922595, 31.36178255], 373 | [34.89291322, 31.36888516], 374 | [34.88121665, 31.39009595], 375 | [34.88036633, 31.3921988], 376 | [34.88115156, 31.39875412], 377 | [34.89753914, 31.43371737], 378 | [34.89965296, 31.43724906], 379 | [34.90312326, 31.43978107], 380 | [34.92839253, 31.46801937], 381 | [34.94255281, 31.50037766], 382 | [34.94404125, 31.51090682], 383 | [34.94104588, 31.52295113], 384 | [34.94209552, 31.5290451], 385 | [34.94124174, 31.53822887], 386 | [34.94190156, 31.54887247], 387 | [34.94756103, 31.58275557], 388 | [34.95093346, 31.58964145], 389 | [34.95984423, 31.60203254], 390 | [34.96196985, 31.60504282], 391 | [34.97967768, 31.6207484], 392 | [34.9954648, 31.64405274], 393 | [35, 31.64775729], 394 | [35.00690055, 31.65264654], 395 | [35.02867866, 31.65926242], 396 | [35.03634667, 31.66442156], 397 | [35.06441832, 31.67818665], 398 | [35.07304203, 31.68272495], 399 | [35.08438897, 31.68948412], 400 | [35.08778524, 31.69653285], 401 | [35.09016931, 31.69701564], 402 | [35.10050166, 31.70657516], 403 | [35.10757482, 31.71529758], 404 | [35.11196518, 31.71497583], 405 | [35.11650622, 31.71227205], 406 | [35.11843586, 31.71207905], 407 | [35.12013876, 31.71343076], 408 | [35.12170947, 31.72012556], 409 | [35.12957907, 31.73134804], 410 | [35.13321197, 31.73409462], 411 | [35.13644135, 31.73418045], 412 | [35.13765252, 31.73014641], 413 | [35.13886344, 31.72903061], 414 | [35.14088178, 31.72945964], 415 | [35.15329456, 31.73812854], 416 | [35.15933073, 31.74432445], 417 | [35.16425681, 31.74231815], 418 | [35.17337275, 31.74173355], 419 | [35.17963028, 31.74276352], 420 | [35.18508065, 31.74671173], 421 | [35.18992531, 31.74568164], 422 | [35.19799972, 31.74825656], 423 | [35.19986522, 31.74799216], 424 | [35.20287585, 31.74534142], 425 | [35.20744586, 31.74824047], 426 | [35.20841098, 31.74809575], 427 | [35.20926273, 31.74761295], 428 | [35.21789253, 31.73419106], 429 | [35.22039056, 31.73375654], 430 | [35.22257495, 31.73404193], 431 | [35.22703326, 31.74495745], 432 | [35.22510302, 31.74428165], 433 | [35.22374034, 31.74505413], 434 | [35.22538686, 31.74944747], 435 | [35.22408104, 31.75060618], 436 | [35.22476077, 31.75765514], 437 | [35.22862208, 31.75924826], 438 | [35.22889435, 31.77334595], 439 | [35.22769284, 31.7732079], 440 | [35.22622466, 31.77464962], 441 | [35.22571361, 31.77600145], 442 | [35.22491837, 31.77918792], 443 | [35.22667921, 31.77986383], 444 | [35.22633827, 31.78874731], 445 | [35.22033966, 31.79778671], 446 | [35.22163165, 31.79837644], 447 | [35.21580148, 31.80404663], 448 | [35.21317554, 31.80473316], 449 | [35.18772232, 31.80893886], 450 | [35.17565262, 31.80662656], 451 | [35.13752246, 31.81529045], 452 | [35.11487615, 31.82447433], 453 | [35.10737562, 31.82273614], 454 | [35.09800863, 31.8255794], 455 | [35.08453405, 31.83625984], 456 | [35.07419157, 31.84167707], 457 | [35.05674994, 31.85118914], 458 | [35.05008125, 31.83484375], 459 | [35.04258025, 31.82504833], 460 | [35.03587317, 31.81983936], 461 | [35.0304718, 31.81735027], 462 | [35.02011871, 31.81670666], 463 | [35.00698781, 31.81747913], 464 | [35, 31.81566918], 465 | [34.99512017, 31.81700695], 466 | [34.97663677, 31.81614876], 467 | [34.97103107, 31.81842315], 468 | [34.96239126, 31.82653415], 469 | [34.95718956, 31.84309948], 470 | [34.95698035, 31.84731972], 471 | [34.95683634, 31.86035144], 472 | [34.95941341, 31.86202514], 473 | [35, 31.87017405], 474 | [35.02621925, 31.86975002], 475 | [35.02596605, 31.88086498], 476 | [35.02389383, 31.88618648], 477 | [35.02677476, 31.89240932], 478 | [35.02226245, 31.90635681], 479 | [35.02206016, 31.91099155], 480 | [35.01736736, 31.91896105], 481 | [35, 31.92630994], 482 | [34.99620354, 31.92914486], 483 | [34.99117517, 31.94971204], 484 | [34.97990584, 31.96641684], 485 | [34.98741877, 31.96593404], 486 | [34.98684955, 31.96998954], 487 | [34.99412322, 31.97259665], 488 | [34.99616575, 31.97975457], 489 | [35, 32.01493454], 490 | [35.00014544, 32.01673496], 491 | [35.00222027, 32.01923478], 492 | [35.00529921, 32.02097285], 493 | [35.00381875, 32.03912616], 494 | [35, 32.04645932], 495 | [34.99667025, 32.05285347], 496 | [34.98923361, 32.0721817], 497 | [34.98602784, 32.08936918], 498 | [34.98336685, 32.09027052], 499 | [34.98590481, 32.09827423], 500 | [34.98955047, 32.10119236], 501 | [34.99258876, 32.10617065], 502 | [34.99335778, 32.11080551], 503 | [34.98904645, 32.11601973], 504 | [34.98904645, 32.11880922], 505 | [34.98423254, 32.12406635], 506 | [34.98444235, 32.13312137], 507 | [34.98603165, 32.13620055], 508 | [34.98906565, 32.13844287], 509 | [34.98944688, 32.14442432], 510 | [34.98590314, 32.14865685], 511 | [34.97998381, 32.14852798], 512 | [34.97302711, 32.15055585], 513 | [34.97687864, 32.15809822], 514 | [34.97393453, 32.16243255], 515 | [34.97018766, 32.16453552], 516 | [34.96759784, 32.16959476], 517 | [34.95993507, 32.17466354], 518 | [34.95755875, 32.19042778], 519 | [34.96409297, 32.19946861], 520 | [34.97423434, 32.20109928], 521 | [34.98386836, 32.20573425], 522 | [34.98803878, 32.20606124], 523 | [34.99007046, 32.20727921], 524 | [34.99188685, 32.21320152], 525 | [35, 32.21952426], 526 | [35.01174426, 32.22942352], 527 | [35.01357114, 32.23268497], 528 | [35.01968276, 32.23337173], 529 | [35.02027547, 32.23886478], 530 | [35.02067506, 32.24246967], 531 | [35.02290785, 32.24650383], 532 | [35.02199435, 32.25603104], 533 | [35.02473462, 32.25877762], 534 | [35.02675784, 32.26633072], 535 | [35.02699018, 32.26993561], 536 | [35.01944935, 32.27808952], 537 | [35.01609981, 32.28014934], 538 | [35.00899613, 32.28212345], 539 | [35.01305747, 32.29216576], 540 | [35.01326072, 32.30993271], 541 | [35.01600397, 32.31980324], 542 | [35.01580095, 32.33911514], 543 | [35.02169168, 32.34160423], 544 | [35.02676988, 32.33980167], 545 | [35.02839434, 32.34675395], 546 | [35.03824985, 32.34572411], 547 | [35.0407896, 32.34735477], 548 | [35.04211032, 32.34984386], 549 | [35.04049385, 32.35559463], 550 | [35.04120541, 32.35705376], 551 | [35.04811621, 32.36083031], 552 | [35.0507586, 32.36357677], 553 | [35.05157161, 32.36615181], 554 | [35.04870927, 32.37524974], 555 | [35.04657555, 32.37692344], 556 | [35.04200315, 32.37808216], 557 | [35.04002202, 32.3803997], 558 | [35.04099941, 32.38327503], 559 | [35.05320001, 32.40288734], 560 | [35.05441332, 32.41215706], 561 | [35.05269563, 32.41524768], 562 | [35.05360663, 32.41816521], 563 | [35.05624974, 32.41971016], 564 | [35.05655456, 32.42288578], 565 | [35.06437302, 32.4359858], 566 | [35.06437945, 32.44039536], 567 | [35.0657016, 32.44202614], 568 | [35.06539655, 32.44966495], 569 | [35.07535696, 32.45616674], 570 | [35.07495701, 32.46090877], 571 | [35.08105946, 32.46768951], 572 | [35.09814894, 32.47764576], 573 | [35.10343885, 32.47764576], 574 | [35.10761273, 32.47567165], 575 | [35.11564624, 32.4799633], 576 | [35.12020254, 32.48020995], 577 | [35.1403656, 32.49309528], 578 | [35.13853431, 32.49472606], 579 | [35.13924634, 32.49584186], 580 | [35.14474022, 32.49549866], 581 | [35.15267265, 32.50073433], 582 | [35.15625, 32.50185013], 583 | [35.16952205, 32.51357007], 584 | [35.17647803, 32.51755714], 585 | [35.1801424, 32.52450943], 586 | [35.18810618, 32.52408302], 587 | [35.20037544, 32.53892744], 588 | [35.21149194, 32.54467964], 589 | [35.21668458, 32.54905701], 590 | [35.2246536, 32.55297828], 591 | [35.23718393, 32.53627884], 592 | ], 593 | ], 594 | ], 595 | }, 596 | }; 597 | -------------------------------------------------------------------------------- /src/db/locations/geojsons/index.js: -------------------------------------------------------------------------------- 1 | const adriyatikDenizi = require('./adriyatik-denizi'); 2 | const arnavutluk = require('./arnavutluk'); 3 | const azerbaycan = require('./azerbaycan'); 4 | const bosnaHersek = require('./bosna-hersek'); 5 | const bulgaristan = require('./bulgaristan'); 6 | const ermenistan = require('./ermenistan'); 7 | const filistin = require('./filistin'); 8 | const gurcistan = require('./gurcistan'); 9 | const hirvatistan = require('./hirvatistan'); 10 | const irak = require('./irak'); 11 | const iran = require('./iran'); 12 | const israil = require('./israil'); 13 | const libya = require('./libya'); 14 | const lubnan = require('./lubnan'); 15 | const makedonya = require('./makedonya'); 16 | const misir = require('./misir'); 17 | const montenegro = require('./montenegro'); 18 | const rusya = require('./rusya'); 19 | const sirbistan = require('./sirbistan'); 20 | const suriye = require('./suriye'); 21 | const urdun = require('./urdun'); 22 | const yunanistan = require('./yunanistan'); 23 | const mixedLocations = require('./mixed-locations'); 24 | const kibris = require('./kibris'); 25 | 26 | module.exports = [ 27 | kibris, 28 | adriyatikDenizi, 29 | arnavutluk, 30 | azerbaycan, 31 | bosnaHersek, 32 | bulgaristan, 33 | ermenistan, 34 | filistin, 35 | gurcistan, 36 | hirvatistan, 37 | irak, 38 | iran, 39 | israil, 40 | libya, 41 | lubnan, 42 | makedonya, 43 | misir, 44 | montenegro, 45 | rusya, 46 | sirbistan, 47 | suriye, 48 | urdun, 49 | yunanistan, 50 | ...mixedLocations, 51 | ]; 52 | -------------------------------------------------------------------------------- /src/db/locations/geojsons/makedonya.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'Makedonya', 3 | number: 389, 4 | coordinates: { 5 | type: 'MultiPolygon', 6 | coordinates: [ 7 | [ 8 | [ 9 | [21.90212548, 42.29496002], 10 | [21.91790783, 42.29204166], 11 | [21.93509448, 42.29204166], 12 | [21.94995201, 42.29393005], 13 | [21.97247005, 42.30113983], 14 | [21.99359536, 42.30852115], 15 | [22.00009561, 42.30817795], 16 | [22.02283347, 42.29461658], 17 | [22.03722095, 42.29118335], 18 | [22.05392885, 42.2923851], 19 | [22.06669176, 42.29410172], 20 | [22.08270347, 42.29822147], 21 | [22.13747907, 42.29650486], 22 | [22.15929651, 42.29787815], 23 | [22.18575573, 42.30096805], 24 | [22.20919764, 42.30611801], 25 | [22.24056494, 42.3150444], 26 | [22.25566387, 42.31761932], 27 | [22.26890457, 42.32208252], 28 | [22.29143691, 42.3399353], 29 | [22.29701185, 42.34920502], 30 | [22.30189002, 42.35263824], 31 | [22.30839407, 42.35401154], 32 | [22.31722117, 42.35109317], 33 | [22.34622014, 42.33324051], 34 | [22.36873448, 42.32105255], 35 | [22.36643815, 42.31693256], 36 | [22.36829555, 42.31384265], 37 | [22.383852, 42.30508804], 38 | [22.38988876, 42.29616165], 39 | [22.3984797, 42.29341495], 40 | [22.40567744, 42.27951038], 41 | [22.41426826, 42.26835251], 42 | [22.42358041, 42.26200104], 43 | [22.42682648, 42.25650775], 44 | [22.43285525, 42.25530624], 45 | [22.437029, 42.25307465], 46 | [22.44004333, 42.24758136], 47 | [22.45001376, 42.24071503], 48 | [22.45117331, 42.23470676], 49 | [22.46485364, 42.21273422], 50 | [22.46833181, 42.20123291], 51 | [22.48502672, 42.20088947], 52 | [22.49662042, 42.19831455], 53 | [22.50311267, 42.19247806], 54 | [22.50404024, 42.19007492], 55 | [22.50310397, 42.18509674], 56 | [22.50634551, 42.1701622], 57 | [22.51398611, 42.15951908], 58 | [22.51745915, 42.15745926], 59 | [22.51769066, 42.15333927], 60 | [22.52000594, 42.14921951], 61 | [22.52926743, 42.13994968], 62 | [22.55172622, 42.13205326], 63 | [22.57396066, 42.11351395], 64 | [22.57882047, 42.11042404], 65 | [22.5859946, 42.10853565], 66 | [22.59016013, 42.10922241], 67 | [22.60011113, 42.09995258], 68 | [22.60728514, 42.09651935], 69 | [22.61584771, 42.09634781], 70 | [22.63042712, 42.09342945], 71 | [22.64616501, 42.08261478], 72 | [22.65749562, 42.07437515], 73 | [22.67483854, 42.06630695], 74 | [22.68385673, 42.06459045], 75 | [22.69865584, 42.06441867], 76 | [22.71807814, 42.068367], 77 | [22.72570956, 42.06064224], 78 | [22.73403502, 42.04914093], 79 | [22.73819757, 42.04656601], 80 | [22.75369203, 42.04622257], 81 | [22.75947344, 42.04278946], 82 | [22.77843666, 42.03763962], 83 | [22.78745592, 42.03746796], 84 | [22.79346848, 42.03969955], 85 | [22.80040646, 42.04742432], 86 | [22.81545651, 42.02957153], 87 | [22.82493126, 42.02339172], 88 | [22.83186412, 42.02201843], 89 | [22.85243154, 42.02373505], 90 | [22.8649106, 42.0230484], 91 | [22.86791468, 42.02098835], 92 | [22.86883915, 42.01618195], 93 | [22.86583495, 42.00124741], 94 | [22.87530982, 41.99129105], 95 | [22.87623405, 41.98219287], 96 | [22.87526715, 41.93996418], 97 | [22.87988222, 41.92365634], 98 | [22.88380504, 41.92039478], 99 | [22.88934314, 41.91284168], 100 | [22.89326584, 41.90580356], 101 | [22.89718866, 41.89619064], 102 | [22.90178752, 41.88228595], 103 | [22.9061681, 41.87799454], 104 | [22.91631246, 41.87507617], 105 | [22.92645693, 41.86254501], 106 | [22.93337774, 41.84743881], 107 | [22.93729377, 41.84194565], 108 | [22.94028842, 41.82254791], 109 | [22.94466496, 41.81001663], 110 | [22.94858086, 41.80366504], 111 | [22.96309304, 41.78890216], 112 | [22.96424472, 41.78546905], 113 | [22.96355355, 41.77602756], 114 | [22.97069454, 41.77104938], 115 | [23.00688934, 41.76864624], 116 | [23.01126182, 41.76315296], 117 | [23.01724505, 41.75250995], 118 | [23.03174305, 41.72521591], 119 | [23.03243351, 41.72178257], 120 | [23.03151286, 41.71096802], 121 | [23.02921176, 41.70633304], 122 | [23.01331902, 41.69242847], 123 | [23.00527406, 41.68453205], 124 | [22.99607992, 41.67337406], 125 | [22.99194253, 41.66788101], 126 | [22.98872447, 41.66273105], 127 | [22.98251855, 41.64865494], 128 | [22.96757805, 41.64865494], 129 | [22.95838392, 41.646595], 130 | [22.95033884, 41.63595188], 131 | [22.95010912, 41.63028705], 132 | [22.95286727, 41.62462234], 133 | [22.95128202, 41.6043663], 134 | [22.9515115, 41.5945816], 135 | [22.95334744, 41.58891666], 136 | [22.96964133, 41.57278061], 137 | [22.97423112, 41.56488407], 138 | [22.96918225, 41.54462814], 139 | [22.96115005, 41.53535843], 140 | [22.96092057, 41.52935016], 141 | [22.96296656, 41.52558172], 142 | [22.96964753, 41.5145874], 143 | [22.97079325, 41.50943744], 144 | [22.96758485, 41.50291443], 145 | [22.96231413, 41.49742115], 146 | [22.96139741, 41.49295795], 147 | [22.96185565, 41.48523331], 148 | [22.97583485, 41.45124435], 149 | [22.97629332, 41.4421463], 150 | [22.97262657, 41.4345932], 151 | [22.96138883, 41.41845703], 152 | [22.96276164, 41.40832901], 153 | [22.96596491, 41.39923096], 154 | [22.9668802, 41.37948978], 155 | [22.97031224, 41.36421204], 156 | [22.96733773, 41.35871875], 157 | [22.95063496, 41.34962082], 158 | [22.93530476, 41.33794785], 159 | [22.92431843, 41.33914936], 160 | [22.91700125, 41.3403511], 161 | [22.91082764, 41.34069443], 162 | [22.90442514, 41.34000766], 163 | [22.89870882, 41.33880615], 164 | [22.89413548, 41.33897781], 165 | [22.88933384, 41.3403511], 166 | [22.88453186, 41.34138095], 167 | [22.87995875, 41.34086597], 168 | [22.8756144, 41.34052265], 169 | [22.87035525, 41.34052265], 170 | [22.86623943, 41.3403511], 171 | [22.86258078, 41.33914936], 172 | [22.85869372, 41.33846283], 173 | [22.85435295, 41.33897781], 174 | [22.84726405, 41.33897781], 175 | [22.84108984, 41.33708954], 176 | [22.83308637, 41.33708954], 177 | [22.82668364, 41.33674622], 178 | [22.81707942, 41.33708954], 179 | [22.80930448, 41.33657455], 180 | [22.80038643, 41.33451462], 181 | [22.79604173, 41.33176804], 182 | [22.79123962, 41.32970798], 183 | [22.78437936, 41.32799137], 184 | [22.77889132, 41.32661808], 185 | [22.77363193, 41.32610321], 186 | [22.76745784, 41.32387161], 187 | [22.76196957, 41.31820667], 188 | [22.75762475, 41.31116855], 189 | [22.75533807, 41.30567551], 190 | [22.75602424, 41.30018234], 191 | [22.76219833, 41.29606235], 192 | [22.76242685, 41.29142761], 193 | [22.76220608, 41.28679276], 194 | [22.75877964, 41.28164291], 195 | [22.7569524, 41.27580643], 196 | [22.75763762, 41.27168655], 197 | [22.75946498, 41.26859665], 198 | [22.76083565, 41.26276004], 199 | [22.75992191, 41.25640857], 200 | [22.75803995, 41.24441683], 201 | [22.75149024, 41.19973505], 202 | [22.74813366, 41.17683744], 203 | [22.74710941, 41.16371155], 204 | [22.74255073, 41.15942001], 205 | [22.74004352, 41.15615845], 206 | [22.73708034, 41.15135193], 207 | [22.73366118, 41.14843357], 208 | [22.72773504, 41.1456871], 209 | [22.71816182, 41.14156723], 210 | [22.71314716, 41.14019394], 211 | [22.71041203, 41.1403656], 212 | [22.69605207, 41.15358353], 213 | [22.69103765, 41.15735996], 214 | [22.68693483, 41.16010666], 215 | [22.68328786, 41.16422653], 216 | [22.6805526, 41.16868973], 217 | [22.67531013, 41.17521274], 218 | [22.67211902, 41.17898941], 219 | [22.66869998, 41.18225086], 220 | [22.66642034, 41.18534076], 221 | [22.66482461, 41.18654251], 222 | [22.65228653, 41.18499756], 223 | [22.64635932, 41.18328094], 224 | [22.64453554, 41.18207932], 225 | [22.64430761, 41.17675781], 226 | [22.64385176, 41.16937625], 227 | [22.63906443, 41.15701675], 228 | [22.63154161, 41.14894855], 229 | [22.62265074, 41.1403656], 230 | [22.61649585, 41.13367081], 231 | [22.61169875, 41.12989426], 232 | [22.59688735, 41.12234116], 233 | [22.59027934, 41.11976624], 234 | [22.57524014, 41.12113953], 235 | [22.56680906, 41.12697601], 236 | [22.55883384, 41.13178253], 237 | [22.54607332, 41.13143921], 238 | [22.52146423, 41.13040924], 239 | [22.50710762, 41.13006592], 240 | [22.49890375, 41.12920761], 241 | [22.48545885, 41.12285614], 242 | [22.47213554, 41.12138736], 243 | [22.46677256, 41.1207962], 244 | [22.46061981, 41.12062454], 245 | [22.42119575, 41.12165451], 246 | [22.41162491, 41.12474442], 247 | [22.40364921, 41.13006592], 248 | [22.40000308, 41.13418567], 249 | [22.39681292, 41.1359024], 250 | [22.39111602, 41.13418567], 251 | [22.38747001, 41.13195407], 252 | [22.37516463, 41.13693225], 253 | [22.36992335, 41.13864887], 254 | [22.36582172, 41.13504398], 255 | [22.3621757, 41.13367081], 256 | [22.35078192, 41.13573074], 257 | [22.34531093, 41.13470066], 258 | [22.33733547, 41.13109577], 259 | [22.33414555, 41.12680435], 260 | [22.33255041, 41.12062454], 261 | [22.32708156, 41.1207962], 262 | [22.32343566, 41.12388611], 263 | [22.32571435, 41.13332736], 264 | [22.32503092, 41.13796234], 265 | [22.32184064, 41.14208221], 266 | [22.31887853, 41.14500046], 267 | [22.31659985, 41.14894855], 268 | [22.31044745, 41.14860535], 269 | [22.30383933, 41.14877701], 270 | [22.28720522, 41.15341175], 271 | [22.27786255, 41.15650165], 272 | [22.26510215, 41.16405475], 273 | [22.26031685, 41.16559982], 274 | [22.25484824, 41.16542804], 275 | [22.24915147, 41.16439807], 276 | [22.23890483, 41.16319644], 277 | [22.23001444, 41.16422653], 278 | [22.21975636, 41.16697311], 279 | [22.21610916, 41.16851795], 280 | [22.21132195, 41.16714466], 281 | [22.20562315, 41.16216648], 282 | [22.19445324, 41.1607933], 283 | [22.18670273, 41.1607933], 284 | [22.17895222, 41.15856171], 285 | [22.17393696, 41.15650165], 286 | [22.16983378, 41.15375507], 287 | [22.16664243, 41.15066516], 288 | [22.16345096, 41.14654541], 289 | [22.15775216, 41.14019394], 290 | [22.15430975, 41.13676071], 291 | [22.14975321, 41.13229752], 292 | [22.1442852, 41.12852085], 293 | [22.13836145, 41.12594605], 294 | [22.13061523, 41.12543094], 295 | [22.12241316, 41.12646103], 296 | [22.11535025, 41.13178253], 297 | [22.10965455, 41.1359024], 298 | [22.10076904, 41.13710403], 299 | [22.09393406, 41.1359024], 300 | [22.08755457, 41.13744736], 301 | [22.08299804, 41.14311206], 302 | [22.07980835, 41.14963531], 303 | [22.07661855, 41.15375507], 304 | [22.06249285, 41.16113663], 305 | [22.0561136, 41.15770328], 306 | [22.04813945, 41.14740372], 307 | [22.04198813, 41.14276874], 308 | [22.03492534, 41.13796234], 309 | [22.02376175, 41.13418567], 310 | [22.01328182, 41.13229752], 311 | [22.00280166, 41.12937915], 312 | [21.99277842, 41.12680435], 313 | [21.97546268, 41.12903595], 314 | [21.96908331, 41.12388611], 315 | [21.96133685, 41.11839294], 316 | [21.95518506, 41.11495972], 317 | [21.95085633, 41.11083984], 318 | [21.9387809, 41.10706317], 319 | [21.93354046, 41.10483158], 320 | [21.93057871, 41.10294342], 321 | [21.92670536, 41.09968185], 322 | [21.91030121, 41.09178543], 323 | [21.90916193, 41.08697891], 324 | [21.90779495, 41.08148575], 325 | [21.90597224, 41.07753754], 326 | [21.90460515, 41.073246], 327 | [21.90460515, 41.07015598], 328 | [21.90665567, 41.06620777], 329 | [21.90984535, 41.05916965], 330 | [21.91121244, 41.05350494], 331 | [21.91004658, 41.04904175], 332 | [21.90322125, 41.04372025], 333 | [21.89889872, 41.04183185], 334 | [21.88479316, 41.04045856], 335 | [21.88297307, 41.03925705], 336 | [21.88183546, 41.03239048], 337 | [21.88138056, 41.02775574], 338 | [21.87501025, 41.0256958], 339 | [21.86727512, 41.02157593], 340 | [21.85794723, 41.01625442], 341 | [21.85430706, 41.0136795], 342 | [21.84930193, 41.00921631], 343 | [21.84793675, 41.00595474], 344 | [21.84770918, 41.00063324], 345 | [21.84702682, 40.99840164], 346 | [21.84224915, 40.99617004], 347 | [21.83633375, 40.99496841], 348 | [21.83132875, 40.99308014], 349 | [21.82379866, 40.98930347], 350 | [21.81947815, 40.98793018], 351 | [21.81333852, 40.98484027], 352 | [21.80901802, 40.98140705], 353 | [21.80606175, 40.97934723], 354 | [21.80242348, 40.975914], 355 | [21.80128646, 40.96904755], 356 | [21.80105913, 40.9638977], 357 | [21.80174124, 40.95840454], 358 | [21.80401516, 40.95479965], 359 | [21.80515218, 40.95136642], 360 | [21.80424273, 40.94638824], 361 | [21.80174124, 40.94329834], 362 | [21.79560173, 40.93952167], 363 | [21.79150856, 40.93540192], 364 | [21.7903198, 40.9336071], 365 | [21.78923464, 40.93196857], 366 | [21.78627837, 40.92990875], 367 | [21.77922916, 40.92922211], 368 | [21.77127051, 40.92905045], 369 | [21.76672244, 40.92870712], 370 | [21.76171994, 40.92750537], 371 | [21.75717187, 40.92630374], 372 | [21.7523967, 40.92561722], 373 | [21.73170376, 40.93025196], 374 | [21.72806537, 40.93248355], 375 | [21.7201066, 40.93780506], 376 | [21.71419025, 40.94003665], 377 | [21.70828164, 40.94226825], 378 | [21.70214558, 40.94347], 379 | [21.69623685, 40.94347], 380 | [21.68964636, 40.94226825], 381 | [21.68396497, 40.94020844], 382 | [21.67623818, 40.93282688], 383 | [21.67078412, 40.92699051], 384 | [21.66828418, 40.91960895], 385 | [21.66760254, 40.91548908], 386 | [21.66987514, 40.90999603], 387 | [21.67146575, 40.90536106], 388 | [21.67146575, 40.90038288], 389 | [21.67078412, 40.89866626], 390 | [21.66146648, 40.89935303], 391 | [21.6546489, 40.90055466], 392 | [21.6473484, 40.90072632], 393 | [21.64008081, 40.89969635], 394 | [21.63462996, 40.89763641], 395 | [21.632586, 40.89454651], 396 | [21.62736237, 40.89094162], 397 | [21.61895931, 40.88853824], 398 | [21.61464405, 40.88407505], 399 | [21.61078322, 40.87978363], 400 | [21.60714936, 40.87978363], 401 | [21.60306144, 40.87909687], 402 | [21.60079014, 40.87532043], 403 | [21.59851921, 40.87068546], 404 | [21.59420395, 40.86965561], 405 | [21.58852625, 40.86982715], 406 | [21.58103144, 40.86982715], 407 | [21.57603502, 40.86948395], 408 | [21.57240117, 40.86948395], 409 | [21.56899452, 40.87034225], 410 | [21.56672335, 40.87308884], 411 | [21.56490648, 40.87720871], 412 | [21.56149983, 40.878582], 413 | [21.55809307, 40.87978363], 414 | [21.55241525, 40.88270175], 415 | [21.54832733, 40.88699341], 416 | [21.54446626, 40.89128494], 417 | [21.53992414, 40.89609134], 418 | [21.53516543, 40.90158463], 419 | [21.53266644, 40.90587604], 420 | [21.52834988, 40.9087944], 421 | [21.52039838, 40.90930927], 422 | [21.51017523, 40.90948105], 423 | [21.49768007, 40.91119754], 424 | [21.49131894, 40.91171265], 425 | [21.48359466, 40.91119754], 426 | [21.4760977, 40.90965271], 427 | [21.46655595, 40.90810776], 428 | [21.46133065, 40.9087944], 429 | [21.44088066, 40.91703415], 430 | [21.41839135, 40.91737735], 431 | [21.41566527, 40.91669083], 432 | [21.36909664, 40.88476181], 433 | [21.36091864, 40.88167191], 434 | [21.33978963, 40.87360382], 435 | [21.32616556, 40.87017047], 436 | [21.31549335, 40.86828232], 437 | [21.30413997, 40.86639404], 438 | [21.29255962, 40.86622226], 439 | [21.28188753, 40.86519241], 440 | [21.27098823, 40.86433411], 441 | [21.26417041, 40.86227405], 442 | [21.25894964, 40.85969925], 443 | [21.25032413, 40.86399066], 444 | [21.24464941, 40.87068546], 445 | [21.24147153, 40.87394714], 446 | [21.23466194, 40.87583542], 447 | [21.22785223, 40.87823856], 448 | [21.22013462, 40.88029861], 449 | [21.2126441, 40.88270175], 450 | [21.20833123, 40.88356006], 451 | [21.20492637, 40.88270175], 452 | [21.19879782, 40.87978363], 453 | [21.19153404, 40.87738025], 454 | [21.18449736, 40.87669373], 455 | [21.17882085, 40.87566376], 456 | [21.17314684, 40.87154377], 457 | [21.16928828, 40.86759555], 458 | [21.164976, 40.86502075], 459 | [21.16111755, 40.86244583], 460 | [21.15725923, 40.85935593], 461 | [21.15294683, 40.85660934], 462 | [21.13955593, 40.85557926], 463 | [21.12775362, 40.85472095], 464 | [21.1185652, 40.85472345], 465 | [21.09375, 40.85481763], 466 | [21.03742242, 40.85523605], 467 | [20.98555768, 40.85557926], 468 | [20.98510337, 40.88132846], 469 | [20.98271477, 40.89156711], 470 | [20.98215067, 40.89403152], 471 | [20.97579086, 40.89866626], 472 | [20.96943116, 40.9034729], 473 | [20.96534276, 40.90896595], 474 | [20.94898915, 40.91909397], 475 | [20.94081247, 40.92235565], 476 | [20.92468596, 40.92098224], 477 | [20.91173935, 40.91754913], 478 | [20.90561128, 40.91892242], 479 | [20.88744354, 40.9261322], 480 | [20.857921, 40.93780506], 481 | [20.84929133, 40.93969345], 482 | [20.84270537, 40.93214035], 483 | [20.8343029, 40.92338562], 484 | [20.82976091, 40.91531754], 485 | [20.82885253, 40.90913773], 486 | [20.82658148, 40.90467453], 487 | [20.81908727, 40.89935303], 488 | [20.81182015, 40.89712143], 489 | [20.79772866, 40.89918125], 490 | [20.78591752, 40.90364444], 491 | [20.77569616, 40.90433121], 492 | [20.75570774, 40.90415955], 493 | [20.73708236, 40.90930927], 494 | [20.73581648, 40.91248262], 495 | [20.71805656, 40.95700407], 496 | [20.71455348, 40.96578586], 497 | [20.67924464, 41.06792438], 498 | [20.67241132, 41.08594894], 499 | [20.63376868, 41.08872998], 500 | [20.63186467, 41.08886707], 501 | [20.61910832, 41.0905838], 502 | [20.59678471, 41.09264374], 503 | [20.59610116, 41.09779346], 504 | [20.59405124, 41.10105515], 505 | [20.58835626, 41.10654831], 506 | [20.58402157, 41.11118305], 507 | [20.58219743, 41.11616135], 508 | [20.59131885, 41.12697601], 509 | [20.59565151, 41.13092423], 510 | [20.59382725, 41.1359024], 511 | [20.58949447, 41.14585865], 512 | [20.58174133, 41.15804672], 513 | [20.56874335, 41.17435455], 514 | [20.56007802, 41.18482578], 515 | [20.55620134, 41.19306564], 516 | [20.55300891, 41.19478226], 517 | [20.5484482, 41.19718552], 518 | [20.53590608, 41.19855881], 519 | [20.53271365, 41.203022], 520 | [20.53180146, 41.20714176], 521 | [20.52835166, 41.21538162], 522 | [20.52332735, 41.22413635], 523 | [20.51830268, 41.22877121], 524 | [20.51556206, 41.23306274], 525 | [20.51510525, 41.2376976], 526 | [20.51703656, 41.24159014], 527 | [20.52012992, 41.24782562], 528 | [20.51647556, 41.25400543], 529 | [20.51396334, 41.26052845], 530 | [20.51190794, 41.26516342], 531 | [20.51190794, 41.27323151], 532 | [20.51351357, 41.28627765], 533 | [20.50916946, 41.29142761], 534 | [20.50779736, 41.29829395], 535 | [20.50779736, 41.30413055], 536 | [20.50596833, 41.30996704], 537 | [20.50162387, 41.3176918], 538 | [20.49590766, 41.33022296], 539 | [20.49247813, 41.33640277], 540 | [20.49384987, 41.33932114], 541 | [20.49682236, 41.34412765], 542 | [20.50025213, 41.34618747], 543 | [20.50551105, 41.34567261], 544 | [20.51351357, 41.34086597], 545 | [20.52128768, 41.33846283], 546 | [20.52677524, 41.34395587], 547 | [20.52677524, 41.34687424], 548 | [20.527004, 41.35253894], 549 | [20.52860451, 41.35545731], 550 | [20.53294885, 41.35803223], 551 | [20.53614986, 41.36060715], 552 | [20.53867221, 41.36489856], 553 | [20.54256225, 41.36901855], 554 | [20.54759657, 41.37330997], 555 | [20.54965615, 41.37966144], 556 | [20.54874074, 41.38498294], 557 | [20.55011392, 41.38824463], 558 | [20.5528599, 41.39562595], 559 | [20.55400395, 41.39923096], 560 | [20.55880952, 41.40317905], 561 | [20.56041133, 41.4074707], 562 | [20.55858064, 41.41313553], 563 | [20.55652106, 41.42034531], 564 | [20.55284536, 41.42498004], 565 | [20.54482746, 41.42892826], 566 | [20.53955865, 41.43270493], 567 | [20.54001665, 41.43854141], 568 | [20.53658044, 41.44042957], 569 | [20.51880503, 41.43819797], 570 | [20.51376343, 41.43854141], 571 | [20.50986755, 41.44128788], 572 | [20.50904834, 41.44504523], 573 | [20.50871336, 41.44790685], 574 | [20.51307595, 41.45124435], 575 | [20.51207161, 41.45536697], 576 | [20.51582575, 41.45708084], 577 | [20.51605487, 41.46223056], 578 | [20.51307595, 41.46635056], 579 | [20.51057804, 41.47074795], 580 | [20.51170087, 41.47785175], 581 | [20.50940931, 41.48317325], 582 | [20.50803435, 41.48832321], 583 | [20.50115955, 41.49879456], 584 | [20.49465823, 41.49930954], 585 | [20.48664033, 41.50136936], 586 | [20.48251665, 41.50377274], 587 | [20.47761881, 41.50548935], 588 | [20.47761881, 41.50660515], 589 | [20.47704542, 41.50797844], 590 | [20.47532547, 41.50823593], 591 | [20.47326148, 41.50857925], 592 | [20.47165632, 41.50926578], 593 | [20.46970713, 41.50926578], 594 | [20.46844566, 41.50840747], 595 | [20.46603775, 41.50772095], 596 | [20.46454716, 41.50849342], 597 | [20.46202481, 41.50909424], 598 | [20.46076345, 41.51021004], 599 | [20.45927274, 41.51098251], 600 | [20.45709431, 41.51149738], 601 | [20.45548904, 41.51329994], 602 | [20.4546864, 41.51415825], 603 | [20.45434225, 41.51518822], 604 | [20.45342505, 41.51784885], 605 | [20.45365441, 41.52033806], 606 | [20.45411313, 41.52205455], 607 | [20.45652103, 41.52462947], 608 | [20.45927274, 41.52643204], 609 | [20.45961678, 41.52754784], 610 | [20.46168065, 41.52900696], 611 | [20.46374464, 41.52892113], 612 | [20.46706975, 41.52866364], 613 | [20.46936297, 41.52917862], 614 | [20.47119772, 41.52995098], 615 | [20.47200024, 41.53132427], 616 | [20.47314692, 41.53252602], 617 | [20.47314692, 41.53415668], 618 | [20.47188556, 41.53587341], 619 | [20.47257364, 41.53767586], 620 | [20.47085357, 41.53990746], 621 | [20.46993625, 41.54188144], 622 | [20.46856046, 41.54291153], 623 | [20.46684051, 41.54325485], 624 | [20.46466196, 41.54368401], 625 | [20.46340072, 41.54462814], 626 | [20.46179545, 41.54531467], 627 | [20.46087813, 41.54617298], 628 | [20.45973134, 41.54754627], 629 | [20.45892811, 41.54994965], 630 | [20.45743644, 41.55072212], 631 | [20.45697761, 41.55158043], 632 | [20.45709217, 41.55252445], 633 | [20.45674813, 41.55338275], 634 | [20.45628905, 41.55492783], 635 | [20.45887363, 41.5568161], 636 | [20.46713126, 41.55784595], 637 | [20.47745371, 41.55733097], 638 | [20.48846388, 41.55904758], 639 | [20.49511611, 41.56127918], 640 | [20.51025546, 41.56471252], 641 | [20.52470696, 41.56866074], 642 | [20.53181827, 41.5719223], 643 | [20.54305887, 41.57638538], 644 | [20.55177605, 41.57981873], 645 | [20.55774415, 41.58164263], 646 | [20.55704117, 41.58524752], 647 | [20.55653918, 41.59080505], 648 | [20.55573595, 41.59313321], 649 | [20.55352688, 41.59696341], 650 | [20.55533433, 41.60056818], 651 | [20.55289495, 41.6043663], 652 | [20.54875958, 41.60728455], 653 | [20.54669201, 41.61106098], 654 | [20.54661155, 41.61401153], 655 | [20.54500401, 41.61671507], 656 | [20.54249215, 41.61874294], 657 | [20.54118598, 41.62047017], 658 | [20.54319537, 41.62227273], 659 | [20.54339635, 41.62399995], 660 | [20.53837275, 41.62813055], 661 | [20.53336716, 41.63251865], 662 | [20.52521086, 41.63789392], 663 | [20.52601564, 41.64093006], 664 | [20.5270195, 41.64450276], 665 | [20.52691901, 41.64818275], 666 | [20.52662301, 41.65156245], 667 | [20.52541661, 41.65374041], 668 | [20.51928365, 41.65787101], 669 | [20.51707184, 41.66004884], 670 | [20.51677024, 41.6617763], 671 | [20.51787615, 41.66327834], 672 | [20.51898205, 41.66463006], 673 | [20.52079177, 41.66628242], 674 | [20.52179706, 41.66853535], 675 | [20.5235064, 41.67116404], 676 | [20.52451158, 41.67326677], 677 | [20.52579403, 41.67783725], 678 | [20.52732682, 41.68152797], 679 | [20.52893531, 41.68528306], 680 | [20.52943802, 41.68828726], 681 | [20.52823842, 41.69579744], 682 | [20.52753413, 41.69970274], 683 | [20.52733302, 41.70548546], 684 | [20.52401304, 41.70826435], 685 | [20.52179956, 41.71096802], 686 | [20.51858032, 41.71532392], 687 | [20.51576316, 41.72125685], 688 | [20.51465654, 41.72478676], 689 | [20.51435483, 41.72688961], 690 | [20.51536095, 41.73169613], 691 | [20.51666868, 41.73289776], 692 | [20.51898408, 41.73515081], 693 | [20.51898408, 41.73770416], 694 | [20.51958823, 41.73950672], 695 | [20.51968884, 41.74303651], 696 | [20.51978958, 41.74701691], 697 | [20.52039373, 41.74919474], 698 | [20.52160192, 41.75159812], 699 | [20.5241189, 41.75467718], 700 | [20.52603185, 41.75662994], 701 | [20.52724004, 41.75760615], 702 | [20.52774346, 41.76076055], 703 | [20.52844822, 41.76241267], 704 | [20.53005922, 41.76376462], 705 | [20.53136802, 41.76504135], 706 | [20.53378427, 41.76691878], 707 | [20.53418696, 41.76954734], 708 | [20.53408885, 41.77156436], 709 | [20.53277755, 41.77427876], 710 | [20.53177071, 41.77585602], 711 | [20.53197205, 41.77690744], 712 | [20.53339851, 41.77808762], 713 | [20.53489184, 41.77833426], 714 | [20.53740895, 41.77901018], 715 | [20.54123485, 41.77946091], 716 | [20.54355037, 41.77953601], 717 | [20.54465795, 41.78006172], 718 | [20.54556406, 41.78126335], 719 | [20.54657078, 41.78306568], 720 | [20.54757345, 41.78441763], 721 | [20.54807723, 41.78599465], 722 | [20.54706991, 41.78824782], 723 | [20.5473721, 41.78967476], 724 | [20.54938662, 41.78937435], 725 | [20.55401981, 41.78854823], 726 | [20.55835092, 41.78839803], 727 | [20.56076825, 41.78757191], 728 | [20.56318545, 41.78652036], 729 | [20.56590497, 41.78629506], 730 | [20.56953096, 41.7874968], 731 | [20.57255256, 41.78854823], 732 | [20.57386196, 41.79027545], 733 | [20.57315695, 41.79267883], 734 | [20.57255673, 41.79472804], 735 | [20.57316935, 41.79778576], 736 | [20.5732702, 41.79928768], 737 | [20.57004535, 41.80094004], 738 | [20.56661916, 41.80732358], 739 | [20.56379747, 41.81843865], 740 | [20.56067371, 41.82444692], 741 | [20.56098032, 41.82857752], 742 | [20.56077874, 41.83285832], 743 | [20.56138361, 41.8360126], 744 | [20.56309724, 41.83826566], 745 | [20.56420612, 41.84157014], 746 | [20.56299627, 41.84547544], 747 | [20.56128275, 41.85321093], 748 | [20.55987406, 41.85944426], 749 | [20.5591681, 41.86177254], 750 | [20.56088245, 41.86507702], 751 | [20.56199193, 41.86635375], 752 | [20.56128585, 41.86943293], 753 | [20.56380725, 41.86928272], 754 | [20.5670346, 41.87018394], 755 | [20.56874895, 41.87108505], 756 | [20.57076621, 41.87296271], 757 | [20.57147205, 41.87423944], 758 | [20.57237983, 41.87491524], 759 | [20.57701898, 41.87461495], 760 | [20.57893515, 41.87476516], 761 | [20.58500135, 41.8759346], 762 | [20.59458911, 41.87739241], 763 | [20.61038423, 41.87971115], 764 | [20.62652874, 41.88142765], 765 | [20.63736856, 41.88743591], 766 | [20.65005374, 41.89550388], 767 | [20.66227734, 41.90013886], 768 | [20.66827405, 41.90134037], 769 | [20.6763463, 41.90202713], 770 | [20.69779551, 41.89962375], 771 | [20.70821035, 41.89928055], 772 | [20.7326771, 41.9008255], 773 | [20.74098647, 41.90528858], 774 | [20.74744928, 41.91009521], 775 | [20.74929595, 41.91781986], 776 | [20.75345075, 41.92365634], 777 | [20.75650406, 41.9306612], 778 | [20.76706886, 41.95489883], 779 | [20.7666074, 41.96004856], 780 | [20.76591492, 41.96279526], 781 | [20.76314497, 41.96794498], 782 | [20.76129854, 41.97086334], 783 | [20.75806713, 41.97669983], 784 | [20.75252736, 41.9808197], 785 | [20.74906504, 41.98408115], 786 | [20.74860346, 41.98820114], 787 | [20.74814177, 41.99352264], 788 | [20.74859333, 41.99695575], 789 | [20.74951816, 42.00399387], 790 | [20.75067425, 42.01034546], 791 | [20.75067425, 42.01480865], 792 | [20.7504431, 42.01892853], 793 | [20.74998045, 42.02236176], 794 | [20.74951816, 42.02510834], 795 | [20.75067425, 42.02922821], 796 | [20.75321746, 42.03266144], 797 | [20.75599206, 42.03557956], 798 | [20.75830412, 42.03626633], 799 | [20.76177216, 42.03935623], 800 | [20.76315963, 42.04296112], 801 | [20.76177216, 42.04553604], 802 | [20.75946021, 42.04999924], 803 | [20.75761056, 42.05360413], 804 | [20.76246595, 42.05600727], 805 | [20.76639652, 42.05789554], 806 | [20.77102065, 42.05995548], 807 | [20.77587604, 42.06356037], 808 | [20.77841938, 42.06527698], 809 | [20.78073156, 42.06888187], 810 | [20.78234994, 42.07231522], 811 | [20.7837373, 42.07592011], 812 | [20.78466213, 42.07866657], 813 | [20.79091024, 42.08209991], 814 | [20.79391742, 42.08295822], 815 | [20.80108798, 42.08261478], 816 | [20.80687082, 42.08175647], 817 | [20.82190597, 42.08364475], 818 | [20.8304646, 42.08518982], 819 | [20.83485937, 42.08724976], 820 | [20.83832908, 42.09051132], 821 | [20.84272397, 42.09737766], 822 | [20.84711885, 42.09960926], 823 | [20.85521483, 42.09995258], 824 | [20.86099756, 42.09960926], 825 | [20.8667804, 42.09909427], 826 | [20.87186933, 42.09806442], 827 | [20.88089025, 42.09669113], 828 | [20.88621044, 42.09720612], 829 | [20.89129937, 42.09892273], 830 | [20.89453781, 42.10115433], 831 | [20.89823866, 42.10458755], 832 | [20.90195715, 42.10750568], 833 | [20.90542805, 42.11025226], 834 | [20.91260123, 42.11454391], 835 | [20.91560924, 42.11883545], 836 | [20.91746044, 42.12175357], 837 | [20.91977441, 42.12432861], 838 | [20.92324531, 42.12759006], 839 | [20.92903006, 42.12999344], 840 | [20.93412065, 42.13188171], 841 | [20.93620324, 42.13274002], 842 | [20.94336915, 42.13737476], 843 | [20.94660985, 42.13823307], 844 | [20.94938755, 42.13788974], 845 | [20.95355403, 42.13754654], 846 | [20.95910931, 42.13668823], 847 | [20.96535897, 42.13703156], 848 | [20.97021985, 42.13788974], 849 | [20.97577524, 42.13891983], 850 | [20.98133063, 42.13960636], 851 | [20.98688591, 42.14166641], 852 | [20.990821, 42.14321125], 853 | [20.99591315, 42.14475632], 854 | [21.00262594, 42.14681625], 855 | [21.00980163, 42.14973438], 856 | [21.01398885, 42.15093613], 857 | [21.02186585, 42.15248096], 858 | [21.02788973, 42.15488434], 859 | [21.03715706, 42.16106415], 860 | [21.04827786, 42.16724396], 861 | [21.05569172, 42.17428195], 862 | [21.06797075, 42.18389511], 863 | [21.08975553, 42.19230652], 864 | [21.10945535, 42.20397937], 865 | [21.11965275, 42.20621097], 866 | [21.14165986, 42.19402313], 867 | [21.17083383, 42.17634201], 868 | [21.19352436, 42.15969086], 869 | [21.22823966, 42.12690353], 870 | [21.24814796, 42.10721695], 871 | [21.25532055, 42.10012436], 872 | [21.2618016, 42.09651935], 873 | [21.26747727, 42.09755385], 874 | [21.28911388, 42.10149765], 875 | [21.29304886, 42.10441577], 876 | [21.29513192, 42.11196888], 877 | [21.30184436, 42.13274002], 878 | [21.30334795, 42.13703108], 879 | [21.30855656, 42.15196598], 880 | [21.32201016, 42.16844547], 881 | [21.34842241, 42.19573975], 882 | [21.37207866, 42.22818375], 883 | [21.38599241, 42.24775314], 884 | [21.39086211, 42.25101471], 885 | [21.39573193, 42.25204456], 886 | [21.42958808, 42.25170135], 887 | [21.43700874, 42.25427616], 888 | [21.44212365, 42.26028442], 889 | [21.45441985, 42.27796555], 890 | [21.46323586, 42.28706348], 891 | [21.47065997, 42.28895176], 892 | [21.48318815, 42.28757846], 893 | [21.50569272, 42.28088367], 894 | [21.51334882, 42.27539063], 895 | [21.52170086, 42.26491916], 896 | [21.5358299, 42.25736606], 897 | [21.55461097, 42.25393295], 898 | [21.57153726, 42.25221634], 899 | [21.58359444, 42.25393295], 900 | [21.60909843, 42.26097095], 901 | [21.61953187, 42.26131427], 902 | [21.62509656, 42.2599411], 903 | [21.63900793, 42.25204456], 904 | [21.66103435, 42.24964142], 905 | [21.6786555, 42.24620807], 906 | [21.69163954, 42.24191666], 907 | [21.70049524, 42.24340916], 908 | [21.70997405, 42.24500644], 909 | [21.75102675, 42.25650775], 910 | [21.76842201, 42.26406085], 911 | [21.78233814, 42.27384555], 912 | [21.79091966, 42.28620517], 913 | [21.79792964, 42.30062485], 914 | [21.79978824, 42.31470096], 915 | [21.80048525, 42.33049393], 916 | [21.79839432, 42.35040665], 917 | [21.80071735, 42.3572731], 918 | [21.80675781, 42.36001956], 919 | [21.81465638, 42.36001956], 920 | [21.82743394, 42.35710144], 921 | [21.84062135, 42.35092163], 922 | [21.88680744, 42.317276], 923 | [21.89585912, 42.29822147], 924 | [21.90212548, 42.29496002], 925 | ], 926 | ], 927 | ], 928 | }, 929 | }; 930 | -------------------------------------------------------------------------------- /src/db/locations/geojsons/urdun.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'Ürdün', 3 | number: 962, 4 | coordinates: { 5 | type: 'MultiPolygon', 6 | coordinates: [ 7 | [ 8 | [ 9 | [38.98446465, 32.47798908], 10 | [39.04381895, 32.30117786], 11 | [39.12082052, 32.32160556], 12 | [39.25919342, 32.35422134], 13 | [39.30018425, 32.23062515], 14 | [39.23385572, 32.18032825], 15 | [39.20038533, 32.15354908], 16 | [39.11537421, 32.08488464], 17 | [39.09995592, 32.07441318], 18 | [39.00613916, 31.99991214], 19 | [38.35784054, 31.84267044], 20 | [38.14797866, 31.79028487], 21 | [38.11493695, 31.7820785], 22 | [38.10782981, 31.78029645], 23 | [38.02248824, 31.75889957], 24 | [37.9822967, 31.74919867], 25 | [37.73977017, 31.68998051], 26 | [37.68926311, 31.67736053], 27 | [37.57809806, 31.64834964], 28 | [37.47241354, 31.61882401], 29 | [37.33532965, 31.58311844], 30 | [37.01862538, 31.50365615], 31 | [37.00617754, 31.50054932], 32 | [37.03979814, 31.46879184], 33 | [37.18486416, 31.32390976], 34 | [37.23954308, 31.27876282], 35 | [37.27380157, 31.2391597], 36 | [37.29255593, 31.21747971], 37 | [37.33372974, 31.17559433], 38 | [37.3776648, 31.13422394], 39 | [37.42100072, 31.09113693], 40 | [37.4614948, 31.04873645], 41 | [37.66316664, 30.84909427], 42 | [37.77533925, 30.73648453], 43 | [38.00657046, 30.50190926], 44 | [38.00567412, 30.49950588], 45 | [37.98301601, 30.48791885], 46 | [37.67235518, 30.33376694], 47 | [37.63803828, 30.26613235], 48 | [37.60818803, 30.20188796], 49 | [37.56961131, 30.12897491], 50 | [37.52806544, 30.04430294], 51 | [37.52588415, 30.03906715], 52 | [37.51820207, 30.00263214], 53 | [37.51686418, 30.00125885], 54 | [37.51369286, 29.99979973], 55 | [37.46489346, 29.98907077], 56 | [37.40642488, 29.98151767], 57 | [37.31803215, 29.96572495], 58 | [37.30178034, 29.96383655], 59 | [37.23955274, 29.95319355], 60 | [37.04975736, 29.91731644], 61 | [37.02974975, 29.91594315], 62 | [36.84973025, 29.88143921], 63 | [36.78428924, 29.86719132], 64 | [36.76439667, 29.83629215], 65 | [36.76400185, 29.83028412], 66 | [36.75935555, 29.82015598], 67 | [36.73501957, 29.78874195], 68 | [36.68043757, 29.74994648], 69 | [36.64494085, 29.69518662], 70 | [36.64415026, 29.68832004], 71 | [36.63960338, 29.67252731], 72 | [36.62558568, 29.63733673], 73 | [36.62341321, 29.63493335], 74 | [36.61709285, 29.63218677], 75 | [36.54917288, 29.56163394], 76 | [36.54759431, 29.54669952], 77 | [36.52628303, 29.51374054], 78 | [36.51602185, 29.50378406], 79 | [36.49412441, 29.48713303], 80 | [36.47381365, 29.46327198], 81 | [36.45922136, 29.45194244], 82 | [36.44955897, 29.43048465], 83 | [36.43741787, 29.41949844], 84 | [36.43071842, 29.41829681], 85 | [36.42756557, 29.4143486], 86 | [36.39879668, 29.40061557], 87 | [36.38726354, 29.40250385], 88 | [36.37110794, 29.39735413], 89 | [36.34252918, 29.38018787], 90 | [36.33012176, 29.37177646], 91 | [36.30983675, 29.35203552], 92 | [36.26268387, 29.32130814], 93 | [36.21311665, 29.28594577], 94 | [36.18036318, 29.25590515], 95 | [36.15290797, 29.23273075], 96 | [36.09942186, 29.20320511], 97 | [36.08388233, 29.19023323], 98 | [36.07297802, 29.18372905], 99 | [35.91192734, 29.20886993], 100 | [35.87456346, 29.21359062], 101 | [35.82461941, 29.22346115], 102 | [35.74904966, 29.23487663], 103 | [35.26550555, 29.31641567], 104 | [35, 29.35180521], 105 | [34.96086836, 29.35735595], 106 | [34.96490824, 29.35968876], 107 | [34.96581125, 29.36123252], 108 | [34.9609791, 29.36774254], 109 | [34.95955122, 29.36774254], 110 | [34.95871413, 29.36563957], 111 | [34.95876467, 29.36821711], 112 | [34.96236074, 29.36943817], 113 | [34.96609724, 29.37235236], 114 | [34.96229994, 29.37741172], 115 | [34.96377945, 29.38150835], 116 | [34.96856844, 29.38656712], 117 | [34.96406364, 29.39356291], 118 | [34.96492624, 29.39819944], 119 | [34.96974254, 29.40290165], 120 | [34.97652435, 29.40634966], 121 | [34.97766137, 29.40967286], 122 | [34.97254646, 29.42047572], 123 | [34.97470045, 29.43176055], 124 | [34.96988595, 29.43934953], 125 | [34.96791685, 29.44684863], 126 | [34.97094047, 29.44985604], 127 | [34.97165763, 29.45334721], 128 | [34.97618055, 29.45916831], 129 | [34.97443652, 29.46299458], 130 | [34.97492898, 29.47056293], 131 | [34.97988403, 29.47738373], 132 | [34.98014307, 29.48052025], 133 | [34.98297095, 29.48249543], 134 | [34.98599672, 29.49070215], 135 | [34.99185801, 29.50046325], 136 | [34.99087834, 29.50349045], 137 | [34.99625635, 29.51757121], 138 | [34.99836326, 29.51739764], 139 | [34.99819815, 29.51679826], 140 | [34.99745846, 29.51467931], 141 | [34.99992454, 29.51599348], 142 | [34.99884546, 29.51693225], 143 | [35, 29.51771378], 144 | [35.00029433, 29.51618135], 145 | [35.00137317, 29.51792467], 146 | [35, 29.52720821], 147 | [34.99995518, 29.52720523], 148 | [34.99711835, 29.53125], 149 | [34.99650705, 29.53125], 150 | [34.97952843, 29.54202414], 151 | [34.97854483, 29.54233503], 152 | [34.97966266, 29.57683134], 153 | [35, 29.61241293], 154 | [35.01510847, 29.62772357], 155 | [35.02399945, 29.65089786], 156 | [35.02459204, 29.66497421], 157 | [35.02063966, 29.72179413], 158 | [35.03289986, 29.75595474], 159 | [35.03645933, 29.77020264], 160 | [35.06317651, 29.82564914], 161 | [35.0754472, 29.85620487], 162 | [35.07664394, 29.87354267], 163 | [35.08020926, 29.88006592], 164 | [35.08020926, 29.88435745], 165 | [35.07783234, 29.88882065], 166 | [35.07743633, 29.91731644], 167 | [35.07961237, 29.93362415], 168 | [35.08199191, 29.93997574], 169 | [35.07921875, 29.94804382], 170 | [35.07921624, 29.95250702], 171 | [35.08773744, 29.96349335], 172 | [35.09071004, 29.97001636], 173 | [35.09308732, 29.98872745], 174 | [35.09467375, 30.01859665], 175 | [35.10201061, 30.03610611], 176 | [35.11232197, 30.05069733], 177 | [35.12144363, 30.06116855], 178 | [35.13363636, 30.06966591], 179 | [35.13581824, 30.07352817], 180 | [35.13988483, 30.07661808], 181 | [35.14295995, 30.08408535], 182 | [35.14841616, 30.08794785], 183 | [35.15084684, 30.09206772], 184 | [35.15238333, 30.09653091], 185 | [35.14980435, 30.09884834], 186 | [35.15119398, 30.10138035], 187 | [35.15836155, 30.10580063], 188 | [35.16771388, 30.12330997], 189 | [35.17146385, 30.12708664], 190 | [35.17208385, 30.13103485], 191 | [35.16087055, 30.17738342], 192 | [35.15625, 30.1887989], 193 | [35.15407932, 30.19017208], 194 | [35.15069675, 30.20424843], 195 | [35.14686167, 30.21205902], 196 | [35.14712083, 30.21463394], 197 | [35.14149642, 30.22579193], 198 | [35.14133596, 30.23368657], 199 | [35.15413773, 30.26716232], 200 | [35.15865385, 30.27420044], 201 | [35.15944815, 30.28565884], 202 | [35.16511404, 30.29510021], 203 | [35.16024184, 30.30539978], 204 | [35.16042531, 30.31013954], 205 | [35.17420435, 30.32170773], 206 | [35.17593145, 30.32878876], 207 | [35.17960298, 30.331707], 208 | [35.18194807, 30.33861625], 209 | [35.18616414, 30.34329414], 210 | [35.18561387, 30.35005152], 211 | [35.18822706, 30.35234916], 212 | [35.18534255, 30.35509574], 213 | [35.18449724, 30.36003113], 214 | [35.18046868, 30.36668301], 215 | [35.17928791, 30.37496555], 216 | [35.17280805, 30.39075851], 217 | [35.16754317, 30.39848316], 218 | [35.15580344, 30.42127132], 219 | [35.15559185, 30.43830872], 220 | [35.15625, 30.44320095], 221 | [35.16385114, 30.45049655], 222 | [35.16855598, 30.45238495], 223 | [35.16965127, 30.45320034], 224 | [35.17278755, 30.45646191], 225 | [35.17507756, 30.46165454], 226 | [35.18104851, 30.46766281], 227 | [35.18365407, 30.47967911], 228 | [35.19182026, 30.49135196], 229 | [35.19182026, 30.49873352], 230 | [35.18628955, 30.51581383], 231 | [35.18638921, 30.52165031], 232 | [35.19709873, 30.53237915], 233 | [35.20427215, 30.54224956], 234 | [35.20298815, 30.54936016], 235 | [35.20760655, 30.56456566], 236 | [35.20746088, 30.58250415], 237 | [35.20915127, 30.59144592], 238 | [35.21592975, 30.60421944], 239 | [35.22091556, 30.60782433], 240 | [35.23118198, 30.61889637], 241 | [35.2333765, 30.62808025], 242 | [35.25601125, 30.66198337], 243 | [35.25581145, 30.6746006], 244 | [35.26149964, 30.68129528], 245 | [35.27297545, 30.68738925], 246 | [35.27497125, 30.6950283], 247 | [35.27954566, 30.70395458], 248 | [35.29001236, 30.73116303], 249 | [35.29101062, 30.73596954], 250 | [35.29021347, 30.75330734], 251 | [35.29600644, 30.76755524], 252 | [35.29570675, 30.77622414], 253 | [35.29800415, 30.77914226], 254 | [35.30359733, 30.78214645], 255 | [35.30730283, 30.79133034], 256 | [35.31620181, 30.80454814], 257 | [35.33437097, 30.8130455], 258 | [35.33549345, 30.81441867], 259 | [35.33786905, 30.82386005], 260 | [35.33769262, 30.82626343], 261 | [35.33267188, 30.83948135], 262 | [35.33209503, 30.8421421], 263 | [35.33139515, 30.8530426], 264 | [35.3333106, 30.86205483], 265 | [35.33540964, 30.86720455], 266 | [35.34160638, 30.88050842], 267 | [35.34730744, 30.88737476], 268 | [35.34840775, 30.89424133], 269 | [35.35582244, 30.90797424], 270 | [35.35910976, 30.91398227], 271 | [35.36201024, 30.91827393], 272 | [35.36822236, 30.92505455], 273 | [35.37142444, 30.92711437], 274 | [35.37552714, 30.92788684], 275 | [35.38873625, 30.92728615], 276 | [35.39123714, 30.93029022], 277 | [35.39654064, 30.9330368], 278 | [35.40294504, 30.94041824], 279 | [35.40794826, 30.94144821], 280 | [35.41560066, 30.94994485], 281 | [35.41826928, 30.99740982], 282 | [35.41746843, 31.00496292], 283 | [35.4212656, 31.02006912], 284 | [35.42407143, 31.04581833], 285 | [35.44744456, 31.08428121], 286 | [35.45385206, 31.10469806], 287 | [35.45627701, 31.12797427], 288 | [35.45485461, 31.14830005], 289 | [35.45345116, 31.15276325], 290 | [35.44749153, 31.1665982], 291 | [35.40395308, 31.22356832], 292 | [35.39905941, 31.24481142], 293 | [35.39858878, 31.25503063], 294 | [35.39924991, 31.26323807], 295 | [35.40122855, 31.27069473], 296 | [35.41388595, 31.29644394], 297 | [35.42672145, 31.31567395], 298 | [35.43543208, 31.32871616], 299 | [35.45473695, 31.36030185], 300 | [35.46827364, 31.3949089], 301 | [35.4748733, 31.41986835], 302 | [35.47512126, 31.42534816], 303 | [35.47708476, 31.49642944], 304 | [35.47553694, 31.5300585], 305 | [35.47753894, 31.57519531], 306 | [35.50077474, 31.640625], 307 | [35.51054263, 31.66534507], 308 | [35.53027344, 31.71972644], 309 | [35.538715, 31.73079407], 310 | [35.5591042, 31.75752628], 311 | [35.55851424, 31.76156116], 312 | [35.55757284, 31.76430702], 313 | [35.55308986, 31.76713943], 314 | [35.55615962, 31.77078724], 315 | [35.55146503, 31.77464962], 316 | [35.54750752, 31.78327024], 317 | [35.55116236, 31.79014206], 318 | [35.55142462, 31.79833877], 319 | [35.54744816, 31.79965854], 320 | [35.54333615, 31.80494785], 321 | [35.54429698, 31.81357384], 322 | [35.54136777, 31.81288707], 323 | [35.54126692, 31.81511867], 324 | [35.53995371, 31.81537616], 325 | [35.54060924, 31.81717873], 326 | [35.54318452, 31.81756485], 327 | [35.54242694, 31.82031155], 328 | [35.54662025, 31.82387352], 329 | [35.54732728, 31.82653415], 330 | [35.54247046, 31.85932148], 331 | [35.54701841, 31.86704636], 332 | [35.54701841, 31.86927795], 333 | [35.54156101, 31.88112247], 334 | [35.53536046, 31.88841808], 335 | [35.53205335, 31.8979454], 336 | [35.52578402, 31.90481186], 337 | [35.52426732, 31.9088459], 338 | [35.52684355, 31.91648483], 339 | [35.52603483, 31.92210674], 340 | [35.52795601, 31.92369461], 341 | [35.53614652, 31.92365158], 342 | [35.54347873, 31.93579674], 343 | [35.54307437, 31.94463718], 344 | [35.54145646, 31.95060253], 345 | [35.54317558, 31.95270526], 346 | [35.54165792, 31.95931435], 347 | [35.54459214, 31.96197498], 348 | [35.54221535, 31.96502197], 349 | [35.54595816, 31.96733952], 350 | [35.53568912, 31.98888302], 351 | [35.53589141, 31.99536324], 352 | [35.53493011, 31.99712265], 353 | [35.52759314, 32.00132835], 354 | [35.52658105, 32.01424587], 355 | [35.52464843, 32.01184273], 356 | [35.52343333, 32.01141346], 357 | [35.52268374, 32.01248646], 358 | [35.52222824, 32.01463223], 359 | [35.52738225, 32.01656342], 360 | [35.52778733, 32.01896656], 361 | [35.52480936, 32.01930988], 362 | [35.52162075, 32.02270031], 363 | [35.52292705, 32.02806473], 364 | [35.52039564, 32.02960956], 365 | [35.52080071, 32.03175545], 366 | [35.51861811, 32.03574646], 367 | [35.52150381, 32.04175472], 368 | [35.52150953, 32.04231262], 369 | [35.51866865, 32.04548836], 370 | [35.52026093, 32.04759121], 371 | [35.52213442, 32.04780567], 372 | [35.52375472, 32.05012322], 373 | [35.52805865, 32.04913604], 374 | [35.52983081, 32.04999435], 375 | [35.52831185, 32.05389965], 376 | [35.52988136, 32.05492973], 377 | [35.53112447, 32.05999374], 378 | [35.52876735, 32.0640707], 379 | [35.53140044, 32.06475735], 380 | [35.53084362, 32.06896305], 381 | [35.53464222, 32.06887722], 382 | [35.53629148, 32.07261086], 383 | [35.53347731, 32.07432735], 384 | [35.53337586, 32.07600105], 385 | [35.53487325, 32.07664478], 386 | [35.53752911, 32.07548606], 387 | [35.54064822, 32.08119392], 388 | [35.54541004, 32.08213794], 389 | [35.54328227, 32.08565712], 390 | [35.54310036, 32.09003437], 391 | [35.53925085, 32.09269524], 392 | [35.53935206, 32.094841], 393 | [35.53570545, 32.10020542], 394 | [35.53367853, 32.10767257], 395 | [35.54082215, 32.11084843], 396 | [35.54517925, 32.11853015], 397 | [35.54895842, 32.12144852], 398 | [35.54943526, 32.12247837], 399 | [35.54842186, 32.12531078], 400 | [35.5508033, 32.12694156], 401 | [35.55118835, 32.12805736], 402 | [35.55100596, 32.12882996], 403 | [35.54619193, 32.1306324], 404 | [35.55075264, 32.13380814], 405 | [35.54593861, 32.13535297], 406 | [35.54388988, 32.14033115], 407 | [35.54598916, 32.14312065], 408 | [35.54913163, 32.14153278], 409 | [35.55100691, 32.14595306], 410 | [35.55247664, 32.14578152], 411 | [35.55359173, 32.14389324], 412 | [35.55703831, 32.14436531], 413 | [35.55845737, 32.14797008], 414 | [35.55906558, 32.15075958], 415 | [35.5559231, 32.1527338], 416 | [35.55850816, 32.15582371], 417 | [35.55820405, 32.15844154], 418 | [35.55425036, 32.16037273], 419 | [35.55024457, 32.15981483], 420 | [35.552019, 32.16367722], 421 | [35.54862225, 32.16702461], 422 | [35.55151212, 32.16745365], 423 | [35.55401945, 32.16633785], 424 | [35.55724084, 32.16711044], 425 | [35.55784905, 32.16882706], 426 | [35.55627751, 32.17088687], 427 | [35.55232322, 32.17032897], 428 | [35.55313432, 32.17633724], 429 | [35.55361354, 32.17689514], 430 | [35.55475664, 32.17668045], 431 | [35.55675805, 32.17397678], 432 | [35.55939555, 32.17329025], 433 | [35.55896437, 32.17792511], 434 | [35.5624125, 32.18393326], 435 | [35.55921793, 32.18539226], 436 | [35.55866015, 32.18775272], 437 | [35.56101835, 32.18959796], 438 | [35.56444073, 32.18715191], 439 | [35.56565773, 32.18736637], 440 | [35.56991673, 32.19547737], 441 | [35.56956172, 32.19693661], 442 | [35.56677234, 32.19697952], 443 | [35.56507576, 32.20015526], 444 | [35.56499732, 32.20178604], 445 | [35.56243861, 32.20401764], 446 | [35.56286716, 32.20513344], 447 | [35.56702602, 32.20702171], 448 | [35.56809103, 32.21139896], 449 | [35.57258213, 32.20985413], 450 | [35.57379925, 32.21088398], 451 | [35.57387245, 32.21169937], 452 | [35.57349503, 32.21260071], 453 | [35.57177055, 32.21328735], 454 | [35.56913316, 32.21311557], 455 | [35.56925738, 32.21599102], 456 | [35.56578577, 32.21749306], 457 | [35.56477153, 32.21912384], 458 | [35.56768477, 32.22169864], 459 | [35.56651807, 32.22440243], 460 | [35.57174301, 32.22744942], 461 | [35.57225025, 32.22835064], 462 | [35.57199657, 32.22890854], 463 | [35.57011974, 32.22955215], 464 | [35.56527877, 32.22805023], 465 | [35.56335044, 32.22925174], 466 | [35.56223392, 32.23114014], 467 | [35.56314743, 32.23671913], 468 | [35.56277061, 32.23882186], 469 | [35.56091428, 32.24101055], 470 | [35.56129897, 32.24186885], 471 | [35.56322718, 32.24255562], 472 | [35.56774306, 32.24174023], 473 | [35.57119358, 32.24925041], 474 | [35.56972206, 32.25152493], 475 | [35.56500316, 32.24942195], 476 | [35.56251681, 32.25156784], 477 | [35.56424224, 32.26216793], 478 | [35.55959487, 32.26444244], 479 | [35.55810094, 32.27298248], 480 | [35.56284285, 32.27457035], 481 | [35.56741035, 32.28547084], 482 | [35.56200826, 32.29508388], 483 | [35.55566263, 32.29791641], 484 | [35.55540884, 32.29903221], 485 | [35.55637336, 32.30117786], 486 | [35.55998635, 32.30315196], 487 | [35.55972445, 32.30521202], 488 | [35.56343973, 32.30873096], 489 | [35.56008804, 32.31808662], 490 | [35.55383325, 32.32220638], 491 | [35.55535674, 32.32945907], 492 | [35.55754888, 32.33224857], 493 | [35.55510223, 32.34310615], 494 | [35.55840385, 32.34915733], 495 | [35.55512261, 32.35499382], 496 | [35.55657566, 32.35722542], 497 | [35.55418766, 32.35898495], 498 | [35.55408621, 32.36495006], 499 | [35.55298805, 32.36649513], 500 | [35.55685043, 32.36666667], 501 | [35.56091595, 32.36374855], 502 | [35.56363738, 32.36932755], 503 | [35.56376183, 32.37241745], 504 | [35.56368756, 32.37439156], 505 | [35.56277287, 32.37623692], 506 | [35.55987644, 32.37782466], 507 | [35.55911422, 32.37958431], 508 | [35.56231546, 32.38100052], 509 | [35.56284702, 32.38160133], 510 | [35.56325364, 32.38314617], 511 | [35.56251884, 32.38464832], 512 | [35.55794537, 32.38632202], 513 | [35.55647182, 32.38743782], 514 | [35.55509448, 32.38911414], 515 | [35.55367756, 32.39190102], 516 | [35.55052638, 32.39340305], 517 | [35.54905248, 32.39833832], 518 | [35.54701972, 32.40035534], 519 | [35.54728234, 32.40091324], 520 | [35.55235624, 32.40378845], 521 | [35.55535483, 32.40048397], 522 | [35.55806005, 32.40022647], 523 | [35.56058967, 32.40147114], 524 | [35.55799687, 32.40632045], 525 | [35.56069124, 32.41117001], 526 | [35.55723453, 32.41481781], 527 | [35.5610671, 32.4220705], 528 | [35.56008697, 32.42503154], 529 | [35.55623746, 32.42945194], 530 | [35.55633855, 32.43284225], 531 | [35.55856144, 32.43601787], 532 | [35.56140935, 32.43395805], 533 | [35.56476581, 32.43438721], 534 | [35.56762743, 32.43927956], 535 | [35.56486774, 32.44185436], 536 | [35.56690204, 32.4452877], 537 | [35.56615257, 32.44850636], 538 | [35.56812263, 32.45773315], 539 | [35.56649506, 32.46108055], 540 | [35.56289577, 32.46271133], 541 | [35.56243813, 32.46631622], 542 | [35.56676161, 32.46966362], 543 | [35.56452346, 32.4718523], 544 | [35.56462514, 32.47425544], 545 | [35.56828737, 32.47532845], 546 | [35.56966102, 32.47730255], 547 | [35.56864345, 32.47923374], 548 | [35.56599796, 32.48017776], 549 | [35.56589615, 32.48146534], 550 | [35.57413793, 32.48425484], 551 | [35.57983577, 32.48785973], 552 | [35.57474911, 32.49751556], 553 | [35.56984687, 32.49936104], 554 | [35.56699741, 32.49807346], 555 | [35.56436825, 32.50129223], 556 | [35.55887258, 32.50266552], 557 | [35.55732906, 32.50742912], 558 | [35.55877078, 32.50996113], 559 | [35.55373394, 32.51528263], 560 | [35.55552995, 32.51704204], 561 | [35.55448842, 32.51970291], 562 | [35.55565906, 32.52124774], 563 | [35.56418455, 32.52090454], 564 | [35.56532943, 32.5216341], 565 | [35.56336987, 32.52983093], 566 | [35.55906916, 32.53129005], 567 | [35.55993462, 32.53691185], 568 | [35.56296265, 32.53970134], 569 | [35.56090188, 32.54463673], 570 | [35.56451654, 32.54467964], 571 | [35.56660402, 32.53957272], 572 | [35.56947887, 32.53961563], 573 | [35.56958067, 32.54407883], 574 | [35.57141352, 32.54570961], 575 | [35.57049715, 32.54837024], 576 | [35.56835902, 32.54948604], 577 | [35.56886804, 32.55163193], 578 | [35.57098222, 32.55214691], 579 | [35.57250965, 32.54982936], 580 | [35.57533348, 32.55103171], 581 | [35.57609713, 32.55266178], 582 | [35.57609713, 32.55472183], 583 | [35.57487535, 32.55927086], 584 | [35.57011735, 32.56472111], 585 | [35.57161725, 32.56639481], 586 | [35.57403803, 32.56553638], 587 | [35.57660925, 32.56733894], 588 | [35.57770431, 32.57956982], 589 | [35.57765341, 32.58145797], 590 | [35.57602358, 32.5859642], 591 | [35.57780635, 32.59579182], 592 | [35.57762814, 32.59677875], 593 | [35.57556498, 32.59789455], 594 | [35.56731296, 32.59673595], 595 | [35.56624174, 32.60282993], 596 | [35.56659853, 32.60403144], 597 | [35.57194805, 32.60609138], 598 | [35.57220435, 32.61330116], 599 | [35.56766951, 32.62201297], 600 | [35.56150401, 32.6254034], 601 | [35.56812835, 32.63252735], 602 | [35.56787348, 32.63411522], 603 | [35.5665487, 32.63523102], 604 | [35.56277764, 32.63690472], 605 | [35.56247175, 32.63784885], 606 | [35.56298137, 32.63844955], 607 | [35.56659961, 32.64055252], 608 | [35.56683946, 32.64312744], 609 | [35.56185973, 32.64467227], 610 | [35.56082594, 32.64527321], 611 | [35.56094217, 32.64630306], 612 | [35.56180871, 32.64698982], 613 | [35.56510675, 32.64784813], 614 | [35.57078624, 32.64681804], 615 | [35.57285285, 32.64492977], 616 | [35.57285285, 32.64252663], 617 | [35.57174087, 32.64175594], 618 | [35.57263315, 32.64076722], 619 | [35.57578194, 32.64063835], 620 | [35.57856095, 32.64192581], 621 | [35.57822895, 32.64510155], 622 | [35.58506012, 32.64381397], 623 | [35.58536601, 32.64132488], 624 | [35.58638537, 32.64149666], 625 | [35.58801675, 32.64450073], 626 | [35.59138131, 32.64561653], 627 | [35.5916872, 32.64733315], 628 | [35.58944404, 32.64956474], 629 | [35.5895462, 32.65102375], 630 | [35.59334195, 32.65334117], 631 | [35.59841633, 32.6508522], 632 | [35.60096514, 32.65179634], 633 | [35.60392177, 32.65093803], 634 | [35.60626686, 32.65256882], 635 | [35.60687864, 32.6595211], 636 | [35.60394371, 32.66312587], 637 | [35.59945154, 32.66484261], 638 | [35.59812558, 32.66647327], 639 | [35.59802365, 32.66879082], 640 | [35.59965551, 32.66990662], 641 | [35.60504341, 32.67033565], 642 | [35.60515058, 32.67497063], 643 | [35.61260808, 32.67874706], 644 | [35.61627984, 32.67900455], 645 | [35.62056351, 32.67780304], 646 | [35.62462997, 32.6779747], 647 | [35.62717974, 32.67891884], 648 | [35.63045645, 32.68295276], 649 | [35.63229215, 32.6832962], 650 | [35.63851345, 32.68355358], 651 | [35.64167523, 32.68200874], 652 | [35.64279711, 32.67874706], 653 | [35.64595866, 32.67831802], 654 | [35.65605581, 32.68544185], 655 | [35.66625464, 32.68887508], 656 | [35.67002785, 32.69222248], 657 | [35.67104793, 32.69797325], 658 | [35.67533255, 32.70217896], 659 | [35.67533255, 32.70647037], 660 | [35.68726826, 32.71033275], 661 | [35.69032848, 32.70956027], 662 | [35.69706154, 32.71059024], 663 | [35.69818366, 32.71265018], 664 | [35.70053136, 32.71239281], 665 | [35.70298004, 32.71471024], 666 | [35.70502067, 32.71376598], 667 | [35.70899975, 32.71539676], 668 | [35.71083641, 32.71848667], 669 | [35.71297896, 32.71814334], 670 | [35.71593785, 32.7157402], 671 | [35.71808052, 32.71857262], 672 | [35.71715856, 32.72286415], 673 | [35.71838331, 32.72423744], 674 | [35.72215927, 32.72183406], 675 | [35.72389424, 32.72243488], 676 | [35.72481275, 32.72595406], 677 | [35.72705805, 32.72715557], 678 | [35.72960925, 32.72638321], 679 | [35.72971141, 32.7232933], 680 | [35.7319566, 32.72346485], 681 | [35.73685515, 32.72964466], 682 | [35.73767173, 32.73359287], 683 | [35.74052918, 32.73161876], 684 | [35.74399912, 32.73324955], 685 | [35.74695873, 32.73591042], 686 | [35.74971426, 32.74114597], 687 | [35.75619078, 32.74569511], 688 | [35.76278818, 32.74700308], 689 | [35.76568151, 32.74745464], 690 | [35.77200854, 32.74629593], 691 | [35.78430545, 32.74788368], 692 | [35.78660154, 32.74865615], 693 | [35.79420447, 32.75526524], 694 | [35.79629672, 32.75578022], 695 | [35.79741943, 32.75560856], 696 | [35.79809427, 32.75470734], 697 | [35.80134845, 32.74861336], 698 | [35.79435766, 32.74518013], 699 | [35.79941726, 32.74123192], 700 | [35.80165434, 32.73698318], 701 | [35.80354214, 32.73702621], 702 | [35.80736864, 32.74024475], 703 | [35.80961335, 32.74067402], 704 | [35.81221604, 32.73578155], 705 | [35.82303154, 32.73449421], 706 | [35.83389342, 32.72801387], 707 | [35.83956075, 32.72831428], 708 | [35.84267235, 32.73136127], 709 | [35.84531784, 32.73153305], 710 | [35.84848785, 32.73033142], 711 | [35.85323214, 32.72595406], 712 | [35.85542572, 32.72561073], 713 | [35.85578275, 32.72689807], 714 | [35.85296822, 32.72981644], 715 | [35.85449815, 32.73161876], 716 | [35.85848641, 32.73131835], 717 | [35.86557674, 32.73367882], 718 | [35.87194097, 32.73402214], 719 | [35.87731075, 32.73273456], 720 | [35.87986147, 32.7271986], 721 | [35.88542235, 32.72174835], 722 | [35.88901877, 32.72230625], 723 | [35.89274275, 32.72101867], 724 | [35.89565051, 32.72140503], 725 | [35.89876223, 32.72333622], 726 | [35.9002552, 32.72818565], 727 | [35.90377521, 32.72762775], 728 | [35.90585268, 32.72028923], 729 | [35.91207624, 32.72290695], 730 | [35.91682017, 32.71883011], 731 | [35.91855454, 32.71883011], 732 | [35.92023802, 32.72161961], 733 | [35.92314565, 32.72119045], 734 | [35.92681861, 32.72226334], 735 | [35.92957306, 32.72196293], 736 | [35.93457222, 32.72041786], 737 | [35.93615353, 32.71835804], 738 | [35.93946874, 32.70835865], 739 | [35.93809176, 32.70016193], 740 | [35.94110084, 32.69647121], 741 | [35.94528341, 32.69664276], 742 | [35.95038295, 32.69260883], 743 | [35.96328545, 32.69441116], 744 | [35.96996582, 32.68561363], 745 | [35.97208726, 32.68097866], 746 | [35.97048128, 32.67917633], 747 | [35.96048737, 32.67660141], 748 | [35.95559227, 32.67642975], 749 | [35.96354675, 32.66458511], 750 | [35.96803391, 32.66183853], 751 | [35.98353445, 32.65977848], 752 | [36.00433815, 32.66046524], 753 | [36.02412176, 32.65737534], 754 | [36.02738512, 32.65480042], 755 | [36.02760136, 32.65102375], 756 | [36.02760136, 32.63935077], 757 | [36.02311897, 32.61325824], 758 | [36.02495265, 32.60261536], 759 | [36.0290277, 32.59746552], 760 | [36.0428822, 32.59008396], 761 | [36.05347681, 32.58270264], 762 | [36.06529391, 32.57188785], 763 | [36.07201743, 32.55849826], 764 | [36.07344115, 32.55025864], 765 | [36.07853234, 32.54339206], 766 | [36.07893956, 32.53995895], 767 | [36.07608855, 32.53137577], 768 | [36.07771766, 32.51575458], 769 | [36.07853234, 32.51335144], 770 | [36.07995784, 32.51249313], 771 | [36.12190831, 32.52347934], 772 | [36.12618482, 32.52382266], 773 | [36.15001094, 32.5233078], 774 | [36.15428746, 32.52193451], 775 | [36.16385865, 32.51403797], 776 | [36.17097092, 32.51592624], 777 | [36.18420196, 32.52433765], 778 | [36.19071591, 32.52983093], 779 | [36.19519413, 32.53068924], 780 | [36.19987595, 32.52914417], 781 | [36.23671961, 32.49721515], 782 | [36.26763582, 32.48176575], 783 | [36.29571116, 32.46631622], 784 | [36.30873168, 32.45773315], 785 | [36.36708164, 32.40365982], 786 | [36.39533436, 32.37997055], 787 | [36.42460334, 32.37533557], 788 | [36.47703302, 32.37087238], 789 | [36.48902237, 32.36675262], 790 | [36.49491572, 32.36228943], 791 | [36.50365365, 32.35919952], 792 | [36.51279831, 32.35782623], 793 | [36.52864885, 32.3566246], 794 | [36.58087075, 32.35027313], 795 | [36.61683655, 32.34821308], 796 | [36.6849004, 32.33842838], 797 | [36.69973135, 32.33345032], 798 | [36.70562303, 32.33036041], 799 | [36.70928001, 32.32503891], 800 | [36.71192098, 32.32400894], 801 | [36.72207916, 32.33053195], 802 | [36.72654891, 32.33156204], 803 | [36.83967793, 32.31147754], 804 | [36.87992251, 32.34786975], 805 | [36.98362875, 32.40606296], 806 | [37.08637607, 32.46099472], 807 | [37.17881823, 32.51369464], 808 | [37.29246354, 32.57566452], 809 | [37.42968726, 32.64947093], 810 | [37.48723996, 32.68037784], 811 | [37.71080852, 32.79882431], 812 | [37.81707192, 32.85392761], 813 | [38.20963275, 33.06421268], 814 | [38.22950947, 33.07605743], 815 | [38.25655854, 33.08858871], 816 | [38.31417716, 33.12034595], 817 | [38.71531391, 33.33148944], 818 | [38.7943902, 33.37496281], 819 | [38.80481863, 33.34286213], 820 | [38.82361221, 33.29183567], 821 | [38.84162712, 33.233428], 822 | [38.8793118, 33.12442303], 823 | [38.91608226, 33.01202774], 824 | [38.94173217, 32.93936658], 825 | [39.08440185, 32.50253665], 826 | [38.98446465, 32.47798908], 827 | ], 828 | ], 829 | ], 830 | }, 831 | }; 832 | -------------------------------------------------------------------------------- /src/db/locations/index.js: -------------------------------------------------------------------------------- 1 | const geojsons = require('./geojsons'); 2 | const airports = require('./airports'); 3 | module.exports = { geojsons, airports }; 4 | -------------------------------------------------------------------------------- /src/db/nopeRedis.js: -------------------------------------------------------------------------------- 1 | const nopeRedis = require('nope-redis'); 2 | module.exports = nopeRedis; 3 | -------------------------------------------------------------------------------- /src/db/populations.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | '-1': { 3 | city: null, 4 | cityCode: null, 5 | population: null, 6 | }, 7 | 1: { 8 | city: 'Adana', 9 | cityCode: '1', 10 | population: 2274106, 11 | }, 12 | 2: { 13 | city: 'Adıyaman', 14 | cityCode: '2', 15 | population: 635169, 16 | }, 17 | 3: { 18 | city: 'Afyon', 19 | cityCode: '3', 20 | population: 747555, 21 | }, 22 | 4: { 23 | city: 'Ağrı', 24 | cityCode: '4', 25 | population: 510626, 26 | }, 27 | 5: { 28 | city: 'Amasya', 29 | cityCode: '5', 30 | population: 338267, 31 | }, 32 | 6: { 33 | city: 'Ankara', 34 | cityCode: '6', 35 | population: 5782285, 36 | }, 37 | 7: { 38 | city: 'Antalya', 39 | cityCode: '7', 40 | population: 2688004, 41 | }, 42 | 8: { 43 | city: 'Artvin', 44 | cityCode: '8', 45 | population: 169403, 46 | }, 47 | 9: { 48 | city: 'Aydın', 49 | cityCode: '9', 50 | population: 1148241, 51 | }, 52 | 10: { 53 | city: 'Balıkesir', 54 | cityCode: '10', 55 | population: 1257590, 56 | }, 57 | 11: { 58 | city: 'Bilecik', 59 | cityCode: '11', 60 | population: 228673, 61 | }, 62 | 12: { 63 | city: 'Bingöl', 64 | cityCode: '12', 65 | population: 282556, 66 | }, 67 | 13: { 68 | city: 'Bitlis', 69 | cityCode: '13', 70 | population: 353988, 71 | }, 72 | 14: { 73 | city: 'Bolu', 74 | cityCode: '14', 75 | population: 320824, 76 | }, 77 | 15: { 78 | city: 'Burdur', 79 | cityCode: '15', 80 | population: 273799, 81 | }, 82 | 16: { 83 | city: 'Bursa', 84 | cityCode: '16', 85 | population: 3194720, 86 | }, 87 | 17: { 88 | city: 'Çanakkale', 89 | cityCode: '17', 90 | population: 559383, 91 | }, 92 | 18: { 93 | city: 'Çankırı', 94 | cityCode: '18', 95 | population: 195766, 96 | }, 97 | 19: { 98 | city: 'Çorum', 99 | cityCode: '19', 100 | population: 524130, 101 | }, 102 | 20: { 103 | city: 'Denizli', 104 | cityCode: '20', 105 | population: 1056332, 106 | }, 107 | 21: { 108 | city: 'Diyarbakır', 109 | cityCode: '21', 110 | population: 1804880, 111 | }, 112 | 22: { 113 | city: 'Edirne', 114 | cityCode: '22', 115 | population: 414714, 116 | }, 117 | 23: { 118 | city: 'Elazığ', 119 | cityCode: '23', 120 | population: 591497, 121 | }, 122 | 24: { 123 | city: 'Erzincan', 124 | cityCode: '24', 125 | population: 239223, 126 | }, 127 | 25: { 128 | city: 'Erzurum', 129 | cityCode: '25', 130 | population: 749754, 131 | }, 132 | 26: { 133 | city: 'Eskişehir', 134 | cityCode: '26', 135 | population: 906617, 136 | }, 137 | 27: { 138 | city: 'Gaziantep', 139 | cityCode: '27', 140 | population: 2154051, 141 | }, 142 | 28: { 143 | city: 'Giresun', 144 | cityCode: '28', 145 | population: 450862, 146 | }, 147 | 29: { 148 | city: 'Gümüşhane', 149 | cityCode: '29', 150 | population: 144544, 151 | }, 152 | 30: { 153 | city: 'Hakkari', 154 | cityCode: '30', 155 | population: 275333, 156 | }, 157 | 31: { 158 | city: 'Hatay', 159 | cityCode: '31', 160 | population: 1686043, 161 | }, 162 | 32: { 163 | city: 'Isparta', 164 | cityCode: '32', 165 | population: 445325, 166 | }, 167 | 33: { 168 | city: 'İçel', 169 | cityCode: '33', 170 | population: 1916432, 171 | }, 172 | 34: { 173 | city: 'İstanbul', 174 | cityCode: '34', 175 | population: 15907951, 176 | }, 177 | 35: { 178 | city: 'İzmir', 179 | cityCode: '35', 180 | population: 4462056, 181 | }, 182 | 36: { 183 | city: 'Kars', 184 | cityCode: '36', 185 | population: 274829, 186 | }, 187 | 37: { 188 | city: 'Kastamonu', 189 | cityCode: '37', 190 | population: 378115, 191 | }, 192 | 38: { 193 | city: 'Kayseri', 194 | cityCode: '38', 195 | population: 1441523, 196 | }, 197 | 39: { 198 | city: 'Kırklareli', 199 | cityCode: '39', 200 | population: 369347, 201 | }, 202 | 40: { 203 | city: 'Kırşehir', 204 | cityCode: '40', 205 | population: 244519, 206 | }, 207 | 41: { 208 | city: 'Kocaeli', 209 | cityCode: '41', 210 | population: 2079072, 211 | }, 212 | 42: { 213 | city: 'Konya', 214 | cityCode: '42', 215 | population: 2296347, 216 | }, 217 | 43: { 218 | city: 'Kütahya', 219 | cityCode: '43', 220 | population: 580701, 221 | }, 222 | 44: { 223 | city: 'Malatya', 224 | cityCode: '44', 225 | population: 812580, 226 | }, 227 | 45: { 228 | city: 'Manisa', 229 | cityCode: '45', 230 | population: 1468279, 231 | }, 232 | 46: { 233 | city: 'Kahramanmaraş', 234 | cityCode: '46', 235 | population: 1177436, 236 | }, 237 | 47: { 238 | city: 'Mardin', 239 | cityCode: '47', 240 | population: 870374, 241 | }, 242 | 48: { 243 | city: 'Muğla', 244 | cityCode: '48', 245 | population: 1048185, 246 | }, 247 | 49: { 248 | city: 'Muş', 249 | cityCode: '49', 250 | population: 399202, 251 | }, 252 | 50: { 253 | city: 'Nevşehir', 254 | cityCode: '50', 255 | population: 310011, 256 | }, 257 | 51: { 258 | city: 'Niğde', 259 | cityCode: '51', 260 | population: 365419, 261 | }, 262 | 52: { 263 | city: 'Ordu', 264 | cityCode: '52', 265 | population: 763190, 266 | }, 267 | 53: { 268 | city: 'Rize', 269 | cityCode: '53', 270 | population: 344016, 271 | }, 272 | 54: { 273 | city: 'Sakarya', 274 | cityCode: '54', 275 | population: 1080080, 276 | }, 277 | 55: { 278 | city: 'Samsun', 279 | cityCode: '55', 280 | population: 1368488, 281 | }, 282 | 56: { 283 | city: 'Siirt', 284 | cityCode: '56', 285 | population: 331311, 286 | }, 287 | 57: { 288 | city: 'Sinop', 289 | cityCode: '57', 290 | population: 220799, 291 | }, 292 | 58: { 293 | city: 'Sivas', 294 | cityCode: '58', 295 | population: 634924, 296 | }, 297 | 59: { 298 | city: 'Tekirdağ', 299 | cityCode: '59', 300 | population: 1142451, 301 | }, 302 | 60: { 303 | city: 'Tokat', 304 | cityCode: '60', 305 | population: 596454, 306 | }, 307 | 61: { 308 | city: 'Trabzon', 309 | cityCode: '61', 310 | population: 818023, 311 | }, 312 | 62: { 313 | city: 'Tunceli', 314 | cityCode: '62', 315 | population: 84366, 316 | }, 317 | 63: { 318 | city: 'Şanlıurfa', 319 | cityCode: '63', 320 | population: 2170110, 321 | }, 322 | 64: { 323 | city: 'Uşak', 324 | cityCode: '64', 325 | population: 375454, 326 | }, 327 | 65: { 328 | city: 'Van', 329 | cityCode: '65', 330 | population: 1128749, 331 | }, 332 | 66: { 333 | city: 'Yozgat', 334 | cityCode: '66', 335 | population: 418442, 336 | }, 337 | 67: { 338 | city: 'Zonguldak', 339 | cityCode: '67', 340 | population: 588510, 341 | }, 342 | 68: { 343 | city: 'Aksaray', 344 | cityCode: '68', 345 | population: 433055, 346 | }, 347 | 69: { 348 | city: 'Bayburt', 349 | cityCode: '69', 350 | population: 84241, 351 | }, 352 | 70: { 353 | city: 'Karaman', 354 | cityCode: '70', 355 | population: 260838, 356 | }, 357 | 71: { 358 | city: 'Kırıkkale', 359 | cityCode: '71', 360 | population: 277046, 361 | }, 362 | 72: { 363 | city: 'Batman', 364 | cityCode: '72', 365 | population: 634491, 366 | }, 367 | 73: { 368 | city: 'Şırnak', 369 | cityCode: '73', 370 | population: 557605, 371 | }, 372 | 74: { 373 | city: 'Bartın', 374 | cityCode: '74', 375 | population: 203351, 376 | }, 377 | 75: { 378 | city: 'Ardahan', 379 | cityCode: '75', 380 | population: 92481, 381 | }, 382 | 76: { 383 | city: 'Iğdır', 384 | cityCode: '76', 385 | population: 203594, 386 | }, 387 | 77: { 388 | city: 'Yalova', 389 | cityCode: '77', 390 | population: 296333, 391 | }, 392 | 78: { 393 | city: 'Karabük', 394 | cityCode: '78', 395 | population: 252058, 396 | }, 397 | 79: { 398 | city: 'Kilis', 399 | cityCode: '79', 400 | population: 147919, 401 | }, 402 | 80: { 403 | city: 'Osmaniye', 404 | cityCode: '80', 405 | population: 559405, 406 | }, 407 | 81: { 408 | city: 'Düzce', 409 | cityCode: '81', 410 | population: 405131, 411 | }, 412 | 82: { 413 | city: 'KKTC', 414 | cityCode: '82', 415 | population: 888000, 416 | }, 417 | }; 418 | -------------------------------------------------------------------------------- /src/helpers/crawler/helpers.js: -------------------------------------------------------------------------------- 1 | const helpers = require('../../helpers'); 2 | const db = require('../../db'); 3 | const helpers_crawler = require('../index'); 4 | 5 | module.exports.kandilli_models = (data, limit = null) => { 6 | try { 7 | const model_data = []; 8 | const data_length = data.length; 9 | for (let index = 0; index < data_length; index++) { 10 | if (limit && index + 1 > limit) { 11 | break; 12 | } 13 | let rev = null; 14 | data[index]['@_lokasyon'] = data[index]['@_lokasyon'].trim(); 15 | const splitted = data[index]['@_lokasyon'].split(')'); 16 | if (splitted && splitted.length > 2) { 17 | data[index]['@_lokasyon'] = `${splitted[0]})`; 18 | rev = `${splitted[1]})`.trim(); 19 | } 20 | data[index]['@_lng'] = parseFloat(data[index]['@_lng']); 21 | data[index]['@_lat'] = parseFloat(data[index]['@_lat']); 22 | model_data.push({ 23 | earthquake_id: db.MongoDB.id(), 24 | provider: 'kandilli', 25 | title: data[index]['@_lokasyon'], 26 | date: data[index]['@_name'], 27 | mag: parseFloat(data[index]['@_mag']), 28 | depth: parseFloat(data[index]['@_Depth']), 29 | geojson: { 30 | type: 'Point', 31 | coordinates: [data[index]['@_lng'], data[index]['@_lat']], 32 | }, 33 | location_properties: helpers_crawler.earthquakes.location_properties(data[index]['@_lng'], data[index]['@_lat']), 34 | rev, 35 | date_time: helpers.date.moment.moment(data[index]['@_name'], 'Y.M.D HH:mm:ss').format('YYYY-MM-DD HH:mm:ss'), 36 | created_at: parseInt(helpers.date.moment.moment(data[index]['@_name'], 'Y.M.D HH:mm:ss').format('X'), 10), 37 | location_tz: 'Europe/Istanbul', 38 | }); 39 | } 40 | return { data: model_data, metadata: { total: data.length } }; 41 | } catch (error) { 42 | console.error(error); 43 | return false; 44 | } 45 | }; 46 | -------------------------------------------------------------------------------- /src/helpers/crawler/index.js: -------------------------------------------------------------------------------- 1 | module.exports.kandilli = require('./kandilli'); 2 | module.exports.helpers = require('./helpers'); 3 | -------------------------------------------------------------------------------- /src/helpers/crawler/kandilli.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const { XMLParser } = require('fast-xml-parser'); 3 | const helpers_crawler = require('./helpers'); 4 | const helpers = require('../../helpers'); 5 | const constants = require('../../constants'); 6 | 7 | const alwaysArray = ['earhquake.eqlist']; 8 | 9 | module.exports.get = async (limit = null) => { 10 | const parser = new XMLParser({ 11 | ignoreAttributes: false, 12 | ignoreDeclaration: true, 13 | ignorePiTags: true, 14 | attributeNamePrefix: '@_', 15 | isArray: (name, jpath) => { 16 | if (alwaysArray.indexOf(jpath) !== -1) return true; 17 | }, 18 | }); 19 | const response = await axios.get(`${process.env.KANDILLI_XML}?v=${helpers.date.moment.timestampMS()}`); 20 | if (!response || !response.data) { 21 | throw new constants.errors.ServerError('helpers.crawler.get', 'Kandilli fetch error !'); 22 | } 23 | const data = parser.parse(response.data); 24 | if (!data.eqlist || !data.eqlist.earhquake) { 25 | throw new constants.errors.ServerError('helpers.crawler.get', 'Kandilli data error !'); 26 | } 27 | if (!Array.isArray(data.eqlist.earhquake)) { 28 | throw new constants.errors.ServerError('helpers.crawler.get', 'Kandilli data is not array error !'); 29 | } 30 | return helpers_crawler.kandilli_models(data.eqlist.earhquake.reverse(), limit); 31 | }; 32 | 33 | module.exports.getByDate = async (date) => { 34 | const parser = new XMLParser({ 35 | ignoreAttributes: false, 36 | ignoreDeclaration: true, 37 | ignorePiTags: true, 38 | attributeNamePrefix: '@_', 39 | isArray: (name, jpath) => { 40 | if (alwaysArray.indexOf(jpath) !== -1) return true; 41 | }, 42 | }); 43 | const response = await axios.get(`${process.env.KANDILLI_DATE_XML}${date}.xml?v=${helpers.date.moment.timestampMS()}`); 44 | if (!response || !response.data) { 45 | throw new constants.errors.ServerError('helpers.crawler.getByDate', 'Kandilli fetch error !'); 46 | } 47 | const data = parser.parse(response.data); 48 | if (!data.eqlist || !data.eqlist.earhquake) { 49 | throw new constants.errors.ServerError('helpers.crawler.getByDate', 'Kandilli data error !'); 50 | } 51 | if (!Array.isArray(data.eqlist.earhquake)) { 52 | throw new constants.errors.ServerError('helpers.crawler.getByDate', 'Kandilli data is not array error !'); 53 | } 54 | return helpers_crawler.kandilli_models(data.eqlist.earhquake.reverse()); 55 | }; 56 | -------------------------------------------------------------------------------- /src/helpers/date/index.js: -------------------------------------------------------------------------------- 1 | // const kk_date = require('kk-date'); 2 | // kk_date.caching({ status: true }); 3 | // kk_date.config({ timezone: 'Europe/Istanbul', locale: 'tr' }); 4 | module.exports.moment = require('./moment'); 5 | // module.exports.kk_date = kk_date; 6 | -------------------------------------------------------------------------------- /src/helpers/date/moment.js: -------------------------------------------------------------------------------- 1 | const moment = require('moment-timezone'); 2 | const constants = require('./../../constants'); 3 | const helpers = require('./../../helpers'); 4 | /** 5 | * get timestamp 6 | * 7 | * @returns {Number} 8 | */ 9 | module.exports.timestamp = () => { 10 | return parseInt(moment().format('X'), 10); 11 | }; 12 | 13 | /** 14 | * get timestamp ms 15 | * 16 | * @returns {Number} 17 | */ 18 | module.exports.timestampMS = () => { 19 | return parseInt(moment().format('x'), 10); 20 | }; 21 | 22 | /** 23 | * moment object 24 | * 25 | * @param {...any} args 26 | * @returns 27 | */ 28 | module.exports.moment = (...args) => { 29 | return moment(...args); 30 | }; 31 | 32 | module.exports.isValid = (date, format = 'YYYYMMDD') => { 33 | return moment(date, format, true).isValid(); 34 | }; 35 | 36 | module.exports.timeCategory = (time, timeFormat = 'HH:mm:ss') => { 37 | if ( 38 | time.isBetween(moment('00:00:00', timeFormat), moment('04:59:59', timeFormat)) || 39 | time.isSame(moment('00:00:00', timeFormat)) || 40 | time.isSame(moment('04:59:59', timeFormat)) 41 | ) { 42 | return constants.stopTimes.TIME_CATEGORIES.DAWN; 43 | } 44 | if ( 45 | time.isBetween(moment('05:00:00', timeFormat), moment('11:59:59', timeFormat)) || 46 | time.isSame(moment('05:00:00', timeFormat)) || 47 | time.isSame(moment('11:59:59', timeFormat)) 48 | ) { 49 | return constants.stopTimes.TIME_CATEGORIES.MORNING; 50 | } 51 | if ( 52 | time.isBetween(moment('12:00:00', timeFormat), moment('16:59:59', timeFormat)) || 53 | time.isSame(moment('12:00:00', timeFormat)) || 54 | time.isSame(moment('16:59:59', timeFormat)) 55 | ) { 56 | return constants.stopTimes.TIME_CATEGORIES.NOON; 57 | } 58 | if ( 59 | time.isBetween(moment('17:00:00', timeFormat), moment('23:59:59', timeFormat)) || 60 | time.isSame(moment('17:00:00', timeFormat)) || 61 | time.isSame(moment('23:59:59', timeFormat)) 62 | ) { 63 | return constants.stopTimes.TIME_CATEGORIES.NIGHT; 64 | } 65 | }; 66 | 67 | /** 68 | * get date ranges 69 | * 70 | * @param {string} start 71 | * @param {string} end 72 | * @param {string} fomat 73 | * @returns 74 | */ 75 | module.exports.dateRanges = (start, end, format = 'YYYY-MM-DD') => { 76 | try { 77 | const range = moment(end).diff(moment(start).format(format), 'days'); 78 | const rangeDates = []; 79 | rangeDates.push(moment(start).format(format)); 80 | for (let index = 0; index < range; index++) { 81 | const date = moment(start) 82 | .add({ days: index + 1 }) 83 | .format(format); 84 | rangeDates.push(date); 85 | } 86 | return rangeDates; 87 | } catch (error) { 88 | helpers.error.logger(error); 89 | return false; 90 | } 91 | }; 92 | 93 | /** 94 | * get date ranges filter with service_id 95 | * 96 | * @param {string} start 97 | * @param {string} end 98 | * @param {array} service_id { "monday": "0", "tuesday": "0", "wednesday": "0" ... } 99 | * @param {string} format 100 | * @returns 101 | */ 102 | module.exports.dateRangesWithService = (start, end, service_id = {}, format = 'YYYY-MM-DD') => { 103 | try { 104 | const range = moment(end).diff(moment(start).format(format), 'days'); 105 | const rangeDates = []; 106 | if (service_id[moment(start).format('dddd').toLowerCase()]) { 107 | rangeDates.push(moment(start).format(format)); 108 | } 109 | for (let index = 0; index < range; index++) { 110 | const date = moment(start).add({ days: index + 1 }); 111 | if (service_id[date.format('dddd').toLowerCase()] === '1') { 112 | rangeDates.push(date.format(format)); 113 | } 114 | } 115 | return rangeDates; 116 | } catch (error) { 117 | helpers.error.logger(error); 118 | return false; 119 | } 120 | }; 121 | -------------------------------------------------------------------------------- /src/helpers/earthquakes.js: -------------------------------------------------------------------------------- 1 | const db = require('../db'); 2 | const turf = require('@turf/turf'); 3 | 4 | module.exports.location_properties = (lng, lat) => { 5 | const turfPoint = turf.point([lng, lat]); 6 | 7 | function locations(turfPoint) { 8 | let closestPoly = { properties: { name: null } }; 9 | let epiCenter = { properties: { name: null } }; 10 | let closestCities = []; 11 | const locations_geojson_length = db.locations.geojsons.length; 12 | for (let index = 0; index < locations_geojson_length; index++) { 13 | const turf_polf = turf.polygon(db.locations.geojsons[index].coordinates, { 14 | name: db.locations.geojsons[index].name, 15 | cityCode: db.locations.geojsons[index].number, 16 | }); 17 | const pointOnPoly = turf.pointOnFeature(turf_polf.geometry.coordinates); 18 | const isInside = turf.booleanPointInPolygon(turfPoint, turf_polf.geometry.coordinates); 19 | const distance = turf.distance(turfPoint, pointOnPoly, { 20 | units: 'meters', 21 | }); 22 | if (!isInside) { 23 | closestPoly = turf_polf; 24 | closestPoly.properties.distance = distance; 25 | closestPoly.properties.population = db.populations[db.locations.geojsons[index].number] 26 | ? db.populations[db.locations.geojsons[index].number].population 27 | : null; 28 | if (closestPoly.properties.cityCode !== -1) { 29 | closestCities.push(closestPoly.properties); 30 | } 31 | } 32 | if (isInside) { 33 | epiCenter = turf_polf; 34 | epiCenter.properties.population = db.populations[db.locations.geojsons[index].number] 35 | ? db.populations[db.locations.geojsons[index].number].population 36 | : null; 37 | } 38 | } 39 | 40 | closestCities = closestCities.sort((a, b) => { 41 | return a.distance - b.distance; 42 | }); 43 | return { 44 | closestCity: closestCities[0], 45 | epiCenter: epiCenter.properties, 46 | closestCities: closestCities.slice(0, 5), 47 | }; 48 | } 49 | 50 | function airports(turfPoint) { 51 | const airports = []; 52 | const airports_length = db.locations.airports.length; 53 | for (let index = 0; index < airports_length; index++) { 54 | const turf_polf = turf.polygon(db.locations.airports[index].coordinates, { 55 | name: db.locations.airports[index].name, 56 | code: db.locations.airports[index].code, 57 | }); 58 | const pointOnPoly = turf.pointOnFeature(turf_polf.geometry.coordinates); 59 | const distance = turf.distance(turfPoint, pointOnPoly, { 60 | units: 'meters', 61 | }); 62 | airports.push({ 63 | distance, 64 | name: db.locations.airports[index].name, 65 | code: db.locations.airports[index].code, 66 | coordinates: db.locations.airports[index].coordinates, 67 | }); 68 | } 69 | 70 | return airports 71 | .sort((a, b) => { 72 | return a.distance - b.distance; 73 | }) 74 | .slice(0, 3); 75 | } 76 | return { ...locations(turfPoint), airports: airports(turfPoint) }; 77 | }; 78 | -------------------------------------------------------------------------------- /src/helpers/index.js: -------------------------------------------------------------------------------- 1 | module.exports.crawler = require('./crawler'); 2 | module.exports.date = require('./date'); 3 | module.exports.earthquakes = require('./earthquakes'); 4 | const kk_date = require('kk-date'); 5 | kk_date.caching({ status: true, defaultTtl: 14400 }); 6 | kk_date.config({ timezone: 'Europe/Istanbul' }); 7 | 8 | module.exports.kk_date = kk_date; 9 | 10 | /** 11 | * meter to radius 12 | * 13 | * @param {number} meter 14 | * @returns {Number} 15 | */ 16 | module.exports.metersToRadios = (meter = 0) => { 17 | try { 18 | const meters = parseInt(meter, 10); 19 | if (Number.isNaN(meter)) { 20 | return false; 21 | } 22 | return (meters * 0.0006213712) / 3963.2; 23 | } catch (error) { 24 | console.error(error); 25 | return false; 26 | } 27 | }; 28 | -------------------------------------------------------------------------------- /src/middlewares/cron.js: -------------------------------------------------------------------------------- 1 | const constants = require('../constants'); 2 | 3 | /** 4 | * This middleware for auth mechanism. 5 | */ 6 | module.exports = async (req, res, next) => { 7 | const response = constants.response(); 8 | 9 | try { 10 | if (!req.headers.authorization) { 11 | throw new constants.errors.Forbidden('middlewares.cron', 'authorization not found !'); 12 | } 13 | 14 | if (req.headers.authorization !== constants.CONFIG.CRON_KEY) { 15 | throw new constants.errors.UnAuth('middlewares.cron', 'authorization invalid !'); 16 | } 17 | 18 | return next(); 19 | } catch (error) { 20 | console.error(error); 21 | response.desc = error.message || ''; 22 | response.status = false; 23 | response.httpStatus = error.httpStatus || 500; 24 | return res.status(response.httpStatus).json(response); 25 | } 26 | }; 27 | -------------------------------------------------------------------------------- /src/middlewares/index.js: -------------------------------------------------------------------------------- 1 | module.exports.swagger = require('./swagger'); 2 | module.exports.cron = require('./cron'); 3 | module.exports.stats = require('./stats'); 4 | -------------------------------------------------------------------------------- /src/middlewares/stats.js: -------------------------------------------------------------------------------- 1 | const constants = require('../constants'); 2 | 3 | /** 4 | * This middleware for auth mechanism. 5 | */ 6 | module.exports = async (req, res, next) => { 7 | const response = constants.response(); 8 | 9 | try { 10 | if (!req.headers.authorization) { 11 | throw new constants.errors.Forbidden('middlewares.stats', 'authorization not found !'); 12 | } 13 | 14 | if (req.headers.authorization !== constants.CONFIG.STATS_KEY) { 15 | throw new constants.errors.UnAuth('middlewares.stats', 'authorization invalid !'); 16 | } 17 | 18 | return next(); 19 | } catch (error) { 20 | console.error(error); 21 | response.desc = error.message || ''; 22 | response.status = false; 23 | response.httpStatus = error.httpStatus || 500; 24 | return res.status(response.httpStatus).json(response); 25 | } 26 | }; 27 | -------------------------------------------------------------------------------- /src/middlewares/swagger.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable indent */ 2 | module.exports = { 3 | openapi: '3.0.0', 4 | info: { 5 | version: '1.0.0', 6 | title: 'Kandilli Rasathanesi Swagger document', 7 | description: 8 | 'Kandilli Rasathanesi\'nin yayınladığı son depremler listesi için API. (last minute earthquakes in turkey parsing from Kandilli Observatory XML)\nTicari amaçlı kullanmak isteyenlere: "Söz konusu bilgi, veri ve haritalar Boğaziçi Üniversitesi Rektörlüğü’nün yazılı izni ve onayı olmadan herhangi bir şekilde ticari amaçlı kullanılamaz." - İsteklerinizi veya sorularınızı info@orhanaydogdu.com.tr den iletebilirsiniz.', 9 | }, 10 | security: { 11 | HeaderAuthCron: { 12 | type: 'apiKey', 13 | in: 'header', 14 | name: 'Authorization', 15 | }, 16 | HeaderAuthStats: { 17 | type: 'apiKey', 18 | in: 'header', 19 | name: 'Authorization', 20 | }, 21 | }, 22 | baseDir: __dirname, 23 | filesPattern: '../routes/**/*.js', 24 | notRequiredAsNullable: false, 25 | exposeApiDocs: true, 26 | exposeSwaggerUI: true, 27 | swaggerUIPath: '/deprem/api-docs', 28 | apiDocsPath: '/deprem/api-docs-download.json', 29 | swaggerUiOptions: { 30 | swaggerOptions: { 31 | persistAuthorization: true, 32 | }, 33 | }, 34 | }; 35 | -------------------------------------------------------------------------------- /src/repositories/data/index.js: -------------------------------------------------------------------------------- 1 | const db = require('../../db'); 2 | 3 | module.exports.stats = require('./stats'); 4 | 5 | module.exports.search = async (match = null, geoNear = null, sort = null, skip = null, limit = null, project = null) => { 6 | const agg = []; 7 | agg.push({ $match: geoNear ? { ...match, ...geoNear } : match }); 8 | 9 | if (sort) { 10 | agg.push({ $sort: sort }); 11 | } 12 | if (skip && skip > 0) { 13 | agg.push({ $skip: skip }); 14 | } 15 | if (limit && limit > 0) { 16 | agg.push({ $limit: limit }); 17 | } 18 | if (project) { 19 | agg.push({ $project: project }); 20 | } 21 | const query = await new db.MongoDB.CRUD('earthquake', 'data_v2').aggregate(agg); 22 | if (query.length > 0) { 23 | return query; 24 | } 25 | return []; 26 | }; 27 | 28 | module.exports.get = async (earthquake_id, project = {}) => { 29 | try { 30 | const query = await new db.MongoDB.CRUD('earthquake', 'data_v2').find({ earthquake_id }, [0, 1], project); 31 | if (query.length > 0) { 32 | return query[0]; 33 | } 34 | return null; 35 | } catch (error) { 36 | console.error(error); 37 | return false; 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /src/repositories/data/stats.js: -------------------------------------------------------------------------------- 1 | const db = require('../../db'); 2 | 3 | module.exports.dateBy = async (match) => { 4 | return await new db.MongoDB.CRUD('earthquake', 'data_v2').aggregate([ 5 | { 6 | $match: match, 7 | }, 8 | { 9 | $addFields: { 10 | date_time: { 11 | $dateFromString: { 12 | dateString: '$date_time', 13 | format: '%Y-%m-%d %H:%M:%S', 14 | }, 15 | }, 16 | }, 17 | }, 18 | { 19 | $group: { 20 | _id: { 21 | $dateToString: { 22 | format: '%Y-%m-%d', 23 | date: '$date_time', 24 | }, 25 | }, 26 | total: { 27 | $sum: 1, 28 | }, 29 | }, 30 | }, 31 | { 32 | $sort: { total: -1 }, 33 | }, 34 | ]); 35 | }; 36 | 37 | module.exports.hourBy = async (match) => { 38 | return await new db.MongoDB.CRUD('earthquake', 'data_v2').aggregate([ 39 | { 40 | $match: match, 41 | }, 42 | { 43 | $addFields: { 44 | date_time: { 45 | $dateFromString: { 46 | dateString: '$date_time', 47 | format: '%Y-%m-%d %H:%M:%S', 48 | }, 49 | }, 50 | }, 51 | }, 52 | { 53 | $group: { 54 | _id: { 55 | $dateToString: { 56 | format: '%H', 57 | date: '$date_time', 58 | }, 59 | }, 60 | total: { 61 | $sum: 1, 62 | }, 63 | }, 64 | }, 65 | { 66 | $sort: { total: -1 }, 67 | }, 68 | ]); 69 | }; 70 | 71 | module.exports.epiCenterBy = async (match) => { 72 | return await new db.MongoDB.CRUD('earthquake', 'data_v2').aggregate([ 73 | { 74 | $match: match, 75 | }, 76 | { 77 | $group: { 78 | _id: '$location_properties.epiCenter.name', 79 | total: { 80 | $sum: 1, 81 | }, 82 | }, 83 | }, 84 | { 85 | $sort: { 86 | total: -1, 87 | }, 88 | }, 89 | { 90 | $limit: 5, 91 | }, 92 | ]); 93 | }; 94 | 95 | module.exports.magBy = async (match) => { 96 | return await new db.MongoDB.CRUD('earthquake', 'data_v2').aggregate([ 97 | { 98 | $match: match, 99 | }, 100 | { 101 | $group: { 102 | _id: { $toInt: '$mag' }, 103 | total: { 104 | $sum: 1, 105 | }, 106 | epiCenter: { 107 | $addToSet: '$location_properties.epiCenter.name', 108 | }, 109 | }, 110 | }, 111 | { 112 | $sort: { 113 | total: -1, 114 | }, 115 | }, 116 | ]); 117 | }; 118 | 119 | module.exports.airportsBy = async (match) => { 120 | return await new db.MongoDB.CRUD('earthquake', 'data_v2').aggregate([ 121 | { 122 | $match: match, 123 | }, 124 | { 125 | $group: { 126 | _id: { $first: '$location_properties.airports.name' }, 127 | total: { 128 | $sum: 1, 129 | }, 130 | }, 131 | }, 132 | { 133 | $sort: { 134 | total: -1, 135 | }, 136 | }, 137 | { 138 | $limit: 5, 139 | }, 140 | ]); 141 | }; 142 | 143 | module.exports.epiCenters = () => { 144 | const result = []; 145 | const locations_geojson_length = db.locations.geojsons.length; 146 | for (let index = 0; index < locations_geojson_length; index++) { 147 | result.push({ 148 | city: db.locations.geojsons[index].name, 149 | cityCode: db.locations.geojsons[index].number, 150 | population: db.populations[db.locations.geojsons[index].number]?.population, 151 | }); 152 | } 153 | return result.sort((a, b) => { 154 | const nameA = a.city.toUpperCase(); // ignore upper and lowercase 155 | const nameB = b.city.toUpperCase(); // ignore upper and lowercase 156 | if (nameA < nameB) { 157 | return -1; 158 | } 159 | if (nameA > nameB) { 160 | return 1; 161 | } 162 | // names must be equal 163 | return 0; 164 | }); 165 | }; 166 | 167 | module.exports.dateByEarthQuakes = async (match) => { 168 | return await new db.MongoDB.CRUD('earthquake', 'data_v2').aggregate([ 169 | { 170 | $match: match, 171 | }, 172 | { 173 | $addFields: { 174 | date_time: { 175 | $dateFromString: { 176 | dateString: '$date_time', 177 | format: '%Y-%m-%d %H:%M:%S', 178 | }, 179 | }, 180 | }, 181 | }, 182 | { 183 | $group: { 184 | _id: { 185 | $dateToString: { 186 | format: '%Y-%m-%d', 187 | date: '$date_time', 188 | }, 189 | }, 190 | total: { 191 | $sum: 1, 192 | }, 193 | data: { 194 | $push: { 195 | earthquake_id: '$earthquake_id', 196 | mag: '$mag', 197 | geojson: '$geojson', 198 | title: '$title', 199 | date_time: '$date_time', 200 | location_properties_epiCenter_name: '$location_properties.epiCenter.name', 201 | }, 202 | }, 203 | }, 204 | }, 205 | { 206 | $sort: { _id: 1 }, 207 | }, 208 | ]); 209 | }; 210 | -------------------------------------------------------------------------------- /src/repositories/index.js: -------------------------------------------------------------------------------- 1 | module.exports.kandilli = require('./kandilli'); 2 | module.exports.data = require('./data'); 3 | module.exports.rate = require('./rate'); 4 | -------------------------------------------------------------------------------- /src/repositories/kandilli/index.js: -------------------------------------------------------------------------------- 1 | const db = require('../../db'); 2 | const helpers = require('../../helpers'); 3 | const constants = require('../../constants'); 4 | 5 | module.exports.multiSave = async (data, collection = 'data_v2') => { 6 | if (data.length < 1) { 7 | return true; 8 | } 9 | const mustInsert = []; 10 | const data_length = data.length; 11 | for (let index = 0; index < data_length; index++) { 12 | if (Number.isNaN(data[index].mag)) { 13 | continue; 14 | } 15 | const find = await this.checkIsInserted( 16 | data[index].date_time, 17 | data[index].mag, 18 | data[index].depth, 19 | data[index].geojson.coordinates[0], 20 | data[index].geojson.coordinates[1], 21 | ); 22 | if (find === false) { 23 | mustInsert.push(data[index]); 24 | } 25 | } 26 | if (mustInsert.length < 1) { 27 | return true; 28 | } 29 | await new db.MongoDB.CRUD('earthquake', collection).insertMany(mustInsert); 30 | return true; 31 | }; 32 | 33 | module.exports.checkIsInserted = async (date_time, mag, depth, lng, lat) => { 34 | const query = await new db.MongoDB.CRUD('earthquake', 'data_v2').find( 35 | { 36 | date_time, 37 | mag, 38 | depth, 39 | 'geojson.coordinates.0': lng, 40 | 'geojson.coordinates.1': lat, 41 | }, 42 | [0, 1], 43 | { _id: false, date_time: true }, 44 | ); 45 | if (query.length > 0) { 46 | return true; 47 | } 48 | return false; 49 | }; 50 | 51 | module.exports.update = async (earhquake_id, update) => { 52 | return await new db.MongoDB.CRUD('earthquake', 'data_v2').update({ earhquake_id }, { $set: update }); 53 | }; 54 | 55 | module.exports.list = async ( 56 | date_starts = helpers.date.moment.moment().tz('Europe/Istanbul').add(-24, 'hours').format('YYYY-MM-DD HH:mm:ss'), 57 | date_ends = helpers.date.moment.moment().tz('Europe/Istanbul').format('YYYY-MM-DD HH:mm:ss'), 58 | skip = 0, 59 | limit = 0, 60 | sort = null, 61 | ) => { 62 | const match = { date_time: { $gte: date_starts, $lte: date_ends } }; 63 | const agg = []; 64 | const agg2 = []; 65 | agg2.push({ $match: match }); 66 | if (sort) { 67 | agg2.push({ $sort: sort }); 68 | } 69 | if (skip > 0) { 70 | agg.push({ $skip: skip }); 71 | } 72 | if (limit > 0) { 73 | agg.push({ $limit: limit }); 74 | } 75 | const query = await new db.MongoDB.CRUD('earthquake', 'data_v2').aggregate([ 76 | ...agg2, 77 | { 78 | $facet: { 79 | data: agg, 80 | metadata: [{ $count: 'total' }], 81 | }, 82 | }, 83 | ]); 84 | if (query.length > 0) { 85 | return query[0]; 86 | } 87 | return { data: [], metadata: [] }; 88 | }; 89 | -------------------------------------------------------------------------------- /src/repositories/rate/index.js: -------------------------------------------------------------------------------- 1 | const db = require('../../db'); 2 | const helpers = require('../../helpers'); 3 | const constants = require('../../constants'); 4 | 5 | module.exports.check = async (ip) => { 6 | if (constants.CONFIG.BYPASS_IPS.includes(ip)) { 7 | return true; 8 | } 9 | const count = await this.count(ip); 10 | this.delete(); 11 | if (count >= 40) { 12 | throw new constants.errors.TooManyRequest( 13 | 'repositories.rate.check', 14 | 'Too Many Request in 1 minute! Requests limited in 1 minute maximum 40 times', 15 | ); 16 | } 17 | this.save(ip); 18 | return true; 19 | }; 20 | 21 | module.exports.count = async (ip) => { 22 | return await new db.MongoDB.CRUD('earthquake', 'requests').count({ 23 | ip: `${ip}`, 24 | created_at: { $gte: new helpers.kk_date().add(-1, 'minutes').format('X') }, 25 | }); 26 | }; 27 | 28 | module.exports.save = async (ip) => { 29 | await new db.MongoDB.CRUD('earthquake', 'requests').insert({ 30 | ip: `${ip}`, 31 | created_at: new helpers.kk_date().format('X'), 32 | }); 33 | return true; 34 | }; 35 | 36 | module.exports.delete = async () => { 37 | new db.MongoDB.CRUD('earthquake', 'requests').delete({ created_at: { $lte: new helpers.kk_date().add(-1, 'minutes').format('X') } }); 38 | return true; 39 | }; 40 | 41 | module.exports.stats = async () => { 42 | const result = { 43 | total_request_ip: 0, 44 | total_request: 0, 45 | }; 46 | const data = await new db.MongoDB.CRUD('earthquake', 'requests').aggregate([ 47 | { 48 | $group: { 49 | _id: '$ip', 50 | total: { 51 | $sum: 1, 52 | }, 53 | }, 54 | }, 55 | { 56 | $group: { 57 | _id: null, 58 | total_ip: { 59 | $sum: 1, 60 | }, 61 | total: { 62 | $sum: '$total', 63 | }, 64 | }, 65 | }, 66 | ]); 67 | if (data.length > 0) { 68 | result.total_request_ip = data[0].total_ip; 69 | result.total_request = data[0].total; 70 | } 71 | return result; 72 | }; 73 | -------------------------------------------------------------------------------- /src/routes/data/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const services = require('../../services'); 4 | const controller = require('../../controller'); 5 | const middlewares = require('../../middlewares'); 6 | 7 | /** 8 | * DataSearchMatch defination 9 | * @typedef {object} DataSearchGeoNear 10 | * @property {number} lon.required - earthquake geonear longitude 11 | * @property {number} lat.required - earthquake geonear latitude 12 | * @property {number} radiusMeter - earthquake geonear search radiusMeter 13 | */ 14 | 15 | /** 16 | * DataSearchMatch defination 17 | * @typedef {object} DataSearchMatch 18 | * @property {number} mag - earthquake magnitude 19 | * @property {string} date_starts - earthquake starts at YYYY-MM-DD HH:mm:ss 20 | * @property {string} date_ends - earthquake ends at YYYY-MM-DD HH:mm:ss 21 | * @property {number} cityCode - city code from statics/cities 22 | */ 23 | 24 | /** 25 | * data search defination 26 | * @typedef {object} DataSearch 27 | * @property {DataSearchMatch} match - match 28 | * @property {DataSearchGeoNear} geoNear - geoNeaer 29 | * @property {string} sort - sorting {date_1, date_-1, mag_1, mag_-1} 30 | * @property {number} skip - skip 31 | * @property {number} limit - limit 32 | */ 33 | 34 | /** 35 | * POST /deprem/data/search 36 | * @param {DataSearch} request.body.required - data search body 37 | * @summary api earthquakes search endpoint 38 | * @tags DATA 39 | * @return {object} 200 - success response - application/json 40 | * @return {object} 500 - Server error - application/json 41 | */ 42 | router.post('/search', [controller.data.search], services.data.search); 43 | 44 | /** 45 | * GET /deprem/data/get 46 | * @param {string} earthquake_id.query - earthquake_id 47 | * @summary api earthquakes get endpoint 48 | * @tags DATA 49 | * @return {object} 200 - success response - application/json 50 | * @return {object} 500 - Server error - application/json 51 | */ 52 | router.get('/get', [controller.data.get], services.data.get); 53 | 54 | /** 55 | * data statsGeneral defination 56 | * @typedef {object} DataStatsGeneral 57 | * @property {string} range - range 58 | * @property {string} provider - kandilli / afad 59 | */ 60 | 61 | /** 62 | * POST /deprem/data/stats/general 63 | * @param {DataStatsGeneral} request.body.required - data stats/general body 64 | * @summary api earthquakes statsGeneral endpoint 65 | * @security HeaderAuthStats 66 | * @tags DATA 67 | * @return {object} 200 - success response - application/json 68 | * @return {object} 500 - Server error - application/json 69 | */ 70 | router.post('/stats/general', [middlewares.stats, controller.data.statsGeneral], services.data.statsGeneral); 71 | 72 | module.exports = router; 73 | -------------------------------------------------------------------------------- /src/routes/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const db = require('../db'); 3 | const router = express.Router(); 4 | 5 | const services = require('../services'); 6 | const controller = require('../controller'); 7 | const repositories = require('../repositories'); 8 | const constants = require('../constants'); 9 | 10 | const int = require('./int'); 11 | const kandilli = require('./kandilli'); 12 | const statics = require('./statics'); 13 | const data = require('./data'); 14 | 15 | router.use('/deprem/int', int); 16 | router.use('/deprem/kandilli', kandilli); 17 | router.use('/deprem/statics', statics); 18 | router.use('/deprem/data', data); 19 | 20 | /** 21 | * GET /deprem/status 22 | * @summary api STATUS 23 | * @tags INT 24 | * @return {object} 200 - success response - application/json 25 | * @return {object} 500 - Server error - application/json 26 | */ 27 | router.get('/deprem/status', async (req, res) => { 28 | const response = constants.response(); 29 | response.desc = 'kandilli son depremler api service'; 30 | response.stats = await repositories.rate.stats(); 31 | response.nopeRedis = db.nopeRedis.stats({ showKeys: false, showTotal: true, showSize: true }); 32 | return res.json(response); 33 | }); 34 | 35 | /** 36 | * !!!! It has been added for compatibility for those using the old endpoint !!!! 37 | * !!!! WILL BE DISABLED IN TIME !!!! 38 | */ 39 | router.get('/deprem/', [controller.kandilli.live], services.kandilli.live); 40 | router.get('/deprem/live.php', [controller.kandilli.live], services.kandilli.live); 41 | router.get('/deprem/index.php', [controller.kandilli.live], services.kandilli.live); 42 | 43 | module.exports = router; 44 | -------------------------------------------------------------------------------- /src/routes/int/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const services = require('../../services'); 4 | const middlewares = require('../../middlewares'); 5 | 6 | /** 7 | * GET /deprem/int/earthquakes 8 | * @summary api earthquakes save endpoint for cron 9 | * @tags INT 10 | * @security HeaderAuthCron 11 | * @return {object} 200 - success response - application/json 12 | * @return {object} 500 - Server error - application/json 13 | */ 14 | router.get('/earthquakes', [middlewares.cron], services.int.earthquakes); 15 | 16 | module.exports = router; 17 | -------------------------------------------------------------------------------- /src/routes/kandilli/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const services = require('../../services'); 4 | const controller = require('../../controller'); 5 | 6 | /** 7 | * GET /deprem/kandilli/live 8 | * @param {number} skip.query - skip param skip 9 | * @param {number} limit.query - limit param limit 10 | * @summary api earthquakes live endpoint from kandilli 11 | * @tags KANDILLI 12 | * @return {object} 200 - success response - application/json 13 | * @return {object} 500 - Server error - application/json 14 | */ 15 | router.get('/live', [controller.kandilli.live], services.kandilli.live); 16 | 17 | /** 18 | * GET /deprem/kandilli/archive 19 | * @param {number} skip.query - limit param limit 20 | * @param {number} limit.query - limit param limit 21 | * @param {string} date.query.required - date param YYYY-MM-DD 22 | * @param {string} date_end.query - date end param YYYY-MM-DD 23 | * @summary api earthquakes archive endpoint from kandilli 24 | * @tags KANDILLI 25 | * @return {object} 200 - success response - application/json 26 | * @return {object} 500 - Server error - application/json 27 | */ 28 | router.get('/archive', [controller.kandilli.archive], services.kandilli.archive); 29 | 30 | module.exports = router; 31 | -------------------------------------------------------------------------------- /src/routes/statics/index.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const router = express.Router(); 3 | const services = require('../../services'); 4 | 5 | /** 6 | * GET /deprem/statics/cities 7 | * @summary cities endpoint 8 | * @tags STATICS 9 | * @security HeaderAuthCron 10 | * @return {object} 200 - success response - application/json 11 | * @return {object} 500 - Server error - application/json 12 | */ 13 | router.get('/cities', services.statics.cities); 14 | 15 | module.exports = router; 16 | -------------------------------------------------------------------------------- /src/services/data/get.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-inner-declarations */ 2 | const helpers = require('../../helpers'); 3 | const db = require('../../db'); 4 | const repositories = require('../../repositories'); 5 | const constants = require('../../constants'); 6 | 7 | module.exports = async (req, res) => { 8 | const responseBody = constants.response(); 9 | try { 10 | const key = `data/earthquake/${req.query.earthquake_id}`; 11 | const cache = db.nopeRedis.getItem(key); 12 | if (cache) { 13 | responseBody.result = cache; 14 | responseBody.httpStatus = 200; 15 | } else { 16 | const query = await repositories.data.get(req.query.earthquake_id); 17 | if (query) { 18 | responseBody.httpStatus = 200; 19 | responseBody.result = query; 20 | } 21 | db.nopeRedis.setItem(key, query, 60 * 60 * 24); 22 | } 23 | } catch (error) { 24 | console.error(error); 25 | responseBody.desc = error.message || ''; 26 | responseBody.status = false; 27 | responseBody.httpStatus = 500; 28 | } 29 | responseBody.serverloadms = helpers.date.moment.timestampMS() - responseBody.serverloadms; 30 | return res.status(responseBody.httpStatus).json(responseBody); 31 | }; 32 | -------------------------------------------------------------------------------- /src/services/data/index.js: -------------------------------------------------------------------------------- 1 | module.exports.search = require('./search'); 2 | module.exports.get = require('./get'); 3 | module.exports.statsGeneral = require('./statsGeneral'); 4 | -------------------------------------------------------------------------------- /src/services/data/search.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-inner-declarations */ 2 | const helpers = require('../../helpers'); 3 | const repositories = require('../../repositories'); 4 | const constants = require('../../constants'); 5 | 6 | module.exports = async (req, res) => { 7 | const responseBody = constants.response(); 8 | 9 | try { 10 | const data = await repositories.data.search(req.body.match, req.body.geoNear, req.body.sort, req.body.skip, req.body.limit, null); 11 | responseBody.result = data; 12 | } catch (error) { 13 | console.error(error); 14 | responseBody.desc = error.message || ''; 15 | responseBody.status = false; 16 | responseBody.httpStatus = 500; 17 | } 18 | responseBody.serverloadms = helpers.date.moment.timestampMS() - responseBody.serverloadms; 19 | return res.status(responseBody.httpStatus).json(responseBody); 20 | }; 21 | -------------------------------------------------------------------------------- /src/services/data/statsGeneral.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-inner-declarations */ 2 | const helpers = require('../../helpers'); 3 | const constants = require('../../constants'); 4 | const db = require('../../db'); 5 | const repositories = require('../../repositories'); 6 | 7 | module.exports = async (req, res) => { 8 | const responseBody = constants.response(); 9 | responseBody.httpStatus = 404; 10 | responseBody.serverloadms = helpers.date.moment.timestampMS(); 11 | responseBody.result = null; 12 | 13 | try { 14 | let key = `data/stats/${req.body.provider}/${req.body.range}`; 15 | if (req.body.match['location_properties.epiCenter.name']) { 16 | key += `/${req.body.match['location_properties.epiCenter.name']}`; 17 | } 18 | if (req.body.range === constants.statsRange.DATE) { 19 | key += `/${req.body.date.starts_date}/${req.body.date.ends_date}`; 20 | } 21 | if (req.body.types.length > 0) { 22 | key += `/${req.body.types.toString()}`; 23 | } 24 | const cache = db.nopeRedis.getItem(key); 25 | if (cache) { 26 | responseBody.result = cache; 27 | responseBody.httpStatus = 200; 28 | } else { 29 | if (req.body.types.length === 0) { 30 | responseBody.result = { 31 | dateBy: await repositories.data.stats.dateBy(req.body.match), 32 | hourBy: await repositories.data.stats.hourBy(req.body.match), 33 | epiCenterBy: await repositories.data.stats.epiCenterBy(req.body.match), 34 | airportsBy: await repositories.data.stats.airportsBy(req.body.match), 35 | magBy: await repositories.data.stats.magBy(req.body.match), 36 | dateByEarthQuakes: await repositories.data.stats.dateByEarthQuakes(req.body.match), 37 | }; 38 | } else { 39 | responseBody.result = {}; 40 | if (req.body.types.includes(constants.stats.dateBy)) { 41 | responseBody.result.dateBy = await repositories.data.stats.dateBy(req.body.match); 42 | } 43 | if (req.body.types.includes(constants.stats.hourBy)) { 44 | responseBody.result.hourBy = await repositories.data.stats.hourBy(req.body.match); 45 | } 46 | if (req.body.types.includes(constants.stats.epiCenterBy)) { 47 | responseBody.result.epiCenterBy = await repositories.data.stats.epiCenterBy(req.body.match); 48 | } 49 | if (req.body.types.includes(constants.stats.airportsBy)) { 50 | responseBody.result.airportsBy = await repositories.data.stats.airportsBy(req.body.match); 51 | } 52 | if (req.body.types.includes(constants.stats.magBy)) { 53 | responseBody.result.magBy = await repositories.data.stats.magBy(req.body.match); 54 | } 55 | if (req.body.types.includes(constants.stats.dateByEarthQuakes)) { 56 | responseBody.result.dateByEarthQuakes = await repositories.data.stats.dateByEarthQuakes(req.body.match); 57 | } 58 | } 59 | responseBody.httpStatus = 200; 60 | db.nopeRedis.setItem(key, responseBody.result, 5 * 60); 61 | } 62 | } catch (error) { 63 | console.error(error); 64 | responseBody.desc = error.message || ''; 65 | responseBody.status = false; 66 | responseBody.httpStatus = 500; 67 | } 68 | responseBody.serverloadms = helpers.date.moment.timestampMS() - responseBody.serverloadms; 69 | return res.status(responseBody.httpStatus).json(responseBody); 70 | }; 71 | -------------------------------------------------------------------------------- /src/services/index.js: -------------------------------------------------------------------------------- 1 | module.exports.int = require('./int'); 2 | module.exports.kandilli = require('./kandilli'); 3 | module.exports.statics = require('./statics'); 4 | module.exports.data = require('./data'); 5 | -------------------------------------------------------------------------------- /src/services/int/earthquakes.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-inner-declarations */ 2 | const helpers = require('../../helpers'); 3 | const repositories = require('../../repositories'); 4 | const constants = require('../../constants'); 5 | 6 | module.exports = async (req, res) => { 7 | const responseBody = constants.response(); 8 | responseBody.serverloadms = helpers.date.moment.timestampMS(); 9 | 10 | try { 11 | async function start() { 12 | try { 13 | const kandilli_data = await helpers.crawler.kandilli.get(); 14 | repositories.kandilli.multiSave(kandilli_data.data); 15 | } catch (error) { 16 | console.error(error); 17 | } 18 | } 19 | start(); 20 | } catch (error) { 21 | console.error(error); 22 | responseBody.desc = error.message || ''; 23 | responseBody.status = false; 24 | responseBody.httpStatus = 500; 25 | } 26 | responseBody.serverloadms = helpers.date.moment.timestampMS() - responseBody.serverloadms; 27 | return res.status(responseBody.httpStatus).json(responseBody); 28 | }; 29 | -------------------------------------------------------------------------------- /src/services/int/index.js: -------------------------------------------------------------------------------- 1 | module.exports.earthquakes = require('./earthquakes'); 2 | -------------------------------------------------------------------------------- /src/services/kandilli/archive.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-inner-declarations */ 2 | const helpers = require('../../helpers'); 3 | const repositories = require('../../repositories'); 4 | const constants = require('../../constants'); 5 | 6 | module.exports = async (req, res) => { 7 | const responseBody = constants.response(); 8 | responseBody.serverloadms = helpers.date.moment.timestampMS(); 9 | responseBody.metadata = {}; 10 | responseBody.result = []; 11 | try { 12 | const kandilli_data = await repositories.kandilli.list(req.query.date, req.query.date_end, req.query.skip, req.query.limit); 13 | if (!kandilli_data) { 14 | responseBody.status = false; 15 | responseBody.desc = 'Veri alınamadı!'; 16 | } 17 | responseBody.result = kandilli_data.data; 18 | responseBody.metadata = kandilli_data.metadata[0]; 19 | } catch (error) { 20 | console.error(error); 21 | responseBody.desc = error.message || ''; 22 | responseBody.status = false; 23 | responseBody.httpStatus = 500; 24 | } 25 | responseBody.serverloadms = helpers.date.moment.timestampMS() - responseBody.serverloadms; 26 | return res.status(responseBody.httpStatus).json(responseBody); 27 | }; 28 | -------------------------------------------------------------------------------- /src/services/kandilli/index.js: -------------------------------------------------------------------------------- 1 | module.exports.live = require('./live'); 2 | module.exports.archive = require('./archive'); 3 | -------------------------------------------------------------------------------- /src/services/kandilli/live.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-inner-declarations */ 2 | const helpers = require('../../helpers'); 3 | const repositories = require('../../repositories'); 4 | const constants = require('../../constants'); 5 | const db = require('../../db'); 6 | 7 | module.exports = async (req, res) => { 8 | const responseBody = constants.response(); 9 | responseBody.serverloadms = helpers.date.moment.timestampMS(); 10 | responseBody.metadata = { 11 | date_starts: helpers.date.moment.moment().tz('Europe/Istanbul').add(-24, 'hours').format('YYYY-MM-DD HH:mm:ss'), 12 | date_ends: helpers.date.moment.moment().tz('Europe/Istanbul').format('YYYY-MM-DD HH:mm:ss'), 13 | }; 14 | responseBody.result = []; 15 | 16 | try { 17 | let kandilli_data = false; 18 | const key = `kandilli/live/${req.query.skip}/${req.query.limit}`; 19 | const check_noperedis = db.nopeRedis.getItem(key); 20 | if (check_noperedis) { 21 | kandilli_data = check_noperedis; 22 | } else { 23 | kandilli_data = await repositories.kandilli.list( 24 | responseBody.metadata.date_starts, 25 | responseBody.metadata.date_ends, 26 | req.query.skip, 27 | req.query.limit, 28 | { date_time: -1 }, 29 | ); 30 | db.nopeRedis.setItem(key, kandilli_data, 30); 31 | } 32 | if (!kandilli_data) { 33 | responseBody.status = false; 34 | responseBody.desc = 'Veri alınamadı!'; 35 | } 36 | responseBody.result = kandilli_data.data; 37 | responseBody.metadata = { ...responseBody.metadata, ...kandilli_data.metadata[0] }; 38 | } catch (error) { 39 | console.error(error); 40 | responseBody.desc = error.message || ''; 41 | responseBody.status = false; 42 | responseBody.httpStatus = 500; 43 | } 44 | responseBody.serverloadms = helpers.date.moment.timestampMS() - responseBody.serverloadms; 45 | return res.status(responseBody.httpStatus).json(responseBody); 46 | }; 47 | -------------------------------------------------------------------------------- /src/services/statics/cities.js: -------------------------------------------------------------------------------- 1 | const helpers = require('../../helpers'); 2 | const repositories = require('../../repositories'); 3 | const constants = require('../../constants'); 4 | 5 | module.exports = async (req, res) => { 6 | const responseBody = constants.response(); 7 | try { 8 | responseBody.result = repositories.data.stats.epiCenters(); 9 | } catch (error) { 10 | console.error(error); 11 | responseBody.desc = error.message || ''; 12 | responseBody.status = false; 13 | responseBody.httpStatus = 500; 14 | } 15 | responseBody.serverloadms = helpers.date.moment.timestampMS() - responseBody.serverloadms; 16 | return res.status(responseBody.httpStatus).json(responseBody); 17 | }; 18 | -------------------------------------------------------------------------------- /src/services/statics/index.js: -------------------------------------------------------------------------------- 1 | module.exports.cities = require('./cities'); 2 | --------------------------------------------------------------------------------