From c99b5ed19f48691a68d236b0bc245281d2f0e272 Mon Sep 17 00:00:00 2001 From: Pax1601 Date: Mon, 4 Mar 2024 08:41:24 +0100 Subject: [PATCH] Added calibration to map generator --- frontend/server/demo.js | 2 +- .../python/map_generator/.vscode/launch.json | 2 +- .../configs/Caucasus/LowResolution.kml | 28 ++-- .../configs/Caucasus/MediumResolution.kml | 34 ++-- .../NTTR/{boundary.kml => LowResolution.kml} | 0 .../NTTR/{config.yml => LowResolution.yml} | 2 +- .../configs/NTTR/MediumResolution.kml | 48 ++++++ .../configs/Syria/HighResolution.yml | 5 + .../configs/Syria/LowResolution.kml | 77 +++++++++ .../configs/Syria/LowResolution.yml | 5 + .../configs/Syria/MediumResolution.kml | 87 ++++++++++ .../configs/Syria/MediumResolution.yml | 5 + .../map_generator/configs/Syria/airbases.json | 1 + .../map_generator/configs/Syria/airbases.kml | 1 + .../configs/Test/LowResolution.kml | 48 ++++++ .../configs/Test/LowResolution.yml | 5 + .../configs/Test/MediumResolution.kml | 48 ++++++ .../configs/Test/MediumResolution.yml | 5 + scripts/python/map_generator/map_generator.py | 148 +++++++++++++----- 19 files changed, 473 insertions(+), 78 deletions(-) rename scripts/python/map_generator/configs/NTTR/{boundary.kml => LowResolution.kml} (100%) rename scripts/python/map_generator/configs/NTTR/{config.yml => LowResolution.yml} (82%) create mode 100644 scripts/python/map_generator/configs/NTTR/MediumResolution.kml create mode 100644 scripts/python/map_generator/configs/Syria/HighResolution.yml create mode 100644 scripts/python/map_generator/configs/Syria/LowResolution.kml create mode 100644 scripts/python/map_generator/configs/Syria/LowResolution.yml create mode 100644 scripts/python/map_generator/configs/Syria/MediumResolution.kml create mode 100644 scripts/python/map_generator/configs/Syria/MediumResolution.yml create mode 100644 scripts/python/map_generator/configs/Syria/airbases.json create mode 100644 scripts/python/map_generator/configs/Syria/airbases.kml create mode 100644 scripts/python/map_generator/configs/Test/LowResolution.kml create mode 100644 scripts/python/map_generator/configs/Test/LowResolution.yml create mode 100644 scripts/python/map_generator/configs/Test/MediumResolution.kml create mode 100644 scripts/python/map_generator/configs/Test/MediumResolution.yml diff --git a/frontend/server/demo.js b/frontend/server/demo.js index 486eb484..3f0ecfa6 100644 --- a/frontend/server/demo.js +++ b/frontend/server/demo.js @@ -458,7 +458,7 @@ module.exports = function (configLocation) { }; mission(req, res){ - var ret = {mission: {theatre: "Nevada"}}; + var ret = {mission: {theatre: "Syria"}}; ret.time = Date.now(); ret.mission.dateAndTime = { diff --git a/scripts/python/map_generator/.vscode/launch.json b/scripts/python/map_generator/.vscode/launch.json index 40a86611..c1bbc766 100644 --- a/scripts/python/map_generator/.vscode/launch.json +++ b/scripts/python/map_generator/.vscode/launch.json @@ -10,7 +10,7 @@ "request": "launch", "program": "main.py", "console": "integratedTerminal", - "args": ["./configs/Caucasus/HighResolution.yml"] + "args": ["./configs/Test/MediumResolution.yml"] } ] } \ No newline at end of file diff --git a/scripts/python/map_generator/configs/Caucasus/LowResolution.kml b/scripts/python/map_generator/configs/Caucasus/LowResolution.kml index e56c3210..07490af5 100644 --- a/scripts/python/map_generator/configs/Caucasus/LowResolution.kml +++ b/scripts/python/map_generator/configs/Caucasus/LowResolution.kml @@ -1,15 +1,16 @@ - Senza titolo + Low resolution + 1 - - + + - Poligono senza titolo + Low resolution 37.25019544589698 44.41771380726969 -138.6844933247498 0 0 - 35 3831683.119853139 absolute + 35 #__managed_style_0F57E9B9782F24E92C22 - 32.46459319237173,45.67416695848307,0 32.2740650283415,45.2221541106433,0 33.22174616520244,44.4837859435444,0 34.05427109764131,44.2149221586376,0 34.96485577272431,44.60230684639296,0 35.50552864748745,44.8069362633187,0 36.446105774871,44.84425518198143,0 36.76914203317659,44.70347050722764,0 38.22313992004164,44.3163345847565,0 39.43106567523965,43.72064977016311,0 40.23832274382622,43.06831352526857,0 41.01327578994438,42.67925159935859,0 41.34464189582403,42.34329512558789,0 41.16749495371268,41.74956946999534,0 40.80780496107725,41.39360013128164,0 39.98364177441992,41.27272565351572,0 39.42209428526464,41.27830763089842,0 38.82136897872954,41.2291415593637,0 38.78900701766597,39.59331113999448,0 46.4826445997655,39.11657164682355,0 46.83937081793388,45.04996086829865,0 46.88987497227086,47.59122144470205,0 32.29992865035658,47.73230965442627,0 32.46459319237173,45.67416695848307,0 + 32.46459319237173,45.67416695848307,0 32.2740650283415,45.2221541106433,0 33.22174616520244,44.4837859435444,0 34.05427109764131,44.2149221586376,0 34.96485577272431,44.60230684639296,0 35.50552864748745,44.8069362633187,0 36.446105774871,44.84425518198143,0 36.76914203317659,44.70347050722764,0 38.22313992004164,44.3163345847565,0 39.43106567523965,43.72064977016311,0 40.23832274382622,43.06831352526857,0 41.01327578994438,42.67925159935859,0 41.34464189582403,42.34329512558789,0 41.16749495371268,41.74956946999534,0 40.80780496107725,41.39360013128164,0 39.98364177441992,41.27272565351572,0 39.42209428526464,41.27830763089842,0 38.82136897872954,41.2291415593637,0 38.82458556682658,39.86622166029085,0 45.8381687868953,39.59275112715873,0 45.98912922607954,43.86743059613963,0 46.10445698500042,45.31544913665732,0 34.15598911357598,46.421850808793,0 32.46459319237173,45.67416695848307,0 diff --git a/scripts/python/map_generator/configs/Caucasus/MediumResolution.kml b/scripts/python/map_generator/configs/Caucasus/MediumResolution.kml index 0e0af764..46642b5e 100644 --- a/scripts/python/map_generator/configs/Caucasus/MediumResolution.kml +++ b/scripts/python/map_generator/configs/Caucasus/MediumResolution.kml @@ -2,45 +2,31 @@ MediumResolution.kml - + normal - #s_ylw-pushpin + #failed0 highlight - #s_ylw-pushpin_hl + #failed - - - Untitled Polygon + Medium Res - #m_ylw-pushpin + #__managed_style_0F57E9B9782F24E92C22 1 - 38.01314831290035,44.57640274670221,0 38.02944798685579,44.60276751290017,0 38.03701060313551,44.62238817868698,0 38.04339313778571,44.65487861016632,0 38.05976583140756,44.68123948836164,0 38.07725859098449,44.69472890923019,0 38.11291945378741,44.71522618625848,0 38.15737096473566,44.74243269722512,0 38.18485778769824,44.74972736437217,0 38.21177330355324,44.7634527979471,0 38.25852533281954,44.76484292008565,0 38.30469494342632,44.77265044108603,0 38.36049540323182,44.77428878950431,0 38.37905726470693,44.77483376304828,0 38.44346421266869,44.78314952437485,0 38.48003274711677,44.79063943163983,0 38.53510271283257,44.79863898344369,0 38.58131400320148,44.79993344687284,0 38.62750840123165,44.80120844370346,0 38.67367469674257,44.80246384096735,0 38.71956774499493,44.80373436400996,0 38.75627384860339,44.8047373881825,0 38.81181562123516,44.79979181843787,0 38.86732496532647,44.79482114270701,0 38.9418190787013,44.78384375272389,0 38.97905705406094,44.778337408217,0 39.01583176131165,44.77923974267458,0 39.0900956709648,44.76819193321122,0 39.15465996521237,44.76330766478745,0 39.21909989645339,44.75839879172977,0 39.2560739657125,44.75283091433155,0 39.2926368410373,44.75366325960852,0 39.32996917677399,44.74166417489695,0 39.36650552718523,44.74247384431043,0 39.41255496817574,44.73705800868364,0 39.48634199995926,44.72579712136418,0 39.52357053143431,44.71374682534395,0 39.56077169452355,44.70168758531198,0 39.6165192307209,44.6835853772921,0 39.65364919828341,44.67150732324989,0 39.72813801276361,44.64093207562432,0 39.78387993140787,44.61639917038017,0 39.83048040841024,44.591681936124,0 39.85859564812953,44.57301236646423,0 39.90509751878192,44.5482824053089,0 39.94249273127954,44.52338201672428,0 39.99853360189767,44.49238758170668,0 40.06418699118991,44.44876421256014,0 40.10122416737037,44.43022041947975,0 40.17476642160124,44.39952250587424,0 40.22062991958054,44.38112056606379,0 40.26616925085745,44.36908408773458,0 40.32066183181299,44.3571725102825,0 40.35687691238554,44.35134432568741,0 40.44767908225873,44.32717767100264,0 40.48389607700778,44.31496053921349,0 40.53788603259777,44.30297929770608,0 40.57403888305044,44.29073121970499,0 40.66420062160682,44.26643647458618,0 40.70947171289453,44.24790062395415,0 40.79051702894591,44.22341319737066,0 40.86240131168533,44.1987807551584,0 40.90727896521627,44.18655120898199,0 40.9971751422766,44.16204307598525,0 41.06896675719418,44.14366887573048,0 41.11381283684614,44.13137235210612,0 41.19430400444456,44.10665219373025,0 41.29215003328483,44.09472243976229,0 41.37240316383965,44.07625022448003,0 41.4257513549977,44.07025961185919,0 41.47917541902734,44.05789539392341,0 41.5325417114993,44.04550988906617,0 41.58597268867194,44.02675551936349,0 41.63036154961326,44.02063436986167,0 41.66587473645689,44.01445730447657,0 41.70144949563171,44.00192621497413,0 41.73692804647133,43.99573038959692,0 41.80790527475083,43.9769682848858,0 41.86104680287534,43.96445030267287,0 41.92294354557144,43.95192640497554,0 41.97593555038175,43.94569501888316,0 42.0289322801191,43.92675381975371,0 42.06422510564282,43.92045601376109,0 42.11715008872746,43.9078193193867,0 42.16126121663363,43.89517408007984,0 42.20531402728533,43.88883194377493,0 42.24050364188762,43.8761279474099,0 42.27567975880997,43.86974938516271,0 42.33721825822707,43.85697758262555,0 42.36356945565706,43.84425223576203,0 42.4162746612844,43.83145551598434,0 42.46900614324979,43.81867159050743,0 42.52171597341432,43.80587848838739,0 42.57435452102627,43.79303476282518,0 42.66192800537871,43.76098283129826,0 42.68820542361732,43.75451828141484,0 42.71453056569531,43.75437460048707,0 42.78443169369056,43.7223423950142,0 42.82815553677322,43.70943149863041,0 42.88931539666483,43.69006393459333,0 42.93306263868907,43.68341230544033,0 42.97662716861461,43.66407134484366,0 43.01149955281491,43.65107862194047,0 43.0724574902484,43.62514140546799,0 43.13327577066558,43.59283128307425,0 43.17650639536976,43.56075387900956,0 43.19390304524044,43.5542383074794,0 43.2458228621912,43.52203453680247,0 43.28917624236355,43.50260877389707,0 43.33249712773732,43.48316752413342,0 43.39341545401486,43.46982012002935,0 43.41934387933852,43.45687177914835,0 43.45417023053265,43.45011914908257,0 43.54116031694757,43.42340105939786,0 43.60215378404467,43.40973324821089,0 43.62805859606298,43.39668681257595,0 43.66269445936168,43.3835061348825,0 43.71445259635788,43.35737376950652,0 43.75781252139677,43.34400401633088,0 43.79224026980383,43.32441967291912,0 43.84412456960271,43.30452957746165,0 43.86977478309283,43.28506457890185,0 43.90414446493419,43.26544051056777,0 43.98147797545967,43.22607034290247,0 44.05860864936233,43.18675114853992,0 44.06709119023878,43.18027612980465,0 44.12715980003196,43.15386409427541,0 44.18743101444286,43.13372968109404,0 44.23897569124552,43.11371864078352,0 44.27358790844354,43.1066733857835,0 44.28203952535908,43.100179325582,0 44.33401294247151,43.09279825752913,0 44.37696649117978,43.07928586699428,0 44.41989828391778,43.06575823137832,0 44.45469479565277,43.06501638277474,0 44.51539689936585,43.05076982497799,0 44.55018766980033,43.04346891719553,0 44.58498367893472,43.0361552674791,0 44.63705094972993,43.02198827645994,0 44.68065391179591,43.02090890830104,0 44.73259892455201,43.01331904594272,0 44.7761165148564,43.01226353824702,0 44.83675394474802,43.0044120900956,0 44.87127327746453,42.9971914930625,0 44.92355181162227,42.99582138878485,0 44.97588472069648,42.99439652359818,0 45.02831258656551,42.99289450840476,0 45.07207630821009,42.99158817485907,0 45.0895848496222,42.99106070586604,0 45.14117239315028,42.97694647097289,0 45.17601296980932,42.97596816214897,0 45.21047622192639,42.96865722217818,0 45.28886690434192,42.96639262525014,0 45.34984222945756,42.96459406473044,0 45.37646173654968,42.9700880705898,0 45.43810803374696,42.97443956886776,0 45.49185301851502,42.9851743808321,0 45.52759443680108,42.99020242274158,0 45.5633579633161,42.99522156765907,0 45.62609326432623,43.00557429659632,0 45.64419236937005,43.01125368180472,0 45.71617312145327,43.0276362621879,0 45.76976054364151,43.03847417679859,0 45.83259009413669,43.05533668327431,0 45.88664835623321,43.0725031755841,0 45.90460015950028,43.0782529571539,0 45.96724185845013,43.09518163430661,0 46.02071293056959,43.10603674537837,0 46.08363829327891,43.12283810442124,0 46.12919552359966,43.1402092420311,0 46.17527504653226,43.16392574078856,0 46.21256602738341,43.18797952343618,0 46.25038909630553,43.21839048242535,0 46.28777139407883,43.2424397908981,0 46.30774824868674,43.27361498596171,0 46.32865779774432,43.31754539001604,0 46.33935284365015,43.34270001952713,0 46.34117604912893,43.36820735506829,0 46.34482783840426,43.41922482374558,0 46.33913196765758,43.46421581299708,0 46.32316096412696,43.49041999939335,0 46.30715550915618,43.51662177371173,0 46.28265395288795,43.54954566985638,0 46.26660295085507,43.57574025590465,0 46.2416351531661,43.60227192587565,0 46.21623782737858,43.62240514869328,0 46.1908274697064,43.64252979654582,0 46.14844641588729,43.67605152819741,0 46.09754206819095,43.71624568019379,0 46.04573101337119,43.7436522532048,0 45.99352467916157,43.76465044035011,0 45.93237929007829,43.78592394921217,0 45.89713232779982,43.79351371317505,0 45.86228431553677,43.80746104708328,0 45.77472350124277,43.83590173707711,0 45.71348831641006,43.85703490795119,0 45.65191189201103,43.87174753144312,0 45.61667402158427,43.87922934910029,0 45.54656786024061,43.90052206107319,0 45.49350967028987,43.90850130248388,0 45.45862584676529,43.92229280860784,0 45.42337035734356,43.92970702709297,0 45.38811307759509,43.937108252938,0 45.35322471819191,43.95085957802508,0 45.3005649870871,43.96510331400013,0 45.23011659328166,43.97979736377869,0 45.17709837174289,43.98760694827055,0 45.15110443452078,44.00104251565386,0 45.08951712248168,44.01540345578517,0 45.06316511801389,44.02245559755142,0 44.99267086992596,44.03698583304246,0 44.92219608741352,44.05146730436935,0 44.89615719435373,44.06483501784728,0 44.8170642195509,44.08581884549502,0 44.79988885185894,44.09895260738689,0 44.76462446697382,44.10613318475036,0 44.70326861737696,44.1266187753704,0 44.65106302010911,44.15323163062371,0 44.58076324644311,44.17383446229861,0 44.53684318558219,44.18748404076401,0 44.50180424794954,44.20093302105131,0 44.46701746015775,44.22072797580508,0 44.42304975061145,44.23432878609736,0 44.38822310457682,44.25409621098623,0 44.33556878516728,44.27418909606034,0 44.30069641113407,44.29392636141888,0 44.28339349889821,44.30696393893064,0 44.23097562347358,44.33336747822818,0 44.17851176458034,44.35974675030393,0 44.15226167318346,44.37292711611524,0 44.11709253571063,44.3862520301023,0 44.06408773145306,44.3998586550974,0 44.02020359643429,44.41966316702641,0 43.97607632487119,44.43308694714862,0 43.95846260821069,44.43972355886389,0 43.90559771591774,44.45962297435154,0 43.87925266250725,44.47274148280075,0 43.83525174753024,44.49247153785101,0 43.76445414868348,44.51255406389881,0 43.72038648542567,44.53223910895665,0 43.64934486886363,44.54587768081366,0 43.61397852496307,44.55904554271575,0 43.56057970837746,44.56605714778042,0 43.49855667429589,44.58587055533157,0 43.42755914078424,44.60574627274126,0 43.32971303148774,44.62584438952917,0 43.28529868203722,44.63900032613098,0 43.24967933417494,44.64569501002083,0 43.18749309794997,44.66535857889014,0 43.16090537909993,44.67832317668243,0 43.11641904880359,44.69143181586064,0 43.08075073451171,44.69808695876216,0 43.03622697338457,44.7111647564733,0 42.98273333893267,44.72429025542684,0 42.94711324326666,44.73727121278075,0 42.91139377096744,44.74387478102076,0 42.86678779842207,44.75689566297324,0 42.82222718981076,44.77627663268911,0 42.78646057264498,44.78285467849167,0 42.75068361087877,44.78942153624351,0 42.71489664982047,44.79597749357526,0 42.67018293714294,44.8089434503947,0 42.63436265526764,44.81549043973975,0 42.58062882971889,44.82847708911186,0 42.53577121010387,44.82865760553419,0 42.4999208693445,44.83515250024195,0 42.46405955597668,44.84163606739416,0 42.41921437347892,44.84813226946913,0 42.34743402687941,44.8546589311031,0 42.28461265904593,44.86112695267551,0 42.23075235677478,44.8675535271605,0 42.14989565225897,44.87399084137638,0 42.11390246653278,44.88676612195948,0 42.05993854846654,44.89314814654652,0 42.02396195908283,44.89950167231509,0 41.9789497694081,44.9122091851487,0 41.93395441207461,44.91852527096788,0 41.8709082213281,44.93116423274844,0 41.83487300285083,44.93746204450073,0 41.78979408028204,44.94374575060081,0 41.73564639729818,44.95001729713729,0 41.69040551164322,44.96267366923298,0 41.64521725871576,44.96893289651593,0 41.60000973222633,44.975175757325,0 41.53672612986542,44.98133438865409,0 41.48244250948969,44.98749676965726,0 41.41904790587971,44.99362631059221,0 41.36465478024421,44.9997667282959,0 41.30118394243455,45.0058328814192,0 41.21035696372313,45.01810001242023,0 41.16475687358584,45.03060404802721,0 41.08305809003318,45.03643156262545,0 41.01022120757838,45.04866108931765,0 40.95564788310254,45.05460618921672,0 40.91918811076351,45.06068938106755,0 40.85529919457088,45.07290925496478,0 40.77294208672041,45.09133585558963,0 40.69975096549803,45.10342659498956,0 40.67223599748748,45.10954762666954,0 40.60826715231116,45.11528463578665,0 40.57135928605479,45.12770045512377,0 40.52555110464314,45.1335962585174,0 40.47035151607203,45.14577591815908,0 40.43361189969977,45.15174699931359,0 40.38743867936167,45.16402180769061,0 40.31380771819658,45.17592665584618,0 40.25839825627587,45.18803032898685,0 40.20297601134237,45.20010650582828,0 40.13835718316099,45.21202917610439,0 40.07397839683421,45.21751425339473,0 40.00883672469774,45.23582880740994,0 39.93507023862615,45.24112145045733,0 39.87931155020412,45.2530948415529,0 39.81464896123029,45.25847075344878,0 39.73120153969697,45.26992195087966,0 39.6663551131453,45.27525219860404,0 39.60108916496383,45.28696596304335,0 39.54499678429895,45.29882416872194,0 39.48923652215399,45.30422816521241,0 39.45191407720477,45.30996135331282,0 39.33011463236952,45.33337217162322,0 39.28379180440938,45.33245751303431,0 39.21765428078088,45.35046296264309,0 39.15227166561398,45.3555619831826,0 39.10540939634441,45.3610267026658,0 39.0301811039084,45.37231545305005,0 38.93615795673987,45.38317755359031,0 38.87977490498771,45.38837104664595,0 38.8611362654265,45.38794485212644,0 38.76739945004297,45.39222452308083,0 38.70209151973316,45.39065440109443,0 38.66422219910767,45.39620787040619,0 38.57948224848323,45.40060912002444,0 38.53212686453689,45.40590283250339,0 38.47592254071214,45.40447123138531,0 38.41969247627424,45.40301206561257,0 38.37281475292825,45.40177431165958,0 38.31652805906793,45.4002684092433,0 38.26953977469677,45.39899860039247,0 38.2225204175456,45.39771723895213,0 38.17548244051565,45.39641595431553,0 38.13783892001045,45.395360610056,0 38.09015720206296,45.40050051490334,0 38.04306020447405,45.39914471108719,0 37.94877077629969,45.39637607763545,0 37.88266036855689,45.39440863283985,0 37.8265581564524,45.386217910841,0 37.77043567566488,45.37799535308437,0 37.75150814308252,45.37740831723679,0 37.68523701121197,45.37532863532221,0 37.62907056001207,45.3670276412096,0 37.58167406687781,45.36547984955829,0 37.56272067532693,45.36485974724874,0 37.49624372816054,45.36270913594099,0 37.42976711206789,45.3604558515046,0 37.36300988528929,45.35826594092745,0 37.29631903836574,45.35598736154873,0 37.2574563269086,45.36116116878497,0 37.20010906702014,45.3592220898275,0 37.13254208285088,45.36290330815135,0 37.0655525681113,45.36091256593174,0 36.99876905778555,45.35842937608302,0 36.93202970910508,45.35589845692478,0 36.87419344573569,45.35378013197294,0 36.84528518883048,45.35271304946658,0 36.7985371039233,45.33791738963414,0 36.77194931640519,45.31731416288704,0 36.74544608511216,45.29666640798376,0 36.71978022459398,45.26949861492521,0 36.70380156937625,45.24271188567592,0 36.6877688993328,45.21591864758674,0 36.68220030795592,45.18298920764466,0 36.67644135182661,45.1501054833135,0 36.68108172872844,45.11111815847261,0 36.68413932080762,45.08519148093472,0 36.6982416402701,45.04652422941314,0 36.71895425088757,45.03431199144838,0 36.76176466252009,44.99690251128398,0 36.78237252013942,44.98469651020781,0 36.81400605981582,44.9598997677145,0 36.85432758358725,44.94198483400054,0 36.89463171023441,44.92406228333582,0 36.95607078108547,44.88744866471525,0 37.0056915338367,44.86989329050147,0 37.05590681577546,44.84586084391723,0 37.13577795837795,44.81003106420523,0 37.1661492932199,44.79170052673156,0 37.2840283303223,44.7507927272321,0 37.333699169088,44.72674043281787,0 37.39266858152133,44.70306913557176,0 37.44156188721184,44.68544143936163,0 37.48966540451932,44.67428275061241,0 37.52834674166351,44.66276488989296,0 37.57756480521245,44.63867678850659,0 37.6167789701361,44.6206512126293,0 37.64658130793807,44.60237958368824,0 37.68563249181236,44.58439603164166,0 37.72350647070319,44.57929352624546,0 37.76135764103405,44.57418080106547,0 37.79971359709912,44.56261018810848,0 37.83749478428704,44.55749069061759,0 37.86596991602401,44.55202519279939,0 37.91353842880665,44.5407661107667,0 37.95069554428976,44.54202127928167,0 37.96901833162684,44.54908041138402,0 38.01314831290035,44.57640274670221,0 + 37.95969376484067,44.51261628191521,0 38.28110277860284,44.71963445296016,0 39.52769386643676,44.63340293413165,0 40.0334023517413,44.36553276435769,0 44.74384213171446,42.92055106745762,0 46.35838222694976,43.01545850226881,0 46.43282553643498,43.66063012099576,0 42.77389642509943,44.87147719726321,0 38.50829297505012,45.51515041607847,0 36.78358279719649,45.43260695721591,0 36.44069410684496,45.29187962688709,0 36.66486089775511,44.9250874860739,0 37.95969376484067,44.51261628191521,0 @@ -50,7 +36,7 @@ - 41.53775554078113,41.54284169087985,0 41.5557362933533,41.54308773135198,0 41.59168899881018,41.54349741438154,0 41.62753474418238,41.55053498182795,0 41.67243157856005,41.55100515184548,0 41.70823459948813,41.55800681789061,0 41.7440345191207,41.56499465604114,0 41.7796477946567,41.58523610619877,0 41.81540029084289,41.59885565759765,0 41.85100111634027,41.62573535054879,0 41.87778979736473,41.63924597870949,0 41.90444289204574,41.66602302187243,0 41.92206151548901,41.6993597342634,0 42.04693067641833,41.80646201228668,0 42.13604393961469,41.89982122942289,0 42.17183308027819,41.92652169606252,0 42.19852871789745,41.95977352212215,0 42.2252628968215,41.97970842725169,0 42.26994872187819,41.99965020443318,0 42.29673577361682,42.01957606699964,0 42.33254608454833,42.03285823420884,0 42.35044607253829,42.04613765715574,0 42.38629271712682,42.06606236809689,0 42.4311496768144,42.0859710512487,0 42.46706331372805,42.09922911957894,0 42.502993728219,42.11247688800623,0 42.53894283546896,42.12571437916819,0 42.57489926553479,42.13894623322069,0 42.61985198507322,42.14548637159785,0 42.6648140035679,42.15200897086535,0 42.70975920132265,42.15186531039845,0 42.7457140791612,42.15173772830666,0 42.79065500174401,42.15156200799349,0 42.81761723751103,42.15144834777791,0 42.87154381883792,42.15120691211129,0 42.88948251478816,42.14449105785713,0 42.93431916747353,42.13759144636472,0 42.99713969807707,42.13060671855428,0 43.06883659142119,42.1168946332286,0 43.09568772190185,42.11008092547894,0 43.1315020603319,42.10320307300102,0 43.17627327311938,42.09625352467222,0 43.22989271585855,42.08257743750935,0 43.28347321227141,42.06885444601161,0 43.32817202801907,42.06183494226872,0 43.3818131650025,42.05471755909613,0 43.40868719679401,42.05446991900791,0 43.44464426678762,42.06077093451521,0 43.48983383300899,42.08025470959098,0 43.53518971128506,42.1063651468701,0 43.57162117444575,42.13255664457429,0 43.60840652610747,42.17201492544496,0 43.63593726230538,42.19829858984674,0 43.64561976620663,42.23147075519826,0 43.64631468213079,42.26474898795221,0 43.64700960042722,42.29802384606256,0 43.62941954714505,42.31820153960343,0 43.59380776363254,42.33858319170501,0 43.54024893401661,42.35912253707791,0 43.52238473691688,42.36596393345501,0 43.46863720819255,42.37981940818332,0 43.44162786499893,42.38008338950666,0 43.3697973887418,42.3940728486736,0 43.33373894928955,42.39440171561582,0 43.27985652940934,42.40818858744005,0 43.2437832018161,42.4084895392751,0 43.18985791220844,42.42223429039895,0 43.15376662807179,42.42250590127029,0 43.08165249776953,42.4296721637964,0 43.0365970877093,42.43662902324724,0 42.97339409950316,42.43701594915608,0 42.92837507808357,42.45059311942708,0 42.87418834415907,42.45087682837404,0 42.82912205079744,42.45775792484824,0 42.79307650237364,42.46458182687464,0 42.74800211233436,42.47142959219867,0 42.72101715155875,42.48485361330731,0 42.65795502138735,42.50504793003268,0 42.62188306119439,42.51181337142309,0 42.57680918934006,42.52524805411103,0 42.53171552103682,42.5453236739107,0 42.4773939052392,42.56541494626055,0 42.45020055709857,42.57212405074564,0 42.39581384265429,42.59884830001353,0 42.35949810336288,42.60555296409036,0 42.29590990712439,42.62559176168327,0 42.25954382216485,42.63893498303896,0 42.20494699261081,42.65893454593285,0 42.16856108827348,42.67225181411676,0 42.12310928360301,42.68553934625314,0 42.06853937910092,42.69879588322272,0 42.02301234779619,42.71871322359522,0 41.98658482768704,42.73197012891247,0 41.93193663650399,42.74516556255131,0 41.8863275391389,42.76503248686282,0 41.82242507396163,42.79149171599865,0 41.79500299216333,42.80472444625348,0 41.73988234604107,42.83122223678754,0 41.69368796281208,42.85778621032522,0 41.66597438741361,42.87105054289982,0 41.62905250953446,42.88427960424815,0 41.57367590476706,42.90409614079181,0 41.52737897401412,42.93060790088431,0 41.49030785595106,42.9504710178689,0 41.43516448825834,42.97014538786008,0 41.39841148287921,42.98323536689215,0 41.33370461438196,43.02283575676092,0 41.29674821910837,43.03593609563478,0 41.25970706568651,43.05569418075022,0 41.22270411169512,43.0687753648313,0 41.18567865624801,43.08184718692608,0 41.14855821584256,43.10157709004786,0 41.08354843051588,43.13441412574268,0 41.05568777197013,43.14088102660241,0 40.99972072685822,43.16714104809289,0 40.97161520577396,43.18693500869321,0 40.93430640248746,43.19997851502518,0 40.90615392097179,43.21976308849529,0 40.87808475586904,43.23287166021948,0 40.81244462881681,43.25903898424126,0 40.74653268526342,43.29187236784487,0 40.72758076919474,43.30507544992877,0 40.67100707738557,43.33129576545086,0 40.63336888345545,43.34430487580448,0 40.59551776613485,43.36400131053726,0 40.56697491011295,43.38379690364339,0 40.52929238947076,43.39677187567171,0 40.49158229972748,43.40973842205175,0 40.46318575886772,43.42280613228139,0 40.42520135412486,43.44246253179541,0 40.35851841607079,43.46859967230878,0 40.2920545002291,43.48798320432996,0 40.29186693076454,43.49467606366818,0 40.22485660673597,43.51417407539959,0 40.21481235678878,43.52753350534147,0 40.15672909129018,43.55389118804134,0 40.09883298603469,43.57351259881662,0 40.06004175537093,43.59325592294303,0 40.00245439033321,43.61935254888024,0 39.9833242227229,43.62580479212573,0 39.94476341368929,43.64542880184169,0 39.89700122671705,43.65817839613955,0 39.86838204498354,43.66447582070867,0 39.83029802350944,43.67062102850877,0 39.77298359656623,43.68318431178038,0 39.71561588042994,43.69569978988519,0 39.67706529680439,43.70185169199368,0 39.6295382941978,43.70122550352337,0 39.59236697914641,43.68042623868242,0 39.56605357924803,43.64606219379195,0 39.5680943256674,43.61227393564905,0 39.56933450184233,43.59198717577144,0 39.57138689975699,43.55816983965688,0 39.59225023718366,43.52475242713699,0 39.62168558290202,43.50502984680832,0 39.66091151318264,43.47866256184555,0 39.70942807994742,43.45262153219434,0 39.75862473346064,43.41300280243701,0 39.78785020872552,43.39328905300923,0 39.82677471399703,43.36698906613079,0 39.84693702219752,43.34037904684922,0 39.89543417295292,43.30753036807191,0 39.96285281113042,43.26827568651616,0 40.00117377725787,43.24872331473418,0 40.03012486622227,43.22901364276324,0 40.05871639761818,43.21602938254538,0 40.11612240784784,43.18332213420401,0 40.1353343850455,43.17018093074569,0 40.19259980331036,43.13747560172189,0 40.24978348352383,43.10478282219141,0 40.25934837429926,43.09820972028794,0 40.3160800643051,43.07219370716132,0 40.3539478839585,43.05260526031623,0 40.41052991283914,43.02659535458304,0 40.46678080177634,43.00727222906239,0 40.49500740972938,42.99423189364647,0 40.5419270147596,42.97474033208791,0 40.60742162080103,42.94880418863689,0 40.67279963510654,42.9228378057344,0 40.72912837383883,42.89003553322812,0 40.76657456827925,42.8703943730393,0 40.81293104737578,42.85755905855336,0 40.85044054112145,42.8312065939578,0 40.87836129697151,42.8181357379184,0 40.93396511184284,42.7986735566373,0 40.97118396529061,42.77899668912436,0 41.01770393338185,42.75271927536402,0 41.07330108293286,42.72651965302641,0 41.10123341197125,42.70673087941755,0 41.12913879068348,42.68694676806709,0 41.15717452916644,42.66046729786308,0 41.21266587733444,42.62752013054661,0 41.27753680000098,42.58133347938784,0 41.31449162942334,42.55492161154923,0 41.34218069105316,42.53517337956085,0 41.3699521159656,42.50864535973016,0 41.3977337373972,42.48216315570383,0 41.42580420794186,42.43564706263653,0 41.44442509268509,42.40910366742161,0 41.46330987180127,42.36252566285938,0 41.47300777847832,42.3225579626207,0 41.49205605734203,42.26266839510883,0 41.51091812899023,42.20945509965943,0 41.51124736400526,42.18940417181055,0 41.51184899375748,42.14940704737933,0 41.51257301985768,42.09604680192994,0 41.51304361340566,42.06270781873246,0 41.51351460595959,42.02937155010276,0 41.51389103853685,42.00270439552118,0 41.51426753630366,41.97603845148638,0 41.51454886823195,41.9560408205822,0 41.51529969022265,41.90271680024225,0 41.51601958509476,41.84939179639044,0 41.50738364776096,41.82268764844807,0 41.50794314458717,41.78265830783323,0 41.49956653289131,41.73593204200335,0 41.49094379732394,41.7091836430297,0 41.48241637344626,41.67576839642926,0 41.48277005855586,41.64910177468716,0 41.46538962600514,41.60894168315224,0 41.46583961205656,41.57560963453324,0 41.53775554078113,41.54284169087985,0 + 39.54501709623546,43.69008668679116,0 39.52263610269038,43.48406356531304,0 41.3297894146564,42.45142977009203,0 41.40294588197963,41.56682924069482,0 41.4988072004186,41.45716034723527,0 41.81470716770748,41.45589846945511,0 42.25878006657072,41.83859443691041,0 42.52744266169594,42.05655187342957,0 42.81340076706365,42.06810935553392,0 43.46366897355867,41.99119084030408,0 43.64154923207455,42.11742894573057,0 43.65726260615959,42.29391726111501,0 43.58769735609604,42.41007663763383,0 42.48416667774461,42.53665288535885,0 40.46530467451318,43.43253191463909,0 39.54501709623546,43.69008668679116,0 @@ -60,7 +46,7 @@ - 46.29136056526277,41.70642736508859,0 46.2655374598496,41.72746512034644,0 46.24798959676117,41.73478228033488,0 46.19564432800482,41.76341874451683,0 46.16115209622109,41.79143028820085,0 46.11736962289969,41.81302249013741,0 46.08220077071437,41.82760279762712,0 46.07393530816669,41.84128122420302,0 46.02953907168371,41.86296653864726,0 45.97592576115243,41.88496605089954,0 45.96712042768141,41.89198115153647,0 45.91376114310117,41.920632764118,0 45.86013833031562,41.94254110596773,0 45.80676845790597,41.97110399371204,0 45.77101722026075,41.98565920730643,0 45.725955564429,41.99379516697699,0 45.68099840062693,42.00862816602489,0 45.63565270913485,42.01677973576709,0 45.5812152974966,42.0251941414858,0 45.52690343264386,42.02683115346582,0 45.48201492865787,42.02137122038625,0 45.45493178565337,42.01542542452609,0 45.40967572857903,42.00328169139971,0 45.35552095218777,41.99134464290105,0 45.31840845667836,41.97238166781943,0 45.29099863128936,41.96648146570077,0 45.23621071348215,41.95466470778074,0 45.19969202127459,41.94228297108083,0 45.15423561361719,41.93011569448655,0 45.1090988089524,41.92458878469146,0 45.05471454575017,41.91260804562862,0 45.0006433083413,41.90725980387611,0 44.95588715117321,41.90832075394844,0 44.90190046564182,41.90290500703968,0 44.84792260312036,41.89746351754019,0 44.80317141083541,41.8984582160928,0 44.75815683274477,41.89277719190957,0 44.71340818825777,41.89373744246018,0 44.6860244148217,41.8809885369469,0 44.63145468005109,41.8621918212395,0 44.59502689459989,41.84968114723631,0 44.55862312027542,41.83716212732757,0 44.51302072169235,41.81817931718435,0 44.48518326606419,41.79213691670284,0 44.45715170864211,41.75943595332741,0 44.44729881207198,41.73300160978207,0 44.42827616640895,41.70010583641513,0 44.41822805812167,41.66701663104404,0 44.40819056272188,41.63392764776611,0 44.4073228431249,41.60729951896295,0 44.40578327122952,41.56072419136571,0 44.41337823615215,41.52061272268416,0 44.43879679781359,41.48011372054618,0 44.48146939519803,41.42597045923384,0 44.49856796833567,41.40563622444879,0 44.54189197339844,41.37139214028922,0 44.59382879531736,41.33027103698075,0 44.65486748320358,41.29554587105938,0 44.71607012701851,41.26747049424475,0 44.75945136971854,41.23980950145585,0 44.80386201218432,41.23873212776564,0 44.83939508710957,41.23785862285534,0 44.89270076787832,41.23652617709271,0 44.93772737194195,41.24867818391856,0 44.97328205520126,41.24776308881047,0 45.01907030278738,41.27309403085943,0 45.07369949925368,41.29141017020593,0 45.10983278395497,41.29696806464043,0 45.15527303267147,41.30888709188234,0 45.19128061237639,41.31453219506862,0 45.23602909997862,41.32002510612885,0 45.29857768985443,41.3250143950737,0 45.33416190651862,41.32403215347762,0 45.39671697915616,41.32213231990524,0 45.45940221481742,41.32014120641703,0 45.50419250763679,41.31869709118127,0 45.54003268838061,41.31753670697918,0 45.57551084597447,41.30970076629319,0 45.62888963209738,41.30126446312586,0 45.68227301560751,41.2928005994364,0 45.72667875602514,41.2846220366463,0 45.78000434070471,41.27613899870758,0 45.83298573021339,41.26094177619265,0 45.85052958090154,41.25364113518242,0 45.91244252847301,41.23809291562738,0 45.98361453558361,41.22889643865703,0 46.01900165480877,41.22094340493064,0 46.08099732081731,41.20524529321233,0 46.12596191925329,41.20349831104546,0 46.16194497038691,41.20208815960403,0 46.23318663834206,41.1858368946756,0 46.26918939591037,41.18438942888334,0 46.35924251833756,41.18071667516919,0 46.41346204771126,41.17841788224271,0 46.44127361113204,41.19070266410098,0 46.46052644083118,41.21004447149864,0 46.48921841312685,41.23570883496545,0 46.49992571005606,41.26211184915207,0 46.51106905429771,41.29520785111438,0 46.52093812397818,41.30822447349239,0 46.52351243433359,41.34838352045616,0 46.5252309386499,41.37515650858474,0 46.52738102506081,41.40862114563205,0 46.52953279269449,41.44208467456748,0 46.53168678136583,41.47554737894669,0 46.52450690141258,41.50946657468598,0 46.4984229782033,41.53070656409578,0 46.47267856199456,41.55864564162263,0 46.45527834611592,41.57278820142519,0 46.4117624801078,41.60811801287936,0 46.37733789777619,41.63623784726956,0 46.34296583161303,41.66432492867152,0 46.3353640999735,41.69146384505699,0 46.29136056526277,41.70642736508859,0 + 44.96350731236554,41.15320859428756,0 45.47368815564126,41.25737003874438,0 46.51069556499838,41.1322600469925,0 46.66485915982801,41.4525994818077,0 45.61305051117728,42.0680059365431,0 45.06167677281259,41.95900687709287,0 44.49296058310555,41.88792301650084,0 44.27148756997861,41.55459798246599,0 44.60564333557264,41.2710408266019,0 44.96350731236554,41.15320859428756,0 diff --git a/scripts/python/map_generator/configs/NTTR/boundary.kml b/scripts/python/map_generator/configs/NTTR/LowResolution.kml similarity index 100% rename from scripts/python/map_generator/configs/NTTR/boundary.kml rename to scripts/python/map_generator/configs/NTTR/LowResolution.kml diff --git a/scripts/python/map_generator/configs/NTTR/config.yml b/scripts/python/map_generator/configs/NTTR/LowResolution.yml similarity index 82% rename from scripts/python/map_generator/configs/NTTR/config.yml rename to scripts/python/map_generator/configs/NTTR/LowResolution.yml index 7583cafe..49b5c83c 100644 --- a/scripts/python/map_generator/configs/NTTR/config.yml +++ b/scripts/python/map_generator/configs/NTTR/LowResolution.yml @@ -1,5 +1,5 @@ { 'output_directory': '.\NTTR', # Where to save the output files - 'boundary_file': '.\configs\NTTR\boundary.kml', # Input kml file setting the boundary of the map to create + 'boundary_file': '.\configs\NTTR\LowResolution.kml', # Input kml file setting the boundary of the map to create 'zoom_factor': 0.5 # [0: maximum zoom in (things look very big), 1: maximum zoom out (things look very small)] } \ No newline at end of file diff --git a/scripts/python/map_generator/configs/NTTR/MediumResolution.kml b/scripts/python/map_generator/configs/NTTR/MediumResolution.kml new file mode 100644 index 00000000..c42c2156 --- /dev/null +++ b/scripts/python/map_generator/configs/NTTR/MediumResolution.kml @@ -0,0 +1,48 @@ + + + + MediumResolution.kml + + + normal + #s_ylw-pushpin + + + highlight + #s_ylw-pushpin_hl + + + + + + Untitled Polygon + #m_ylw-pushpin + + 1 + + + + -114.934770823132,36.0279645610818,0 -114.8423692017325,36.14486669307939,0 -114.8222988019772,36.33833555517232,0 -115.1043264248258,36.37857716972037,0 -115.4103523219488,36.37739101654672,0 -115.4685702901508,36.22908230367275,0 -115.3526428993333,35.95526029180954,0 -115.070949845899,35.9300532859497,0 -114.934770823132,36.0279645610818,0 + + + + + + + diff --git a/scripts/python/map_generator/configs/Syria/HighResolution.yml b/scripts/python/map_generator/configs/Syria/HighResolution.yml new file mode 100644 index 00000000..5bf95d5b --- /dev/null +++ b/scripts/python/map_generator/configs/Syria/HighResolution.yml @@ -0,0 +1,5 @@ +{ + 'output_directory': '.\Syria', # Where to save the output files + 'boundary_file': '.\configs\Syria\airbases.kml', # Input kml file setting the boundary of the map to create + 'zoom_factor': 0.1 # [0: maximum zoom in (things look very big), 1: maximum zoom out (things look very small)] +} \ No newline at end of file diff --git a/scripts/python/map_generator/configs/Syria/LowResolution.kml b/scripts/python/map_generator/configs/Syria/LowResolution.kml new file mode 100644 index 00000000..9057ad99 --- /dev/null +++ b/scripts/python/map_generator/configs/Syria/LowResolution.kml @@ -0,0 +1,77 @@ + + + + LowResolution.kml + + + normal + #sn_ylw-pushpin + + + highlight + #sh_ylw-pushpin + + + + + + Untitled Polygon + + #msn_ylw-pushpin + + + 1 + + + + 32.41977350619059,35.86470912083693,0 33.56465531835013,35.91338825318785,0 34.80465378369205,36.47063196055174,0 35.60801631485135,36.34864532719317,0 35.49398676174558,34.21289059062669,0 34.5206672018921,31.81057604629355,0 43.95360383704013,31.37489080200468,0 44.25820669948404,37.93208169895772,0 30.99244388115055,37.7086326320776,0 31.19610811985261,36.49739270534763,0 32.41977350619059,35.86470912083693,0 + + + + + + 1 + + + + 32.49633696227876,34.50684717795233,0 33.09849375950411,34.48604280166101,0 33.90493204321842,34.73753410158289,0 34.25924480309209,34.95889575718786,0 34.62649679333629,35.4114629095852,0 34.72182823714807,35.80074945874743,0 32.99109621791929,35.58668302906084,0 32.02791860799897,35.17891332024415,0 32.07780557518355,34.72891507299879,0 32.49633696227876,34.50684717795233,0 + + + + + + + + diff --git a/scripts/python/map_generator/configs/Syria/LowResolution.yml b/scripts/python/map_generator/configs/Syria/LowResolution.yml new file mode 100644 index 00000000..5431fc83 --- /dev/null +++ b/scripts/python/map_generator/configs/Syria/LowResolution.yml @@ -0,0 +1,5 @@ +{ + 'output_directory': '.\Syria', # Where to save the output files + 'boundary_file': '.\configs\Syria\LowResolution.kml', # Input kml file setting the boundary of the map to create + 'zoom_factor': 0.5 # [0: maximum zoom in (things look very big), 1: maximum zoom out (things look very small)] +} \ No newline at end of file diff --git a/scripts/python/map_generator/configs/Syria/MediumResolution.kml b/scripts/python/map_generator/configs/Syria/MediumResolution.kml new file mode 100644 index 00000000..5cda5f02 --- /dev/null +++ b/scripts/python/map_generator/configs/Syria/MediumResolution.kml @@ -0,0 +1,87 @@ + + + + MediumResolution.kml + + + normal + #sn_ylw-pushpin + + + highlight + #sh_ylw-pushpin + + + + + + Untitled Polygon + + #msn_ylw-pushpin + + + 1 + + + + 34.67142705790602,31.82805055444974,0 35.02181508963836,31.82750977829048,0 36.01467177481414,31.98675180910247,0 36.23127775126287,32.04983840957699,0 35.9582646803902,32.28158293849557,0 35.99098147339456,32.44310980472873,0 36.09260593928732,32.55565643757006,0 36.61524825014531,32.48930025627462,0 36.60745776125667,32.80133625144484,0 36.47504812245365,33.05297304144123,0 36.35141964104501,33.3083703333435,0 36.35264203669159,33.49386454528514,0 36.47877595475967,33.58571959973897,0 36.19517390228444,33.5997606321796,0 35.83522397638479,33.61896603596939,0 35.91132793661291,33.79098072794213,0 36.15374710260814,34.26719887569751,0 36.25809031624735,34.42504420256356,0 36.50878759959249,34.48069803556503,0 36.72702134605258,34.5389760993956,0 36.91155927128435,34.70573020374997,0 36.93709483596604,34.8575453420497,0 36.84204849159945,35.0188804802811,0 36.85909086701554,35.12582156419841,0 36.80631271949839,35.2023007921343,0 36.70610451487763,35.28868757265818,0 36.64736791080302,35.33884042510283,0 36.58285870081706,35.39379914572466,0 36.45913791605572,35.785089727734,0 36.53039600108779,35.94339777542626,0 36.67529798763221,36.16555606706433,0 37.19354340712839,36.10461671438422,0 37.30210041940058,36.1672896392403,0 37.26914131633509,36.28180024676594,0 37.10359257192819,36.30310271023975,0 37.00689884978731,36.29046216813635,0 36.76464397760902,36.31629718954267,0 36.58584728151514,36.41485334551175,0 36.43276721089462,36.51419040401807,0 36.55081614559194,36.74504433804638,0 36.64379067414161,36.89890120179727,0 36.65347158496201,37.09461289580837,0 36.5670026915683,37.32284183349276,0 36.18331192127231,37.44082203549982,0 35.69883621035919,37.46691398938869,0 35.10303034414353,37.32678813082578,0 34.73373550417249,37.10256441028478,0 34.54672782985384,36.94278408400594,0 33.82387226696957,36.35935429361331,0 34.00780785927724,36.27288227125526,0 34.71609500104023,36.80115830525168,0 35.31231838128146,36.54974589517469,0 35.56842677899099,36.54590520153501,0 36.03653930366797,36.90903074000526,0 36.19000487976967,36.62318809953995,0 35.80177667905849,36.33612053423278,0 35.99066329315939,35.96583287218078,0 35.69248548202563,35.56301025420937,0 35.92254840918157,35.19455893234127,0 35.98470152257408,34.47521931409463,0 35.58103018441831,34.26637735596449,0 35.05797659081225,32.82931778284781,0 34.96691044071693,32.82607518990291,0 34.67142705790602,31.82805055444974,0 + + + + + + 1 + + + + 32.87727021160179,34.63039920198953,0 32.89796765395525,34.54413238804481,0 33.0513805484542,34.53311613075366,0 33.06805771189331,34.58449144684735,0 33.30594035942946,34.68068961400989,0 33.60655009787457,34.7834317386,0 33.66048901593272,34.8393762347752,0 33.70608869593579,34.95372458806005,0 33.90513134812218,34.93229745061615,0 34.1071842570156,34.94799211011232,0 33.94596222366071,35.13090630203342,0 34.03291716899977,35.33217278671437,0 34.00480141824541,35.41895359888199,0 33.86414270927582,35.36764075672064,0 33.48955253703217,35.27107279823272,0 32.94309978357973,35.39409014047924,0 32.72304170959251,35.13465820902891,0 33.02509969669595,35.06722355440451,0 33.44152949697186,35.00493863785168,0 33.43618672640994,34.91604930651071,0 33.31998050412736,34.76455001947792,0 32.87980862276667,34.77470445862257,0 32.7489895060826,34.66006328417646,0 32.87727021160179,34.63039920198953,0 + + + + + + 1 + + + + 37.316751241333,36.13625362966467,0 37.4802212403484,35.98662494935605,0 37.69339926931355,35.87154344120644,0 38.14290686820461,35.77632913948397,0 38.5968154612054,35.78564003854654,0 38.89284932130154,35.8779076116201,0 39.07507331612245,35.86639415034433,0 39.20140789434584,35.82480100674179,0 39.2433581758882,35.91988707796679,0 39.14777729544377,36.06853895742726,0 39.05867321853522,36.17697296815244,0 38.94276312671954,36.17039388164508,0 38.82993809202534,36.02864047564345,0 38.7422129714303,35.90314522534125,0 38.64230099519071,35.87869415817486,0 38.35798797186277,35.94095820496009,0 38.13165022867805,35.95691377930053,0 37.93541220365955,36.10819502548598,0 37.67868372711114,36.15507075771183,0 37.36536807770124,36.17289309161047,0 37.316751241333,36.13625362966467,0 + + + + + + + + diff --git a/scripts/python/map_generator/configs/Syria/MediumResolution.yml b/scripts/python/map_generator/configs/Syria/MediumResolution.yml new file mode 100644 index 00000000..d58992d8 --- /dev/null +++ b/scripts/python/map_generator/configs/Syria/MediumResolution.yml @@ -0,0 +1,5 @@ +{ + 'output_directory': '.\Syria', # Where to save the output files + 'boundary_file': '.\configs\Syria\MediumResolution.kml', # Input kml file setting the boundary of the map to create + 'zoom_factor': 0.25 # [0: maximum zoom in (things look very big), 1: maximum zoom out (things look very small)] +} \ No newline at end of file diff --git a/scripts/python/map_generator/configs/Syria/airbases.json b/scripts/python/map_generator/configs/Syria/airbases.json new file mode 100644 index 00000000..956ef871 --- /dev/null +++ b/scripts/python/map_generator/configs/Syria/airbases.json @@ -0,0 +1 @@ +{"airbases":{"1":{"callsign":"Abu al-Duhur","coalition":"neutral","latitude":35.731462428174126,"longitude":37.118801734534124},"10":{"callsign":"Eyn Shemer","coalition":"neutral","latitude":32.439769207087814,"longitude":35.014693873498182},"11":{"callsign":"Gaziantep","coalition":"neutral","latitude":36.951397233614131,"longitude":37.464512889797774},"12":{"callsign":"H4","coalition":"neutral","latitude":32.536851104207152,"longitude":38.206376228871967},"13":{"callsign":"Haifa","coalition":"neutral","latitude":32.80645293353016,"longitude":35.045020760350418},"14":{"callsign":"Hama","coalition":"neutral","latitude":35.116099484430912,"longitude":36.725473471909822},"15":{"callsign":"Hatay","coalition":"neutral","latitude":36.371269972813778,"longitude":36.298090184912539},"16":{"callsign":"Incirlik","coalition":"neutral","latitude":36.994254281542126,"longitude":35.412713065757174},"17":{"callsign":"Jirah","coalition":"neutral","latitude":36.094487121628859,"longitude":37.951086106528166},"18":{"callsign":"Khalkhalah","coalition":"neutral","latitude":33.063610282660193,"longitude":36.55978474872245},"19":{"callsign":"King Hussein Air College","coalition":"neutral","latitude":32.348793954816813,"longitude":36.270213489365986},"2":{"callsign":"Adana Sakirpasa","coalition":"neutral","latitude":36.988281127829111,"longitude":35.291372307264709},"20":{"callsign":"Kiryat Shmona","coalition":"neutral","latitude":33.212372031644627,"longitude":35.592419825247276},"21":{"callsign":"Bassel Al-Assad","coalition":"neutral","latitude":35.411589930352797,"longitude":35.950032835140483},"22":{"callsign":"Marj as Sultan North","coalition":"neutral","latitude":33.500422745428381,"longitude":36.466321617972277},"23":{"callsign":"Marj Ruhayyil","coalition":"neutral","latitude":33.279509844412281,"longitude":36.446981161336652},"24":{"callsign":"Megiddo","coalition":"neutral","latitude":32.597577825283345,"longitude":35.220203449453585},"25":{"callsign":"Mezzeh","coalition":"neutral","latitude":33.482713511778257,"longitude":36.235064059082973},"26":{"callsign":"Minakh","coalition":"neutral","latitude":36.522812218952801,"longitude":37.033622455644675},"27":{"callsign":"Aleppo","coalition":"neutral","latitude":36.182211524330668,"longitude":37.210383232385013},"28":{"callsign":"Palmyra","coalition":"neutral","latitude":34.558235536658664,"longitude":38.331123062337142},"29":{"callsign":"Qabr as Sitt","coalition":"neutral","latitude":33.458606617205731,"longitude":36.35688085945619},"3":{"callsign":"Al Qusayr","coalition":"neutral","latitude":34.566877297301907,"longitude":36.585414775399961},"30":{"callsign":"Ramat David","coalition":"neutral","latitude":32.674025544788492,"longitude":35.178119934482311},"31":{"callsign":"Kuweires","coalition":"neutral","latitude":36.189374426079866,"longitude":37.570439309206158},"32":{"callsign":"Rayak","coalition":"neutral","latitude":33.842901825230484,"longitude":35.976931824796971},"33":{"callsign":"Rene Mouawad","coalition":"neutral","latitude":34.583953310217595,"longitude":35.998687256699625},"34":{"callsign":"Rosh Pina","coalition":"neutral","latitude":32.979281676489968,"longitude":35.57265120828523},"35":{"callsign":"Sayqal","coalition":"neutral","latitude":33.680052164368924,"longitude":37.204068911005457},"36":{"callsign":"Shayrat","coalition":"neutral","latitude":34.494640308216503,"longitude":36.894468654443422},"37":{"callsign":"Tabqa","coalition":"neutral","latitude":35.755613770804736,"longitude":38.55125077551552},"38":{"callsign":"Taftanaz","coalition":"neutral","latitude":35.973223381816155,"longitude":36.785894108747613},"39":{"callsign":"Tiyas","coalition":"neutral","latitude":34.522531432479404,"longitude":37.645765105063163},"4":{"callsign":"An Nasiriyah","coalition":"neutral","latitude":33.926565973609577,"longitude":36.875344527766529},"40":{"callsign":"Wujah Al Hajar","coalition":"neutral","latitude":34.286960508475296,"longitude":35.683990308563061},"41":{"callsign":"Gazipasa","coalition":"neutral","latitude":36.297823085147137,"longitude":32.286068490304899},"42":{"callsign":"Deir ez-Zor","coalition":"neutral","latitude":35.28082889783262,"longitude":40.190671143218829},"43":{"callsign":"Nicosia","coalition":"neutral","latitude":35.150919822632147,"longitude":33.275002451661436},"44":{"callsign":"Akrotiri","coalition":"neutral","latitude":34.594065664734238,"longitude":32.974818319371572},"45":{"callsign":"Kingsfield","coalition":"neutral","latitude":35.016621196806902,"longitude":33.721655835023832},"46":{"callsign":"Paphos","coalition":"neutral","latitude":34.722393258149616,"longitude":32.471801697208519},"47":{"callsign":"Larnaca","coalition":"neutral","latitude":34.865619667975473,"longitude":33.613584325006137},"48":{"callsign":"Lakatamia","coalition":"neutral","latitude":35.106311731529431,"longitude":33.321670653774945},"49":{"callsign":"Ercan","coalition":"neutral","latitude":35.159249791335753,"longitude":33.490110581330427},"5":{"callsign":"Tha'lah","coalition":"neutral","latitude":32.698127092337366,"longitude":36.402739209399499},"50":{"callsign":"Gecitkale","coalition":"neutral","latitude":35.236403909863618,"longitude":33.707277702802635},"51":{"callsign":"Pinarbashi","coalition":"neutral","latitude":35.278334798851844,"longitude":33.267014299869707},"52":{"callsign":"Naqoura","coalition":"neutral","latitude":33.107906290458089,"longitude":35.127285028126536},"53":{"callsign":"H3","coalition":"neutral","latitude":32.940993052246142,"longitude":39.732582868535893},"54":{"callsign":"H3 Northwest","coalition":"neutral","latitude":33.070356444511376,"longitude":39.606625887769837},"55":{"callsign":"H3 Southwest","coalition":"neutral","latitude":32.738030133824843,"longitude":39.612247285994648},"56":{"callsign":"Ruwayshid","coalition":"neutral","latitude":32.403696420912183,"longitude":39.142215977075757},"57":{"callsign":"Sanliurfa","coalition":"neutral","latitude":37.460456062346502,"longitude":38.91285218993486},"58":{"callsign":"Kharab Ishk","coalition":"neutral","latitude":36.546920822447966,"longitude":38.587524390197125},"59":{"callsign":"Tal Siman","coalition":"neutral","latitude":36.263473166914288,"longitude":38.924054611964024},"6":{"callsign":"Beirut-Rafic Hariri","coalition":"neutral","latitude":33.836465479357152,"longitude":35.487416760577062},"60":{"callsign":"At Tanf","coalition":"neutral","latitude":33.506450704748517,"longitude":38.614883357323549},"61":{"callsign":"Prince Hassan","coalition":"neutral","latitude":32.152160716832356,"longitude":37.160581283742239},"62":{"callsign":"King Abdullah II","coalition":"neutral","latitude":31.999536588953415,"longitude":36.231477740267714},"63":{"callsign":"Herzliya","coalition":"neutral","latitude":32.178557007771879,"longitude":34.839785350037232},"64":{"callsign":"Amman","coalition":"neutral","latitude":31.978338599509446,"longitude":36.006027748819541},"65":{"callsign":"Muwaffaq Salti","coalition":"neutral","latitude":31.819163353568673,"longitude":36.790772280097869},"7":{"callsign":"Damascus","coalition":"neutral","latitude":33.415340013894998,"longitude":36.504254828585751},"8":{"callsign":"Marj as Sultan South","coalition":"neutral","latitude":33.487483451401559,"longitude":36.47505082659454},"9":{"callsign":"Al-Dumayr","coalition":"neutral","latitude":33.60465744931787,"longitude":36.735832718420838}},"frameRate":9,"load":0,"sessionHash":"UCuzbHgH33avh5eQ","time":"1709467547694"} \ No newline at end of file diff --git a/scripts/python/map_generator/configs/Syria/airbases.kml b/scripts/python/map_generator/configs/Syria/airbases.kml new file mode 100644 index 00000000..99022824 --- /dev/null +++ b/scripts/python/map_generator/configs/Syria/airbases.kml @@ -0,0 +1 @@ +doc namedoc description1namedescription137.008139,35.641631 37.008139,35.821294 37.229464,35.821294 37.229464,35.641631 37.008139,35.641631namedescription134.908253,32.349938 34.908253,32.529601 35.121135,32.529601 35.121135,32.349938 34.908253,32.349938namedescription137.352103,36.861566 37.352103,37.041229 37.576922,37.041229 37.576922,36.861566 37.352103,36.861566namedescription138.099820,32.447020 38.099820,32.626683 38.312932,32.626683 38.312932,32.447020 38.099820,32.447020namedescription134.938143,32.716621 34.938143,32.896284 35.151899,32.896284 35.151899,32.716621 34.938143,32.716621namedescription136.615653,35.026268 36.615653,35.205931 36.835294,35.205931 36.835294,35.026268 36.615653,35.026268namedescription136.186525,36.281438 36.186525,36.461102 36.409656,36.461102 36.409656,36.281438 36.186525,36.281438namedescription135.300240,36.904423 35.300240,37.084086 35.525186,37.084086 35.525186,36.904423 35.300240,36.904423namedescription137.839915,36.004656 37.839915,36.184319 38.062257,36.184319 38.062257,36.004656 37.839915,36.004656namedescription136.452596,32.973779 36.452596,33.153442 36.666974,33.153442 36.666974,32.973779 36.452596,32.973779namedescription136.163880,32.258962 36.163880,32.438625 36.376547,32.438625 36.376547,32.258962 36.163880,32.258962namedescription135.178908,36.898450 35.178908,37.078113 35.403836,37.078113 35.403836,36.898450 35.178908,36.898450namedescription135.485049,33.122541 35.485049,33.302204 35.699791,33.302204 35.699791,33.122541 35.485049,33.122541namedescription135.839812,35.321758 35.839812,35.501421 36.060254,35.501421 36.060254,35.321758 35.839812,35.321758namedescription136.358595,33.410591 36.358595,33.590254 36.574049,33.590254 36.574049,33.410591 36.358595,33.410591namedescription136.339528,33.189678 36.339528,33.369341 36.554435,33.369341 36.554435,33.189678 36.339528,33.189678namedescription135.113575,32.507746 35.113575,32.687409 35.326832,32.687409 35.326832,32.507746 35.113575,32.507746namedescription136.127359,33.392882 36.127359,33.572545 36.342769,33.572545 36.342769,33.392882 36.127359,33.392882namedescription136.921839,36.432981 36.921839,36.612644 37.145406,36.612644 37.145406,36.432981 36.921839,36.432981namedescription137.099088,36.092380 37.099088,36.272043 37.321679,36.272043 37.321679,36.092380 37.099088,36.092380namedescription138.222045,34.468404 38.222045,34.648067 38.440201,34.648067 38.440201,34.468404 38.222045,34.468404namedescription136.249206,33.368775 36.249206,33.548438 36.464556,33.548438 36.464556,33.368775 36.249206,33.368775namedescription136.476325,34.477046 36.476325,34.656709 36.694505,34.656709 36.694505,34.477046 36.476325,34.477046namedescription135.071401,32.584194 35.071401,32.763857 35.284839,32.763857 35.284839,32.584194 35.071401,32.584194namedescription137.459134,36.099543 37.459134,36.279206 37.681745,36.279206 37.681745,36.099543 37.459134,36.099543namedescription135.868775,33.753070 35.868775,33.932733 36.085089,33.932733 36.085089,33.753070 35.868775,33.753070namedescription135.889575,34.494122 35.889575,34.673785 36.107799,34.673785 36.107799,34.494122 35.889575,34.494122namedescription135.465565,32.889450 35.465565,33.069113 35.679738,33.069113 35.679738,32.889450 35.465565,32.889450namedescription137.096117,33.590221 37.096117,33.769884 37.312020,33.769884 37.312020,33.590221 37.096117,33.590221namedescription136.785474,34.404809 36.785474,34.584472 37.003464,34.584472 37.003464,34.404809 36.785474,34.404809namedescription138.440555,35.665782 38.440555,35.845445 38.661947,35.845445 38.661947,35.665782 38.440555,35.665782namedescription136.674894,35.883392 36.674894,36.063055 36.896894,36.063055 36.896894,35.883392 36.674894,35.883392namedescription137.536733,34.432700 37.536733,34.612363 37.754797,34.612363 37.754797,34.432700 37.536733,34.432700namedescription136.767082,33.836734 36.767082,34.016398 36.983607,34.016398 36.983607,33.836734 36.767082,33.836734namedescription135.575265,34.197129 35.575265,34.376792 35.792715,34.376792 35.792715,34.197129 35.575265,34.197129namedescription132.174608,36.207992 32.174608,36.387655 32.397529,36.387655 32.397529,36.207992 32.174608,36.207992namedescription140.080628,35.190997 40.080628,35.370660 40.300714,35.370660 40.300714,35.190997 40.080628,35.190997namedescription133.165135,35.061088 33.165135,35.240751 33.384870,35.240751 33.384870,35.061088 33.165135,35.061088namedescription132.865693,34.504234 32.865693,34.683897 33.083944,34.683897 33.083944,34.504234 32.865693,34.504234namedescription133.611970,34.926790 33.611970,35.106453 33.831342,35.106453 33.831342,34.926790 33.611970,34.926790namedescription132.362507,34.632562 32.362507,34.812225 32.581096,34.812225 32.581096,34.632562 32.362507,34.632562namedescription133.504100,34.775788 33.504100,34.955451 33.723069,34.955451 33.723069,34.775788 33.504100,34.775788namedescription133.211864,35.016480 33.211864,35.196143 33.431478,35.196143 33.431478,35.016480 33.211864,35.016480namedescription133.380232,35.069418 33.380232,35.249081 33.599989,35.249081 33.599989,35.069418 33.380232,35.069418namedescription136.295991,32.608296 36.295991,32.787959 36.509487,32.787959 36.509487,32.608296 36.295991,32.608296namedescription133.597295,35.146572 33.597295,35.326235 33.817260,35.326235 33.817260,35.146572 33.597295,35.146572namedescription133.156975,35.188503 33.156975,35.368166 33.377054,35.368166 33.377054,35.188503 33.156975,35.188503namedescription135.020042,33.018075 35.020042,33.197738 35.234528,33.197738 35.234528,33.018075 35.020042,33.018075namedescription139.625543,32.851162 39.625543,33.030825 39.839623,33.030825 39.839623,32.851162 39.625543,32.851162namedescription139.499429,32.980525 39.499429,33.160188 39.713823,33.160188 39.713823,32.980525 39.499429,32.980525namedescription139.505451,32.648199 39.505451,32.827862 39.719043,32.827862 39.719043,32.648199 39.505451,32.648199namedescription139.035817,32.313865 39.035817,32.493528 39.248614,32.493528 39.248614,32.313865 39.035817,32.313865namedescription138.799682,37.370625 38.799682,37.550288 39.026022,37.550288 39.026022,37.370625 38.799682,37.370625namedescription138.475706,36.457089 38.475706,36.636752 38.699343,36.636752 38.699343,36.457089 38.475706,36.457089namedescription138.812643,36.173642 38.812643,36.353305 39.035466,36.353305 39.035466,36.173642 38.812643,36.173642namedescription135.379268,33.746634 35.379268,33.926297 35.595565,33.926297 35.595565,33.746634 35.379268,33.746634namedescription138.507149,33.416619 38.507149,33.596282 38.722618,33.596282 38.722618,33.416619 38.507149,33.416619namedescription137.054477,32.062329 37.054477,32.241992 37.266685,32.241992 37.266685,32.062329 37.054477,32.062329namedescription136.125551,31.909705 36.125551,32.089368 36.337405,32.089368 36.337405,31.909705 36.125551,31.909705namedescription134.733651,32.088725 34.733651,32.268389 34.945920,32.268389 34.945920,32.088725 34.733651,32.088725namedescription135.900125,31.888507 35.900125,32.068170 36.111930,32.068170 36.111930,31.888507 35.900125,31.888507namedescription136.685053,31.729332 36.685053,31.908995 36.896492,31.908995 36.896492,31.729332 36.685053,31.729332namedescription136.396634,33.325508 36.396634,33.505172 36.611876,33.505172 36.611876,33.325508 36.396634,33.325508namedescription136.367340,33.397652 36.367340,33.577315 36.582762,33.577315 36.582762,33.397652 36.367340,33.397652namedescription136.627976,33.514826 36.627976,33.694489 36.843690,33.694489 36.843690,33.514826 36.627976,33.514826 \ No newline at end of file diff --git a/scripts/python/map_generator/configs/Test/LowResolution.kml b/scripts/python/map_generator/configs/Test/LowResolution.kml new file mode 100644 index 00000000..70a871ef --- /dev/null +++ b/scripts/python/map_generator/configs/Test/LowResolution.kml @@ -0,0 +1,48 @@ + + + + LowResolution.kml + + + normal + #s_ylw-pushpin + + + highlight + #s_ylw-pushpin_hl + + + + + + Untitled Polygon + #m_ylw-pushpin + + 1 + + + + 36.39481280710839,34.53819230857288,0 37.1796694816022,34.53262792655826,0 37.16621384783188,34.96261757019548,0 36.40060390213443,34.96928234867986,0 36.39481280710839,34.53819230857288,0 + + + + + + + diff --git a/scripts/python/map_generator/configs/Test/LowResolution.yml b/scripts/python/map_generator/configs/Test/LowResolution.yml new file mode 100644 index 00000000..b2559a14 --- /dev/null +++ b/scripts/python/map_generator/configs/Test/LowResolution.yml @@ -0,0 +1,5 @@ +{ + 'output_directory': '.\Test', # Where to save the output files + 'boundary_file': '.\configs\Test\LowResolution.kml', # Input kml file setting the boundary of the map to create + 'zoom_factor': 0.5 # [0: maximum zoom in (things look very big), 1: maximum zoom out (things look very small)] +} \ No newline at end of file diff --git a/scripts/python/map_generator/configs/Test/MediumResolution.kml b/scripts/python/map_generator/configs/Test/MediumResolution.kml new file mode 100644 index 00000000..c987d009 --- /dev/null +++ b/scripts/python/map_generator/configs/Test/MediumResolution.kml @@ -0,0 +1,48 @@ + + + + MediumResolution.kml + + + normal + #s_ylw-pushpin + + + highlight + #s_ylw-pushpin_hl + + + + + + Untitled Polygon + #m_ylw-pushpin + + 1 + + + + 36.66523183398584,34.6677562111174,0 36.7942537132104,34.66437454529529,0 36.83169732011983,34.73421112648619,0 36.82035549501334,34.78872158568599,0 36.81876694797644,34.78938919967693,0 36.71678396314233,34.81175454434261,0 36.71358833183864,34.81177596936792,0 36.64080355603824,34.80367957661652,0 36.61013139556666,34.76382161679572,0 36.60930683760219,34.76054596757088,0 36.60928608362357,34.75792169295608,0 36.60927570797851,34.75660959986943,0 36.61934895519745,34.71456838542862,0 36.64380557289082,34.68164055942542,0 36.66523183398584,34.6677562111174,0 + + + + + + + diff --git a/scripts/python/map_generator/configs/Test/MediumResolution.yml b/scripts/python/map_generator/configs/Test/MediumResolution.yml new file mode 100644 index 00000000..9feeb335 --- /dev/null +++ b/scripts/python/map_generator/configs/Test/MediumResolution.yml @@ -0,0 +1,5 @@ +{ + 'output_directory': '.\Test', # Where to save the output files + 'boundary_file': '.\configs\Test\MediumResolution.kml', # Input kml file setting the boundary of the map to create + 'zoom_factor': 0.25 # [0: maximum zoom in (things look very big), 1: maximum zoom out (things look very small)] +} \ No newline at end of file diff --git a/scripts/python/map_generator/map_generator.py b/scripts/python/map_generator/map_generator.py index 78f914c7..01b6b7e5 100644 --- a/scripts/python/map_generator/map_generator.py +++ b/scripts/python/map_generator/map_generator.py @@ -102,9 +102,10 @@ def merge_tiles(base_path, zoom, tile): # If the image already exists, open it so we can paste the higher quality data in it if os.path.exists(os.path.join(base_path, str(zoom - 1), str(X), f"{Y}.jpg")): dst = Image.open(os.path.join(base_path, str(zoom - 1), str(X), f"{Y}.jpg")) + dst.putalpha(255) dst = make_background_transparent(dst) else: - dst = Image.new('RGB', (256, 256), (221, 221, 221)) + dst = Image.new('RGBA', (256, 256), (221, 221, 221, 255)) # Loop on all the 4 subtiles in the tile positions = [(0, 0), (0, 1), (1, 0), (1, 1)] @@ -112,8 +113,9 @@ def merge_tiles(base_path, zoom, tile): # Open the subtile, if it exists, and resize it down to 128x128 if os.path.exists(os.path.join(base_path, str(zoom), str(2*X + positions[i][0]), f"{2*Y + positions[i][1]}.jpg")): im = Image.open(os.path.join(base_path, str(zoom), str(2*X + positions[i][0]), f"{2*Y + positions[i][1]}.jpg")).resize((128, 128)) + im.putalpha(255) im = make_background_transparent(im) - dst.paste(im, (positions[i][0] * 128, positions[i][1] * 128)) + dst.paste(im, (positions[i][0] * 128, positions[i][1] * 128), im) # Create the output folder if it exists if not os.path.exists(os.path.join(base_path, str(zoom - 1), str(X))): @@ -126,19 +128,114 @@ def merge_tiles(base_path, zoom, tile): raise e # Save the image - dst.convert('RGB').save(os.path.join(base_path, str(zoom - 1), str(X), f"{Y}.jpg"), quality=95) + remove_black_areas(dst.convert('RGB')).save(os.path.join(base_path, str(zoom - 1), str(X), f"{Y}.jpg"), quality=98) + +def computeCorrectionFactor(XY, n_width, n_height, map_config, zoom, output_directory, port): + # Take screenshots at the given position, then east and south of it + takeScreenshot(XY, 0, 0, map_config, zoom, output_directory, "calib", "ref", port) + takeScreenshot((XY[0] + n_width, XY[1]), 0, 0, map_config, zoom, output_directory, "calib", "lng", port) + takeScreenshot((XY[0], XY[1] + n_height), 0, 0, map_config, zoom, output_directory, "calib", "lat", port) + calib_ref = Image.open(os.path.join(output_directory, "screenshots", f"calib_ref_{zoom}.jpg")) + calib_lat = Image.open(os.path.join(output_directory, "screenshots", f"calib_lat_{zoom}.jpg")) + calib_lng = Image.open(os.path.join(output_directory, "screenshots", f"calib_lng_{zoom}.jpg")) + + # These calibration boxes are located at the edge of the interest region + box1 = (calib_ref.width / 2 + n_width / 2 * 256 - 50, calib_ref.height / 2 - n_height / 2 * 256 + 10, + calib_ref.width / 2 + n_width / 2 * 256 + 50, calib_ref.height / 2 + n_height / 2 * 256 - 10) + box2 = (calib_ref.width / 2 - n_width / 2 * 256 - 50, calib_ref.height / 2 - n_height / 2 * 256 + 10, + calib_ref.width / 2 - n_width / 2 * 256 + 50, calib_ref.height / 2 + n_height / 2 * 256 - 10) + + box3 = (calib_ref.width / 2 - n_width / 2 * 256 + 10, calib_ref.height / 2 + n_height / 2 * 256 - 50, + calib_ref.width / 2 + n_width / 2 * 256 - 10, calib_ref.height / 2 + n_height / 2 * 256 + 50) + box4 = (calib_ref.width / 2 - n_width / 2 * 256 + 10, calib_ref.height / 2 - n_height / 2 * 256 - 50, + calib_ref.width / 2 + n_width / 2 * 256 - 10, calib_ref.height / 2 - n_height / 2 * 256 + 50) + + # Find the best correction factor to bring the two images to be equal on the longitude direction + best_err = None + best_delta_width = 0 + for delta_width in range(-5, 6): + calib_box1 = calib_ref.resize((calib_ref.width + delta_width, calib_ref.height)).crop(box1).convert('L') + calib_box2 = calib_lng.resize((calib_ref.width + delta_width, calib_ref.height)).crop(box2).convert('L') + err = computeDifference(calib_box1, calib_box2) + if best_err is None or err < best_err: + best_delta_width = delta_width + best_err = err + + # Find the best correction factor to bring the two images to be equal on the latitude direction + best_err = None + best_delta_height = 0 + for delta_height in range(-5, 6): + calib_box3 = calib_ref.resize((calib_ref.width, calib_ref.height + delta_height)).crop(box3).convert('L') + calib_box4 = calib_lat.resize((calib_ref.width, calib_ref.height + delta_height)).crop(box4).convert('L') + err = computeDifference(calib_box3, calib_box4) + if best_err is None or err < best_err: + best_delta_height = delta_height + best_err = err + + return (best_delta_width, best_delta_height) + +def computeDifference(imageA, imageB): + err = numpy.sum((numpy.array(imageA).astype('float') - numpy.array(imageB).astype('float')) ** 2) + err /= float(imageA.width * imageA.height) + return err + +def takeScreenshot(XY, n_width, n_height, map_config, zoom, output_directory, f, n, port, correction = (0, 0)): + # Making PUT request + # If the number of rows or columns is odd, we need to take the picture at the CENTER of the tile! + lat, lng = num_to_deg(XY[0] + (n_width % 2) / 2, XY[1] + (n_height % 2) / 2, zoom) + data = json.dumps({'lat': lat, 'lng': lng, 'alt': 1350 + map_config['zoom_factor'] * (25000 - 1350), 'mode': 'map'}) + r = requests.put(f'http://127.0.0.1:{port}', data = data) + + geo_data = json.loads(r.text) + + time.sleep(0.2) + + # Take and save screenshot. The response to the put request contains data, among which there is the north rotation at that point. + screenshot = pyautogui.screenshot() + + # Scale the screenshot to account for Mercator Map Deformation + lat1, lng1 = num_to_deg(XY[0], XY[1], zoom) + lat2, lng2 = num_to_deg(XY[0] + 1, XY[1] + 1, zoom) + + deltaLat = abs(lat2 - lat1) + deltaLng = abs(lng2 - lng1) + + # Compute the height and width each tile should have + m_height = math.radians(deltaLat) * R + m_width = math.radians(deltaLng) * R * math.cos(math.radians(lat1)) + + # Compute the height and width the tile has + s_height = map_config['mpps'] * 256 + s_width = map_config['mpps'] * 256 + + # Compute the scaling required to achieve that + sx = s_width / m_width + sy = s_height / m_height + + # Rotate, resize and save the screenshot + screenshot.rotate(math.degrees(geo_data['northRotation'])).resize((int(sx * screenshot.width) + correction[0], int(sy * screenshot.height)+ correction[1] )).save(os.path.join(output_directory, "screenshots", f"{f}_{n}_{zoom}.jpg"), quality=98) + def make_background_transparent(im): - im.putalpha(255) data = numpy.array(im) red, green, blue, alpha = data.T # If present, remove any "background" areas - background_areas = (red == 221) & (blue == 221) & (green == 221) + background_areas = (red > 211) & (red < 231) & (green > 211) & (green < 231) & (blue > 211) & (blue < 231) data[..., :][background_areas.T] = (0, 0, 0, 0) # make transparent return Image.fromarray(data) +def remove_black_areas(im): + data = numpy.array(im) + red, green, blue = data.T + + # If present, remove any "black" areas + background_areas = (red < 10) & (blue < 10) & (green < 10) + data[..., :][background_areas.T] = (221, 221, 221) + + return Image.fromarray(data) + def run(map_config, port): global tot_futs, fut_counter @@ -151,10 +248,12 @@ def run(map_config, port): os.mkdir(output_directory) skip_screenshots = False + replace_screenshots = True if not os.path.exists(os.path.join(output_directory, "screenshots")): os.mkdir(os.path.join(output_directory, "screenshots")) else: skip_screenshots = (input("Raw screenshots already found for this config, do you want to skip directly to tiles extraction? Enter y to skip: ") == "y") + replace_screenshots = (input("Do you want to replace the existing screenshots? Enter y to replace: ") == "y") if not os.path.exists(os.path.join(output_directory, "tiles")): os.mkdir(os.path.join(output_directory, "tiles")) @@ -218,45 +317,16 @@ def run(map_config, port): print(f"Feature {f} of {len(features)}, {len(screenshots_XY)} screenshots will be taken") # Start looping + correction = None if not skip_screenshots: print(f"Feature {f} of {len(features)}, taking screenshots...") n = 0 for XY in screenshots_XY: - # Making PUT request - # If the number of rows or columns is odd, we need to take the picture at the CENTER of the tile! - lat, lng = num_to_deg(XY[0] + (n_width % 2) / 2, XY[1] + (n_height % 2) / 2, zoom) - data = json.dumps({'lat': lat, 'lng': lng, 'alt': 1350 + map_config['zoom_factor'] * (25000 - 1350), 'mode': 'map'}) - r = requests.put(f'http://127.0.0.1:{port}', data = data) - - geo_data = json.loads(r.text) - - time.sleep(0.1) - - # Take and save screenshot. The response to the put request contains data, among which there is the north rotation at that point. - screenshot = pyautogui.screenshot() - - # Scale the screenshot to account for Mercator Map Deformation - lat1, lng1 = num_to_deg(XY[0], XY[1], zoom) - lat2, lng2 = num_to_deg(XY[0] + 1, XY[1] + 1, zoom) - - deltaLat = abs(lat2 - lat1) - deltaLng = abs(lng2 - lng1) - - # Compute the height and width the screenshot should have - m_height = math.radians(deltaLat) * R * n_height - m_width = math.radians(deltaLng) * R * math.cos(math.radians(lat1)) * n_width - - # Compute the height and width the screenshot has - s_height = map_config['mpps'] * 256 * n_height - s_width = map_config['mpps'] * 256 * n_width + if not os.path.exists(os.path.join(output_directory, "screenshots", f"{f}_{n}_{zoom}.jpg")) or replace_screenshots: + if n % 10 == 0 or correction is None: + correction = computeCorrectionFactor(XY, n_width, n_height, map_config, zoom, output_directory, port) + takeScreenshot(XY, n_width, n_height, map_config, zoom, output_directory, f, n, port, correction) - # Compute the scaling required to achieve that - sx = s_width / m_width - sy = s_height / m_height - - # Resize, rotate and save the screenshot - screenshot.resize((int(sx * screenshot.width), int(sy * screenshot.height))).rotate(math.degrees(geo_data['northRotation'])).save(os.path.join(output_directory, "screenshots", f"{f}_{n}_{zoom}.jpg"), quality=95) - printProgressBar(n + 1, len(screenshots_XY)) n += 1