From 798c3d279c80790ed6435e06f2434822e0135e9c Mon Sep 17 00:00:00 2001 From: AthithiyaM Date: Sun, 16 Jul 2023 10:25:48 -0400 Subject: [PATCH 1/4] STRAT15-174 --- .../elevations/appended_coordinates.csv | 208 ++++++++++++++++++ routemodelv2/elevations/get_elevation_data.py | 35 +++ .../elevations/sample_coordinates.csv | 208 ++++++++++++++++++ 3 files changed, 451 insertions(+) create mode 100644 routemodelv2/elevations/appended_coordinates.csv create mode 100644 routemodelv2/elevations/get_elevation_data.py create mode 100644 routemodelv2/elevations/sample_coordinates.csv diff --git a/routemodelv2/elevations/appended_coordinates.csv b/routemodelv2/elevations/appended_coordinates.csv new file mode 100644 index 0000000..0b645f4 --- /dev/null +++ b/routemodelv2/elevations/appended_coordinates.csv @@ -0,0 +1,208 @@ +Unnamed: 0,coordinates,latitude,longitude,elevation +0,"(43.467879339595996, -80.56616840836313)",43.467879339596,-80.56616840836313,347.0 +1,"(43.46797804546268, -80.5658911293861)",43.46797804546268,-80.5658911293861,347.0 +2,"(43.46807675065529, -80.56561384950668)",43.46807675065529,-80.56561384950668,347.0 +3,"(43.46817545517384, -80.56533656872487)",43.46817545517384,-80.56533656872487,347.0 +4,"(43.46827415901829, -80.5650592870407)",43.46827415901829,-80.5650592870407,347.0 +5,"(43.46837286218867, -80.56478200445413)",43.46837286218867,-80.56478200445413,346.0 +6,"(43.468471564684975, -80.56450472096518)",43.468471564684975,-80.56450472096518,344.0 +7,"(43.46857026650717, -80.56422743657384)",43.46857026650717,-80.56422743657384,344.0 +8,"(43.46866896765528, -80.56395015128014)",43.46866896765528,-80.56395015128014,344.0 +9,"(43.46876766812929, -80.56367286508403)",43.46876766812929,-80.56367286508403,344.0 +10,"(43.4688663679292, -80.56339557798556)",43.4688663679292,-80.56339557798556,344.0 +11,"(43.46896506705499, -80.56311828998469)",43.46896506705499,-80.56311828998469,345.0 +12,"(43.469063765506675, -80.56284100108142)",43.46906376550668,-80.56284100108142,346.0 +13,"(43.46916246328424, -80.5625637112758)",43.46916246328424,-80.5625637112758,346.0 +14,"(43.46926116038769, -80.56228642056779)",43.46926116038769,-80.56228642056779,345.0 +15,"(43.46935985681701, -80.56200912895738)",43.46935985681701,-80.56200912895738,343.0 +16,"(43.4694585525722, -80.56173183644461)",43.4694585525722,-80.56173183644461,343.0 +17,"(43.46955724765325, -80.56145454302944)",43.46955724765325,-80.56145454302944,343.0 +18,"(43.469655942060164, -80.5611772487119)",43.46965594206016,-80.5611772487119,343.0 +19,"(43.46975463579293, -80.56089995349197)",43.46975463579293,-80.56089995349197,341.0 +20,"(43.469853328851556, -80.56062265736965)",43.46985332885156,-80.56062265736965,339.0 +21,"(43.46995202123602, -80.56034536034497)",43.46995202123602,-80.56034536034497,338.0 +22,"(43.47005071294634, -80.56006806241788)",43.47005071294634,-80.56006806241788,338.0 +23,"(43.47014940398248, -80.55979076358844)",43.47014940398248,-80.55979076358844,339.0 +24,"(43.47024809434446, -80.55951346385659)",43.47024809434446,-80.55951346385659,339.0 +25,"(43.47034678403228, -80.55923616322237)",43.47034678403228,-80.55923616322237,338.0 +26,"(43.470445473045906, -80.55895886168578)",43.47044547304591,-80.55895886168578,337.0 +27,"(43.47054416138536, -80.55868155924679)",43.47054416138536,-80.55868155924679,337.0 +28,"(43.470642849050634, -80.55840425590543)",43.47064284905064,-80.55840425590543,336.0 +29,"(43.47074153604173, -80.55812695166168)",43.47074153604173,-80.55812695166168,335.0 +30,"(43.47084022235862, -80.55784964651555)",43.47084022235862,-80.55784964651555,333.0 +31,"(43.47093890800131, -80.55757234046705)",43.47093890800131,-80.55757234046705,333.0 +32,"(43.47103759296979, -80.55729503351616)",43.47103759296979,-80.55729503351616,333.0 +33,"(43.47113627726409, -80.55701772566289)",43.47113627726409,-80.55701772566289,333.0 +34,"(43.471234960884146, -80.55674041690725)",43.47123496088415,-80.55674041690725,333.0 +35,"(43.47133364383001, -80.55646310724921)",43.47133364383001,-80.55646310724921,333.0 +36,"(43.47143232610165, -80.5561857966888)",43.47143232610165,-80.5561857966888,333.0 +37,"(43.471531007699056, -80.555908485226)",43.471531007699056,-80.555908485226,333.0 +38,"(43.47162968862224, -80.55563117286084)",43.47162968862224,-80.55563117286084,334.0 +39,"(43.47172836887118, -80.55535385959328)",43.47172836887118,-80.55535385959328,335.0 +40,"(43.4718270484459, -80.55507654542335)",43.4718270484459,-80.55507654542335,334.0 +41,"(43.471925727346374, -80.55479923035104)",43.47192572734637,-80.55479923035104,335.0 +42,"(43.4720244055726, -80.55452191437635)",43.4720244055726,-80.55452191437635,336.0 +43,"(43.47212308312456, -80.55424459749928)",43.47212308312456,-80.55424459749928,338.0 +44,"(43.47222176000228, -80.55396727971983)",43.47222176000228,-80.55396727971983,339.0 +45,"(43.47232043620573, -80.55368996103799)",43.47232043620573,-80.55368996103799,339.0 +46,"(43.472419111734915, -80.55341264145379)",43.47241911173492,-80.55341264145379,339.0 +47,"(43.47251778658985, -80.55313532096719)",43.47251778658985,-80.55313532096719,339.0 +48,"(43.47261646077049, -80.55285799957822)",43.47261646077049,-80.55285799957822,341.0 +49,"(43.47271513427686, -80.55258067728687)",43.47271513427686,-80.55258067728687,340.0 +50,"(43.47281380710894, -80.55230335409314)",43.47281380710894,-80.55230335409314,341.0 +51,"(43.47291247926674, -80.55202602999704)",43.47291247926674,-80.55202602999704,342.0 +52,"(43.47301115075025, -80.55174870499854)",43.47301115075025,-80.55174870499854,341.0 +53,"(43.47310982155946, -80.55147137909769)",43.47310982155946,-80.55147137909769,342.0 +54,"(43.47320849169437, -80.55119405229445)",43.47320849169437,-80.55119405229445,342.0 +55,"(43.473307161154985, -80.55091672458883)",43.473307161154985,-80.55091672458883,343.0 +56,"(43.47340582994128, -80.55063939598082)",43.47340582994128,-80.55063939598082,344.0 +57,"(43.473504498053266, -80.55036206647046)",43.47350449805327,-80.55036206647046,345.0 +58,"(43.47360316549092, -80.5500847360577)",43.47360316549092,-80.5500847360577,346.0 +59,"(43.47370183225427, -80.54980740474257)",43.47370183225427,-80.54980740474257,348.0 +60,"(43.47380049834328, -80.54953007252504)",43.47380049834328,-80.54953007252504,349.0 +61,"(43.47389916375796, -80.54925273940516)",43.47389916375796,-80.54925273940516,348.0 +62,"(43.473997828498305, -80.54897540538289)",43.47399782849831,-80.54897540538289,346.0 +63,"(43.474096492564314, -80.54869807045824)",43.47409649256432,-80.54869807045824,346.0 +64,"(43.474195155955975, -80.54842073463122)",43.474195155955975,-80.54842073463122,345.0 +65,"(43.47429381867329, -80.54814339790182)",43.47429381867329,-80.54814339790182,344.0 +66,"(43.47439248071624, -80.54786606027004)",43.47439248071624,-80.54786606027004,342.0 +67,"(43.47449114208484, -80.54758872173589)",43.47449114208484,-80.54758872173589,341.0 +68,"(43.47458980277908, -80.54731138229936)",43.47458980277908,-80.54731138229936,340.0 +69,"(43.474688462798944, -80.54703404196044)",43.474688462798944,-80.54703404196044,340.0 +70,"(43.474787122144434, -80.54675670071917)",43.474787122144434,-80.54675670071917,341.0 +71,"(43.474885780815555, -80.54647935857551)",43.47488578081556,-80.54647935857551,340.0 +72,"(43.47498443881229, -80.54620201552946)",43.47498443881229,-80.54620201552946,339.0 +73,"(43.47508309613465, -80.54592467158105)",43.47508309613465,-80.54592467158105,340.0 +74,"(43.47518175278261, -80.54564732673026)",43.47518175278261,-80.54564732673026,342.0 +75,"(43.47528040875618, -80.54536998097709)",43.47528040875618,-80.54536998097709,344.0 +76,"(43.475379064055346, -80.54509263432155)",43.47537906405535,-80.54509263432155,344.0 +77,"(43.47547771868012, -80.54481528676362)",43.47547771868012,-80.54481528676362,344.0 +78,"(43.47557637263047, -80.54453793830332)",43.47557637263047,-80.54453793830332,344.0 +79,"(43.47567502590641, -80.54426058894066)",43.47567502590641,-80.54426058894066,342.0 +80,"(43.47577367850795, -80.54398323867561)",43.47577367850795,-80.54398323867561,341.0 +81,"(43.47587233043505, -80.54370588750818)",43.47587233043505,-80.54370588750818,340.0 +82,"(43.47597098168773, -80.54342853543838)",43.47597098168773,-80.54342853543838,340.0 +83,"(43.47606963226598, -80.5431511824662)",43.47606963226598,-80.5431511824662,341.0 +84,"(43.4761682821698, -80.54287382859165)",43.4761682821698,-80.54287382859165,342.0 +85,"(43.47626693139918, -80.54259647381473)",43.47626693139918,-80.54259647381473,342.0 +86,"(43.47636557995411, -80.54231911813544)",43.47636557995411,-80.54231911813544,342.0 +87,"(43.476464227834605, -80.54204176155376)",43.476464227834605,-80.54204176155376,341.0 +88,"(43.47656287504064, -80.54176440406971)",43.47656287504064,-80.54176440406971,341.0 +89,"(43.47666152157222, -80.54148704568328)",43.47666152157222,-80.54148704568328,340.0 +90,"(43.476760167429326, -80.54120968639448)",43.476760167429326,-80.54120968639448,340.0 +91,"(43.47685881261198, -80.5409323262033)",43.47685881261198,-80.5409323262033,340.0 +92,"(43.47695745712016, -80.54065496510977)",43.47695745712016,-80.54065496510977,340.0 +93,"(43.47705610095387, -80.54037760311384)",43.47705610095387,-80.54037760311384,340.0 +94,"(43.47715474411309, -80.54010024021554)",43.47715474411309,-80.54010024021554,340.0 +95,"(43.47725338659784, -80.53982287641486)",43.47725338659784,-80.53982287641486,341.0 +96,"(43.477352028408085, -80.53954551171182)",43.477352028408085,-80.53954551171182,341.0 +97,"(43.47745066954385, -80.5392681461064)",43.47745066954385,-80.5392681461064,341.0 +98,"(43.47754931000511, -80.5389907795986)",43.47754931000511,-80.5389907795986,341.0 +99,"(43.47764794979187, -80.53871341218844)",43.47764794979187,-80.53871341218844,343.0 +100,"(43.47774658890413, -80.5384360438759)",43.47774658890413,-80.5384360438759,344.0 +101,"(43.477845227341874, -80.53815867466099)",43.477845227341874,-80.53815867466099,344.0 +102,"(43.477943865105104, -80.5378813045437)",43.477943865105104,-80.5378813045437,344.0 +103,"(43.478042502193816, -80.53760393352405)",43.478042502193816,-80.53760393352405,344.0 +104,"(43.478141138608, -80.53732656160201)",43.478141138608,-80.53732656160201,345.0 +105,"(43.47823977434766, -80.5370491887776)",43.47823977434766,-80.5370491887776,346.0 +106,"(43.478338409412785, -80.53677181505083)",43.47833840941279,-80.53677181505083,346.0 +107,"(43.47843704380337, -80.53649444042168)",43.47843704380337,-80.53649444042168,347.0 +108,"(43.47853567751941, -80.53621706489015)",43.47853567751941,-80.53621706489015,348.0 +109,"(43.47863431056091, -80.53593968845625)",43.47863431056091,-80.53593968845625,350.0 +110,"(43.47873294292786, -80.53566231111998)",43.47873294292786,-80.53566231111998,351.0 +111,"(43.47883157462026, -80.53538493288134)",43.47883157462026,-80.53538493288134,353.0 +112,"(43.47863923410959, -80.5352433259979)",43.47863923410959,-80.5352433259979,351.0 +113,"(43.47844689341706, -80.5351017200128)",43.47844689341706,-80.5351017200128,349.0 +114,"(43.47825455254268, -80.53496011492606)",43.47825455254268,-80.53496011492606,348.0 +115,"(43.478062211486446, -80.53481851073765)",43.478062211486446,-80.53481851073765,350.0 +116,"(43.477869870248355, -80.53467690744756)",43.47786987024836,-80.53467690744756,349.0 +117,"(43.47767752882842, -80.53453530505578)",43.47767752882842,-80.53453530505578,349.0 +118,"(43.47748518722664, -80.53439370356232)",43.47748518722664,-80.53439370356232,349.0 +119,"(43.47729284544301, -80.53425210296714)",43.47729284544301,-80.53425210296714,350.0 +120,"(43.477100503477544, -80.53411050327023)",43.47710050347754,-80.53411050327023,351.0 +121,"(43.476908161330236, -80.5339689044716)",43.47690816133024,-80.5339689044716,351.0 +122,"(43.47671581900108, -80.53382730657123)",43.47671581900108,-80.53382730657123,350.0 +123,"(43.476523476490094, -80.5336857095691)",43.476523476490094,-80.5336857095691,350.0 +124,"(43.47633113379728, -80.53354411346521)",43.47633113379728,-80.53354411346521,350.0 +125,"(43.47613879092263, -80.53340251825955)",43.47613879092263,-80.53340251825955,350.0 +126,"(43.47594644786616, -80.5332609239521)",43.47594644786616,-80.5332609239521,350.0 +127,"(43.475754104627846, -80.53311933054285)",43.475754104627846,-80.53311933054285,351.0 +128,"(43.47556176120772, -80.53297773803179)",43.47556176120772,-80.53297773803179,350.0 +129,"(43.47536941760577, -80.53283614641893)",43.47536941760577,-80.53283614641893,351.0 +130,"(43.47517707382198, -80.53269455570423)",43.47517707382198,-80.53269455570423,351.0 +131,"(43.474984729856395, -80.53255296588767)",43.4749847298564,-80.53255296588767,351.0 +132,"(43.474792385709, -80.53241137696929)",43.474792385709,-80.53241137696929,350.0 +133,"(43.47460004137977, -80.53226978894904)",43.47460004137977,-80.53226978894904,347.0 +134,"(43.474407696868745, -80.53212820182691)",43.474407696868745,-80.53212820182691,345.0 +135,"(43.474215352175904, -80.53198661560289)",43.474215352175904,-80.53198661560289,343.0 +136,"(43.474023007301255, -80.531845030277)",43.474023007301255,-80.531845030277,343.0 +137,"(43.473830662244815, -80.53170344584917)",43.473830662244815,-80.53170344584917,343.0 +138,"(43.47372587646144, -80.53196442068774)",43.47372587646144,-80.53196442068774,342.0 +139,"(43.473621090080506, -80.5322253946245)",43.473621090080506,-80.5322253946245,341.0 +140,"(43.47351630310205, -80.53248636765943)",43.47351630310205,-80.53248636765943,340.0 +141,"(43.47341151552607, -80.53274733979254)",43.47341151552607,-80.53274733979254,340.0 +142,"(43.47330672735254, -80.53300831102382)",43.47330672735254,-80.53300831102382,340.0 +143,"(43.4732019385815, -80.5332692813533)",43.4732019385815,-80.5332692813533,340.0 +144,"(43.47309714921293, -80.53353025078094)",43.47309714921293,-80.53353025078094,340.0 +145,"(43.472992359246845, -80.53379121930678)",43.472992359246845,-80.53379121930678,341.0 +146,"(43.472887568683255, -80.53405218693081)",43.472887568683255,-80.53405218693081,341.0 +147,"(43.47278277752214, -80.53431315365303)",43.47278277752214,-80.53431315365303,342.0 +148,"(43.47267798576353, -80.53457411947342)",43.47267798576353,-80.53457411947342,343.0 +149,"(43.47257319340743, -80.53483508439201)",43.47257319340743,-80.53483508439201,344.0 +150,"(43.47246840045383, -80.53509604840879)",43.47246840045383,-80.53509604840879,343.0 +151,"(43.472363606902725, -80.53535701152377)",43.472363606902725,-80.53535701152377,342.0 +152,"(43.472258812754134, -80.53561797373693)",43.47225881275413,-80.53561797373693,340.0 +153,"(43.47215401800807, -80.5358789350483)",43.47215401800807,-80.5358789350483,339.0 +154,"(43.47204922266452, -80.53613989545786)",43.47204922266452,-80.53613989545786,338.0 +155,"(43.4719444267235, -80.53640085496562)",43.4719444267235,-80.53640085496562,339.0 +156,"(43.47183963018501, -80.53666181357157)",43.47183963018501,-80.53666181357157,339.0 +157,"(43.471734833049055, -80.53692277127573)",43.471734833049055,-80.53692277127573,339.0 +158,"(43.47163003531563, -80.53718372807808)",43.47163003531563,-80.53718372807808,340.0 +159,"(43.471525236984746, -80.53744468397863)",43.471525236984746,-80.53744468397863,339.0 +160,"(43.47132285394585, -80.53756280284698)",43.47132285394585,-80.53756280284698,339.0 +161,"(43.471120470777755, -80.53768092092704)",43.47112047077776,-80.53768092092704,339.0 +162,"(43.47091808748045, -80.53779903821885)",43.47091808748045,-80.53779903821885,338.0 +163,"(43.470715704053944, -80.53791715472241)",43.47071570405394,-80.53791715472241,338.0 +164,"(43.470513320498256, -80.53803527043773)",43.470513320498256,-80.53803527043773,338.0 +165,"(43.470310936813355, -80.53815338536482)",43.47031093681336,-80.53815338536482,337.0 +166,"(43.470108552999264, -80.5382714995037)",43.470108552999264,-80.5382714995037,335.0 +167,"(43.46990616905598, -80.53838961285436)",43.46990616905598,-80.53838961285436,334.0 +168,"(43.4697037849835, -80.53850772541682)",43.4697037849835,-80.53850772541682,333.0 +169,"(43.46950140078184, -80.5386258371911)",43.46950140078184,-80.5386258371911,334.0 +170,"(43.46929901645099, -80.5387439481772)",43.46929901645099,-80.5387439481772,335.0 +171,"(43.46909663199095, -80.53886205837513)",43.46909663199095,-80.53886205837513,335.0 +172,"(43.46889424740172, -80.5389801677849)",43.46889424740172,-80.5389801677849,333.0 +173,"(43.468691862683315, -80.53909827640653)",43.46869186268332,-80.53909827640653,332.0 +174,"(43.46848947783573, -80.53921638424004)",43.46848947783573,-80.53921638424004,331.0 +175,"(43.468287092858965, -80.5393344912854)",43.468287092858965,-80.5393344912854,330.0 +176,"(43.468084707753015, -80.53945259754265)",43.468084707753015,-80.53945259754265,329.0 +177,"(43.46788232251789, -80.5395707030118)",43.46788232251789,-80.5395707030118,329.0 +178,"(43.467679937153584, -80.53968880769285)",43.467679937153584,-80.53968880769285,327.0 +179,"(43.46747755166012, -80.53980691158583)",43.46747755166012,-80.53980691158583,326.0 +180,"(43.467275166037474, -80.53992501469072)",43.467275166037474,-80.53992501469072,328.0 +181,"(43.46707278028566, -80.54004311700756)",43.46707278028566,-80.54004311700756,330.0 +182,"(43.46687039440469, -80.54016121853633)",43.46687039440469,-80.54016121853633,331.0 +183,"(43.466668008394535, -80.54027931927706)",43.466668008394535,-80.54027931927706,331.0 +184,"(43.46646562225523, -80.54039741922976)",43.46646562225523,-80.54039741922976,330.0 +185,"(43.466263235986744, -80.54051551839446)",43.46626323598674,-80.54051551839446,330.0 +186,"(43.46606084958911, -80.54063361677112)",43.46606084958911,-80.54063361677112,330.0 +187,"(43.46585846306231, -80.54075171435979)",43.46585846306231,-80.54075171435979,330.0 +188,"(43.46565607640636, -80.54086981116046)",43.46565607640636,-80.54086981116046,332.0 +189,"(43.46545368962124, -80.54098790717316)",43.46545368962124,-80.54098790717316,335.0 +190,"(43.46525130270698, -80.54110600239788)",43.46525130270698,-80.54110600239788,337.0 +191,"(43.46504891566356, -80.54122409683465)",43.46504891566356,-80.54122409683465,337.0 +192,"(43.46484652849099, -80.54134219048346)",43.46484652849099,-80.54134219048346,336.0 +193,"(43.46464414118927, -80.54146028334435)",43.46464414118927,-80.54146028334435,335.0 +194,"(43.4644417537584, -80.54157837541729)",43.4644417537584,-80.54157837541729,334.0 +195,"(43.464304877302574, -80.5413436835921)",43.464304877302574,-80.5413436835921,333.0 +196,"(43.46416800036178, -80.54110899282594)",43.46416800036178,-80.54110899282594,333.0 +197,"(43.46403112293602, -80.5408743031188)",43.46403112293602,-80.5408743031188,334.0 +198,"(43.46389424502531, -80.54063961447065)",43.46389424502531,-80.54063961447065,334.0 +199,"(43.463757366629636, -80.5404049268815)",43.46375736662964,-80.5404049268815,334.0 +200,"(43.46362048774902, -80.54017024035134)",43.46362048774902,-80.54017024035134,333.0 +201,"(43.46348360838345, -80.53993555488016)",43.46348360838345,-80.53993555488016,332.0 +202,"(43.46331969082911, -80.53976512159053)",43.46331969082911,-80.53976512159053,331.0 +203,"(43.46315577301604, -80.53959468922189)",43.46315577301604,-80.53959468922189,332.0 +204,"(43.462991854944235, -80.53942425777419)",43.46299185494424,-80.53942425777419,332.0 +205,"(43.46282793661371, -80.53925382724742)",43.46282793661371,-80.53925382724742,333.0 +206,"(43.46266401802443, -80.53908339764159)",43.46266401802443,-80.53908339764159,333.0 diff --git a/routemodelv2/elevations/get_elevation_data.py b/routemodelv2/elevations/get_elevation_data.py new file mode 100644 index 0000000..ae0294f --- /dev/null +++ b/routemodelv2/elevations/get_elevation_data.py @@ -0,0 +1,35 @@ +import requests +import json +import pandas as pd +from pandas import json_normalize + +# Dataset Used: {srtm30m} https://www.opentopodata.org/datasets/srtm/ +# Params: dataset, location +# Return: Information returned as a json object [Elevation is in metres above sea level] + +# STEPS: +# Read the CSV +# Create a list of values that are valid to pass through the request +# Combine lat & long into a single coordinate with no parentheses/quotations +# Turn column of coordinates into a list +# Loop through the list of coordinates, add corresponding elevation to elevation_data +# Create a new column in CSV that holds elevation_data +# Export as a new CSV + +sample_coordinates_df = pd.read_csv("sample_coordinates.csv") +sample_coordinates_df['Combined'] = sample_coordinates_df.apply(lambda row: ','.join([str(row['latitude']), str(row['longitude'])]), axis=1) +coords_list = sample_coordinates_df['Combined'].tolist() + +elevation_data = [] +for item in coords_list: + response = requests.get(('https://api.opentopodata.org/v1/srtm30m?locations={}&&interpolation=bilinear'.format(item))) + if (response.status_code!=200): + print("error encountered at {item}") + response = response.json() + elevation_value=(response['results'][0]['elevation']) + elevation_data.append(elevation_value) + +sample_coordinates_df['elevation']=elevation_data +del sample_coordinates_df['Combined'] +sample_coordinates_df.to_csv('appended_elevation_data.csv', index=False) + diff --git a/routemodelv2/elevations/sample_coordinates.csv b/routemodelv2/elevations/sample_coordinates.csv new file mode 100644 index 0000000..1e6cb11 --- /dev/null +++ b/routemodelv2/elevations/sample_coordinates.csv @@ -0,0 +1,208 @@ +,coordinates,latitude,longitude +0,"(43.467879339595996, -80.56616840836313)",43.467879339595996,-80.56616840836313 +1,"(43.46797804546268, -80.5658911293861)",43.46797804546268,-80.5658911293861 +2,"(43.46807675065529, -80.56561384950668)",43.46807675065529,-80.56561384950668 +3,"(43.46817545517384, -80.56533656872487)",43.46817545517384,-80.56533656872487 +4,"(43.46827415901829, -80.5650592870407)",43.46827415901829,-80.5650592870407 +5,"(43.46837286218867, -80.56478200445413)",43.46837286218867,-80.56478200445413 +6,"(43.468471564684975, -80.56450472096518)",43.468471564684975,-80.56450472096518 +7,"(43.46857026650717, -80.56422743657384)",43.46857026650717,-80.56422743657384 +8,"(43.46866896765528, -80.56395015128014)",43.46866896765528,-80.56395015128014 +9,"(43.46876766812929, -80.56367286508403)",43.46876766812929,-80.56367286508403 +10,"(43.4688663679292, -80.56339557798556)",43.4688663679292,-80.56339557798556 +11,"(43.46896506705499, -80.56311828998469)",43.46896506705499,-80.56311828998469 +12,"(43.469063765506675, -80.56284100108142)",43.469063765506675,-80.56284100108142 +13,"(43.46916246328424, -80.5625637112758)",43.46916246328424,-80.5625637112758 +14,"(43.46926116038769, -80.56228642056779)",43.46926116038769,-80.56228642056779 +15,"(43.46935985681701, -80.56200912895738)",43.46935985681701,-80.56200912895738 +16,"(43.4694585525722, -80.56173183644461)",43.4694585525722,-80.56173183644461 +17,"(43.46955724765325, -80.56145454302944)",43.46955724765325,-80.56145454302944 +18,"(43.469655942060164, -80.5611772487119)",43.469655942060164,-80.5611772487119 +19,"(43.46975463579293, -80.56089995349197)",43.46975463579293,-80.56089995349197 +20,"(43.469853328851556, -80.56062265736965)",43.469853328851556,-80.56062265736965 +21,"(43.46995202123602, -80.56034536034497)",43.46995202123602,-80.56034536034497 +22,"(43.47005071294634, -80.56006806241788)",43.47005071294634,-80.56006806241788 +23,"(43.47014940398248, -80.55979076358844)",43.47014940398248,-80.55979076358844 +24,"(43.47024809434446, -80.55951346385659)",43.47024809434446,-80.55951346385659 +25,"(43.47034678403228, -80.55923616322237)",43.47034678403228,-80.55923616322237 +26,"(43.470445473045906, -80.55895886168578)",43.470445473045906,-80.55895886168578 +27,"(43.47054416138536, -80.55868155924679)",43.47054416138536,-80.55868155924679 +28,"(43.470642849050634, -80.55840425590543)",43.470642849050634,-80.55840425590543 +29,"(43.47074153604173, -80.55812695166168)",43.47074153604173,-80.55812695166168 +30,"(43.47084022235862, -80.55784964651555)",43.47084022235862,-80.55784964651555 +31,"(43.47093890800131, -80.55757234046705)",43.47093890800131,-80.55757234046705 +32,"(43.47103759296979, -80.55729503351616)",43.47103759296979,-80.55729503351616 +33,"(43.47113627726409, -80.55701772566289)",43.47113627726409,-80.55701772566289 +34,"(43.471234960884146, -80.55674041690725)",43.471234960884146,-80.55674041690725 +35,"(43.47133364383001, -80.55646310724921)",43.47133364383001,-80.55646310724921 +36,"(43.47143232610165, -80.5561857966888)",43.47143232610165,-80.5561857966888 +37,"(43.471531007699056, -80.555908485226)",43.471531007699056,-80.555908485226 +38,"(43.47162968862224, -80.55563117286084)",43.47162968862224,-80.55563117286084 +39,"(43.47172836887118, -80.55535385959328)",43.47172836887118,-80.55535385959328 +40,"(43.4718270484459, -80.55507654542335)",43.4718270484459,-80.55507654542335 +41,"(43.471925727346374, -80.55479923035104)",43.471925727346374,-80.55479923035104 +42,"(43.4720244055726, -80.55452191437635)",43.4720244055726,-80.55452191437635 +43,"(43.47212308312456, -80.55424459749928)",43.47212308312456,-80.55424459749928 +44,"(43.47222176000228, -80.55396727971983)",43.47222176000228,-80.55396727971983 +45,"(43.47232043620573, -80.55368996103799)",43.47232043620573,-80.55368996103799 +46,"(43.472419111734915, -80.55341264145379)",43.472419111734915,-80.55341264145379 +47,"(43.47251778658985, -80.55313532096719)",43.47251778658985,-80.55313532096719 +48,"(43.47261646077049, -80.55285799957822)",43.47261646077049,-80.55285799957822 +49,"(43.47271513427686, -80.55258067728687)",43.47271513427686,-80.55258067728687 +50,"(43.47281380710894, -80.55230335409314)",43.47281380710894,-80.55230335409314 +51,"(43.47291247926674, -80.55202602999704)",43.47291247926674,-80.55202602999704 +52,"(43.47301115075025, -80.55174870499854)",43.47301115075025,-80.55174870499854 +53,"(43.47310982155946, -80.55147137909769)",43.47310982155946,-80.55147137909769 +54,"(43.47320849169437, -80.55119405229445)",43.47320849169437,-80.55119405229445 +55,"(43.473307161154985, -80.55091672458883)",43.473307161154985,-80.55091672458883 +56,"(43.47340582994128, -80.55063939598082)",43.47340582994128,-80.55063939598082 +57,"(43.473504498053266, -80.55036206647046)",43.473504498053266,-80.55036206647046 +58,"(43.47360316549092, -80.5500847360577)",43.47360316549092,-80.5500847360577 +59,"(43.47370183225427, -80.54980740474257)",43.47370183225427,-80.54980740474257 +60,"(43.47380049834328, -80.54953007252504)",43.47380049834328,-80.54953007252504 +61,"(43.47389916375796, -80.54925273940516)",43.47389916375796,-80.54925273940516 +62,"(43.473997828498305, -80.54897540538289)",43.473997828498305,-80.54897540538289 +63,"(43.474096492564314, -80.54869807045824)",43.474096492564314,-80.54869807045824 +64,"(43.474195155955975, -80.54842073463122)",43.474195155955975,-80.54842073463122 +65,"(43.47429381867329, -80.54814339790182)",43.47429381867329,-80.54814339790182 +66,"(43.47439248071624, -80.54786606027004)",43.47439248071624,-80.54786606027004 +67,"(43.47449114208484, -80.54758872173589)",43.47449114208484,-80.54758872173589 +68,"(43.47458980277908, -80.54731138229936)",43.47458980277908,-80.54731138229936 +69,"(43.474688462798944, -80.54703404196044)",43.474688462798944,-80.54703404196044 +70,"(43.474787122144434, -80.54675670071917)",43.474787122144434,-80.54675670071917 +71,"(43.474885780815555, -80.54647935857551)",43.474885780815555,-80.54647935857551 +72,"(43.47498443881229, -80.54620201552946)",43.47498443881229,-80.54620201552946 +73,"(43.47508309613465, -80.54592467158105)",43.47508309613465,-80.54592467158105 +74,"(43.47518175278261, -80.54564732673026)",43.47518175278261,-80.54564732673026 +75,"(43.47528040875618, -80.54536998097709)",43.47528040875618,-80.54536998097709 +76,"(43.475379064055346, -80.54509263432155)",43.475379064055346,-80.54509263432155 +77,"(43.47547771868012, -80.54481528676362)",43.47547771868012,-80.54481528676362 +78,"(43.47557637263047, -80.54453793830332)",43.47557637263047,-80.54453793830332 +79,"(43.47567502590641, -80.54426058894066)",43.47567502590641,-80.54426058894066 +80,"(43.47577367850795, -80.54398323867561)",43.47577367850795,-80.54398323867561 +81,"(43.47587233043505, -80.54370588750818)",43.47587233043505,-80.54370588750818 +82,"(43.47597098168773, -80.54342853543838)",43.47597098168773,-80.54342853543838 +83,"(43.47606963226598, -80.5431511824662)",43.47606963226598,-80.5431511824662 +84,"(43.4761682821698, -80.54287382859165)",43.4761682821698,-80.54287382859165 +85,"(43.47626693139918, -80.54259647381473)",43.47626693139918,-80.54259647381473 +86,"(43.47636557995411, -80.54231911813544)",43.47636557995411,-80.54231911813544 +87,"(43.476464227834605, -80.54204176155376)",43.476464227834605,-80.54204176155376 +88,"(43.47656287504064, -80.54176440406971)",43.47656287504064,-80.54176440406971 +89,"(43.47666152157222, -80.54148704568328)",43.47666152157222,-80.54148704568328 +90,"(43.476760167429326, -80.54120968639448)",43.476760167429326,-80.54120968639448 +91,"(43.47685881261198, -80.5409323262033)",43.47685881261198,-80.5409323262033 +92,"(43.47695745712016, -80.54065496510977)",43.47695745712016,-80.54065496510977 +93,"(43.47705610095387, -80.54037760311384)",43.47705610095387,-80.54037760311384 +94,"(43.47715474411309, -80.54010024021554)",43.47715474411309,-80.54010024021554 +95,"(43.47725338659784, -80.53982287641486)",43.47725338659784,-80.53982287641486 +96,"(43.477352028408085, -80.53954551171182)",43.477352028408085,-80.53954551171182 +97,"(43.47745066954385, -80.5392681461064)",43.47745066954385,-80.5392681461064 +98,"(43.47754931000511, -80.5389907795986)",43.47754931000511,-80.5389907795986 +99,"(43.47764794979187, -80.53871341218844)",43.47764794979187,-80.53871341218844 +100,"(43.47774658890413, -80.5384360438759)",43.47774658890413,-80.5384360438759 +101,"(43.477845227341874, -80.53815867466099)",43.477845227341874,-80.53815867466099 +102,"(43.477943865105104, -80.5378813045437)",43.477943865105104,-80.5378813045437 +103,"(43.478042502193816, -80.53760393352405)",43.478042502193816,-80.53760393352405 +104,"(43.478141138608, -80.53732656160201)",43.478141138608,-80.53732656160201 +105,"(43.47823977434766, -80.5370491887776)",43.47823977434766,-80.5370491887776 +106,"(43.478338409412785, -80.53677181505083)",43.478338409412785,-80.53677181505083 +107,"(43.47843704380337, -80.53649444042168)",43.47843704380337,-80.53649444042168 +108,"(43.47853567751941, -80.53621706489015)",43.47853567751941,-80.53621706489015 +109,"(43.47863431056091, -80.53593968845625)",43.47863431056091,-80.53593968845625 +110,"(43.47873294292786, -80.53566231111998)",43.47873294292786,-80.53566231111998 +111,"(43.47883157462026, -80.53538493288134)",43.47883157462026,-80.53538493288134 +112,"(43.47863923410959, -80.5352433259979)",43.47863923410959,-80.5352433259979 +113,"(43.47844689341706, -80.5351017200128)",43.47844689341706,-80.5351017200128 +114,"(43.47825455254268, -80.53496011492606)",43.47825455254268,-80.53496011492606 +115,"(43.478062211486446, -80.53481851073765)",43.478062211486446,-80.53481851073765 +116,"(43.477869870248355, -80.53467690744756)",43.477869870248355,-80.53467690744756 +117,"(43.47767752882842, -80.53453530505578)",43.47767752882842,-80.53453530505578 +118,"(43.47748518722664, -80.53439370356232)",43.47748518722664,-80.53439370356232 +119,"(43.47729284544301, -80.53425210296714)",43.47729284544301,-80.53425210296714 +120,"(43.477100503477544, -80.53411050327023)",43.477100503477544,-80.53411050327023 +121,"(43.476908161330236, -80.5339689044716)",43.476908161330236,-80.5339689044716 +122,"(43.47671581900108, -80.53382730657123)",43.47671581900108,-80.53382730657123 +123,"(43.476523476490094, -80.5336857095691)",43.476523476490094,-80.5336857095691 +124,"(43.47633113379728, -80.53354411346521)",43.47633113379728,-80.53354411346521 +125,"(43.47613879092263, -80.53340251825955)",43.47613879092263,-80.53340251825955 +126,"(43.47594644786616, -80.5332609239521)",43.47594644786616,-80.5332609239521 +127,"(43.475754104627846, -80.53311933054285)",43.475754104627846,-80.53311933054285 +128,"(43.47556176120772, -80.53297773803179)",43.47556176120772,-80.53297773803179 +129,"(43.47536941760577, -80.53283614641893)",43.47536941760577,-80.53283614641893 +130,"(43.47517707382198, -80.53269455570423)",43.47517707382198,-80.53269455570423 +131,"(43.474984729856395, -80.53255296588767)",43.474984729856395,-80.53255296588767 +132,"(43.474792385709, -80.53241137696929)",43.474792385709,-80.53241137696929 +133,"(43.47460004137977, -80.53226978894904)",43.47460004137977,-80.53226978894904 +134,"(43.474407696868745, -80.53212820182691)",43.474407696868745,-80.53212820182691 +135,"(43.474215352175904, -80.53198661560289)",43.474215352175904,-80.53198661560289 +136,"(43.474023007301255, -80.531845030277)",43.474023007301255,-80.531845030277 +137,"(43.473830662244815, -80.53170344584917)",43.473830662244815,-80.53170344584917 +138,"(43.47372587646144, -80.53196442068774)",43.47372587646144,-80.53196442068774 +139,"(43.473621090080506, -80.5322253946245)",43.473621090080506,-80.5322253946245 +140,"(43.47351630310205, -80.53248636765943)",43.47351630310205,-80.53248636765943 +141,"(43.47341151552607, -80.53274733979254)",43.47341151552607,-80.53274733979254 +142,"(43.47330672735254, -80.53300831102382)",43.47330672735254,-80.53300831102382 +143,"(43.4732019385815, -80.5332692813533)",43.4732019385815,-80.5332692813533 +144,"(43.47309714921293, -80.53353025078094)",43.47309714921293,-80.53353025078094 +145,"(43.472992359246845, -80.53379121930678)",43.472992359246845,-80.53379121930678 +146,"(43.472887568683255, -80.53405218693081)",43.472887568683255,-80.53405218693081 +147,"(43.47278277752214, -80.53431315365303)",43.47278277752214,-80.53431315365303 +148,"(43.47267798576353, -80.53457411947342)",43.47267798576353,-80.53457411947342 +149,"(43.47257319340743, -80.53483508439201)",43.47257319340743,-80.53483508439201 +150,"(43.47246840045383, -80.53509604840879)",43.47246840045383,-80.53509604840879 +151,"(43.472363606902725, -80.53535701152377)",43.472363606902725,-80.53535701152377 +152,"(43.472258812754134, -80.53561797373693)",43.472258812754134,-80.53561797373693 +153,"(43.47215401800807, -80.5358789350483)",43.47215401800807,-80.5358789350483 +154,"(43.47204922266452, -80.53613989545786)",43.47204922266452,-80.53613989545786 +155,"(43.4719444267235, -80.53640085496562)",43.4719444267235,-80.53640085496562 +156,"(43.47183963018501, -80.53666181357157)",43.47183963018501,-80.53666181357157 +157,"(43.471734833049055, -80.53692277127573)",43.471734833049055,-80.53692277127573 +158,"(43.47163003531563, -80.53718372807808)",43.47163003531563,-80.53718372807808 +159,"(43.471525236984746, -80.53744468397863)",43.471525236984746,-80.53744468397863 +160,"(43.47132285394585, -80.53756280284698)",43.47132285394585,-80.53756280284698 +161,"(43.471120470777755, -80.53768092092704)",43.471120470777755,-80.53768092092704 +162,"(43.47091808748045, -80.53779903821885)",43.47091808748045,-80.53779903821885 +163,"(43.470715704053944, -80.53791715472241)",43.470715704053944,-80.53791715472241 +164,"(43.470513320498256, -80.53803527043773)",43.470513320498256,-80.53803527043773 +165,"(43.470310936813355, -80.53815338536482)",43.470310936813355,-80.53815338536482 +166,"(43.470108552999264, -80.5382714995037)",43.470108552999264,-80.5382714995037 +167,"(43.46990616905598, -80.53838961285436)",43.46990616905598,-80.53838961285436 +168,"(43.4697037849835, -80.53850772541682)",43.4697037849835,-80.53850772541682 +169,"(43.46950140078184, -80.5386258371911)",43.46950140078184,-80.5386258371911 +170,"(43.46929901645099, -80.5387439481772)",43.46929901645099,-80.5387439481772 +171,"(43.46909663199095, -80.53886205837513)",43.46909663199095,-80.53886205837513 +172,"(43.46889424740172, -80.5389801677849)",43.46889424740172,-80.5389801677849 +173,"(43.468691862683315, -80.53909827640653)",43.468691862683315,-80.53909827640653 +174,"(43.46848947783573, -80.53921638424004)",43.46848947783573,-80.53921638424004 +175,"(43.468287092858965, -80.5393344912854)",43.468287092858965,-80.5393344912854 +176,"(43.468084707753015, -80.53945259754265)",43.468084707753015,-80.53945259754265 +177,"(43.46788232251789, -80.5395707030118)",43.46788232251789,-80.5395707030118 +178,"(43.467679937153584, -80.53968880769285)",43.467679937153584,-80.53968880769285 +179,"(43.46747755166012, -80.53980691158583)",43.46747755166012,-80.53980691158583 +180,"(43.467275166037474, -80.53992501469072)",43.467275166037474,-80.53992501469072 +181,"(43.46707278028566, -80.54004311700756)",43.46707278028566,-80.54004311700756 +182,"(43.46687039440469, -80.54016121853633)",43.46687039440469,-80.54016121853633 +183,"(43.466668008394535, -80.54027931927706)",43.466668008394535,-80.54027931927706 +184,"(43.46646562225523, -80.54039741922976)",43.46646562225523,-80.54039741922976 +185,"(43.466263235986744, -80.54051551839446)",43.466263235986744,-80.54051551839446 +186,"(43.46606084958911, -80.54063361677112)",43.46606084958911,-80.54063361677112 +187,"(43.46585846306231, -80.54075171435979)",43.46585846306231,-80.54075171435979 +188,"(43.46565607640636, -80.54086981116046)",43.46565607640636,-80.54086981116046 +189,"(43.46545368962124, -80.54098790717316)",43.46545368962124,-80.54098790717316 +190,"(43.46525130270698, -80.54110600239788)",43.46525130270698,-80.54110600239788 +191,"(43.46504891566356, -80.54122409683465)",43.46504891566356,-80.54122409683465 +192,"(43.46484652849099, -80.54134219048346)",43.46484652849099,-80.54134219048346 +193,"(43.46464414118927, -80.54146028334435)",43.46464414118927,-80.54146028334435 +194,"(43.4644417537584, -80.54157837541729)",43.4644417537584,-80.54157837541729 +195,"(43.464304877302574, -80.5413436835921)",43.464304877302574,-80.5413436835921 +196,"(43.46416800036178, -80.54110899282594)",43.46416800036178,-80.54110899282594 +197,"(43.46403112293602, -80.5408743031188)",43.46403112293602,-80.5408743031188 +198,"(43.46389424502531, -80.54063961447065)",43.46389424502531,-80.54063961447065 +199,"(43.463757366629636, -80.5404049268815)",43.463757366629636,-80.5404049268815 +200,"(43.46362048774902, -80.54017024035134)",43.46362048774902,-80.54017024035134 +201,"(43.46348360838345, -80.53993555488016)",43.46348360838345,-80.53993555488016 +202,"(43.46331969082911, -80.53976512159053)",43.46331969082911,-80.53976512159053 +203,"(43.46315577301604, -80.53959468922189)",43.46315577301604,-80.53959468922189 +204,"(43.462991854944235, -80.53942425777419)",43.462991854944235,-80.53942425777419 +205,"(43.46282793661371, -80.53925382724742)",43.46282793661371,-80.53925382724742 +206,"(43.46266401802443, -80.53908339764159)",43.46266401802443,-80.53908339764159 From fe7804889fe063ad34a652f39221b8b405ff7a07 Mon Sep 17 00:00:00 2001 From: AthithiyaM Date: Sat, 9 Sep 2023 13:15:18 -0400 Subject: [PATCH 2/4] Used series to store request parameters and used try/except block to store request response --- routemodelv2/elevations/get_elevation_data.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/routemodelv2/elevations/get_elevation_data.py b/routemodelv2/elevations/get_elevation_data.py index ae0294f..ee70041 100644 --- a/routemodelv2/elevations/get_elevation_data.py +++ b/routemodelv2/elevations/get_elevation_data.py @@ -17,19 +17,19 @@ # Export as a new CSV sample_coordinates_df = pd.read_csv("sample_coordinates.csv") -sample_coordinates_df['Combined'] = sample_coordinates_df.apply(lambda row: ','.join([str(row['latitude']), str(row['longitude'])]), axis=1) -coords_list = sample_coordinates_df['Combined'].tolist() +parameters_list = pd.series(sample_coordinates_df.apply(lambda row: ','.join([str(row['latitude']), str(row['longitude'])]), axis=1)) elevation_data = [] -for item in coords_list: - response = requests.get(('https://api.opentopodata.org/v1/srtm30m?locations={}&&interpolation=bilinear'.format(item))) - if (response.status_code!=200): - print("error encountered at {item}") - response = response.json() - elevation_value=(response['results'][0]['elevation']) - elevation_data.append(elevation_value) +for item in parameters_list: + try: + response = requests.get(('https://api.opentopodata.org/v1/srtm30m?locations={}&&interpolation=bilinear'.format(item))) + response.raise_for_status() + data = response.json() + elevation_value=(data['results'][0]['elevation']) + elevation_data.append(elevation_value) + except Exception as e: + print(f"Unexpected error encountered at {item}: ", e) sample_coordinates_df['elevation']=elevation_data -del sample_coordinates_df['Combined'] sample_coordinates_df.to_csv('appended_elevation_data.csv', index=False) From 5591293f27266260dca235382465b1ac67407330 Mon Sep 17 00:00:00 2001 From: AthithiyaM Date: Sat, 24 Feb 2024 10:57:25 -0500 Subject: [PATCH 3/4] Updated script to push data to database --- routemodelv2/elevations/get_elevation_data.py | 159 ++++++++++++++---- 1 file changed, 130 insertions(+), 29 deletions(-) diff --git a/routemodelv2/elevations/get_elevation_data.py b/routemodelv2/elevations/get_elevation_data.py index ee70041..8aab7b8 100644 --- a/routemodelv2/elevations/get_elevation_data.py +++ b/routemodelv2/elevations/get_elevation_data.py @@ -1,35 +1,136 @@ -import requests -import json -import pandas as pd -from pandas import json_normalize - -# Dataset Used: {srtm30m} https://www.opentopodata.org/datasets/srtm/ -# Params: dataset, location -# Return: Information returned as a json object [Elevation is in metres above sea level] - -# STEPS: -# Read the CSV -# Create a list of values that are valid to pass through the request -# Combine lat & long into a single coordinate with no parentheses/quotations -# Turn column of coordinates into a list -# Loop through the list of coordinates, add corresponding elevation to elevation_data -# Create a new column in CSV that holds elevation_data -# Export as a new CSV - -sample_coordinates_df = pd.read_csv("sample_coordinates.csv") -parameters_list = pd.series(sample_coordinates_df.apply(lambda row: ','.join([str(row['latitude']), str(row['longitude'])]), axis=1)) - -elevation_data = [] -for item in parameters_list: +import requests, math, psycopg2, pandas, sys, time + +''' +API INFORMATION +Dataset Used: {srtm30m} https://www.opentopodata.org/datasets/srtm/ +Parameters: Dataset, Coordinate +Return: Information returned as a json object [Elevation is in metres above sea level] +''' + +''' +STEPS +1. Check if the “elevation” table exists, if it doesn't create it. If it does, move on. +2. Seed the database with a given CSV path of raw data (lats, and longs) +3. Once seeded, update the table for each lat and long entry with its: + - elevation (as you have already captured) + - degree of elevation +''' + +FILENAME = None +DB_HOST = None +DB_NAME = None +DB_USER = None +DB_PASSWORD = None +DATASET = 'srtm30m' +QUERIES = { + 'create_table' : "CREATE TABLE IF NOT EXISTS elevation (id SERIAL PRIMARY KEY, lat float8, lon float8, elevation float8, degree float8);", + 'clear_table' : "TRUNCATE TABLE elevation RESTART IDENTITY;", + 'add_coord' : "INSERT INTO elevation (lat, lon) VALUES (%s, %s)", + 'elevation_empty' : "SELECT id, lat, lon FROM elevation WHERE elevation IS NULL", + 'degree_empty' : "SELECT id, lat, lon FROM elevation WHERE degree IS NULL", + 'update_elevation' : "UPDATE elevation SET elevation = %s WHERE id = %s", + 'udpate_degree' : "UPDATE elevation SET degree = %s WHERE lat = %s AND lon = %s", +} + +def verify_inputs(): + global FILENAME, DB_HOST, DB_NAME, DB_USER, DB_PASSWORD + if len(sys.argv) != 6: + print("Usage: python elevation.py ") + sys.exit(1) + scriptname, filename, db_host, db_name, db_user, db_password = sys.argv + FILENAME = filename + DB_HOST = db_host + DB_NAME = db_name + DB_USER = db_user + DB_PASSWORD = db_password + + +def read_csv(): + df = pandas.read_csv(FILENAME) + return df + + +def connect_to_db(): + connection = psycopg2.connect( + host = DB_HOST, + database = DB_NAME, + user = DB_USER, + password = DB_PASSWORD + ) + return connection + + +def create_table(connection): + cursor = connection.cursor() + cursor.execute(QUERIES['create_table']) + connection.commit() + cursor.close() + print("table created!") + return + + +def seed_database(connection, df): + confirmation = input("Seeding the database will clear current values in the table. Would you like to continue? (Y/N): ").lower() + if confirmation == "y": + cursor = connection.cursor() + print("Clearing table...") + cursor.execute(QUERIES['clear_table']) + connection.commit() + print("Seeding Database...") + for row in df.itertuples(): + lat = row.latitude + lon = row.longitude + cursor.execute(QUERIES['add_coord'], (lat, lon)) + connection.commit() + cursor.close() + print("Database seeded.") + return True + else: + print("Operation canceled.") + return False + + +def get_elevation(lat, long): + parameter = f'{lat},{long}' try: - response = requests.get(('https://api.opentopodata.org/v1/srtm30m?locations={}&&interpolation=bilinear'.format(item))) + response = requests.get(f'https://api.opentopodata.org/v1/{DATASET}?locations={parameter}&&interpolation=bilinear') response.raise_for_status() data = response.json() - elevation_value=(data['results'][0]['elevation']) - elevation_data.append(elevation_value) + elevation_value = (data['results'][0]['elevation']) + return elevation_value except Exception as e: - print(f"Unexpected error encountered at {item}: ", e) + print(repr(e)) + return + + +def calculate_degree(lat1, long1, elev1, lat2, long2, elev2): + pass + + +def update_table_entries(connection): + print("Updating table entries...") + cursor = connection.cursor() + # Check which rows have NULL elevation + cursor.execute(QUERIES['elevation_empty']) + rows_to_update = cursor.fetchall() + for row in rows_to_update: + id, lat, lon = row + elevation = get_elevation(lat, lon) + cursor.execute(QUERIES['update_elevation'], (elevation, id)) + connection.commit() + print(f'Elevation Added for ID[{id}]') + time.sleep(1) + #TODO Update Degree + cursor.close() + return -sample_coordinates_df['elevation']=elevation_data -sample_coordinates_df.to_csv('appended_elevation_data.csv', index=False) +# MAIN +if __name__ == "__main__": + verify_inputs() + df = read_csv() + connection = connect_to_db() + create_table(connection) + seed_database(connection, df) + update_table_entries(connection) + connection.close() From a0ba988f4d72a3f54249a66f90018616e94cc803 Mon Sep 17 00:00:00 2001 From: AthithiyaM <67667778+AthithiyaM@users.noreply.github.com> Date: Sat, 24 Feb 2024 11:07:31 -0500 Subject: [PATCH 4/4] Delete appended_coordinates.csv Unnecessary file --- .../elevations/appended_coordinates.csv | 208 ------------------ 1 file changed, 208 deletions(-) delete mode 100644 routemodelv2/elevations/appended_coordinates.csv diff --git a/routemodelv2/elevations/appended_coordinates.csv b/routemodelv2/elevations/appended_coordinates.csv deleted file mode 100644 index 0b645f4..0000000 --- a/routemodelv2/elevations/appended_coordinates.csv +++ /dev/null @@ -1,208 +0,0 @@ -Unnamed: 0,coordinates,latitude,longitude,elevation -0,"(43.467879339595996, -80.56616840836313)",43.467879339596,-80.56616840836313,347.0 -1,"(43.46797804546268, -80.5658911293861)",43.46797804546268,-80.5658911293861,347.0 -2,"(43.46807675065529, -80.56561384950668)",43.46807675065529,-80.56561384950668,347.0 -3,"(43.46817545517384, -80.56533656872487)",43.46817545517384,-80.56533656872487,347.0 -4,"(43.46827415901829, -80.5650592870407)",43.46827415901829,-80.5650592870407,347.0 -5,"(43.46837286218867, -80.56478200445413)",43.46837286218867,-80.56478200445413,346.0 -6,"(43.468471564684975, -80.56450472096518)",43.468471564684975,-80.56450472096518,344.0 -7,"(43.46857026650717, -80.56422743657384)",43.46857026650717,-80.56422743657384,344.0 -8,"(43.46866896765528, -80.56395015128014)",43.46866896765528,-80.56395015128014,344.0 -9,"(43.46876766812929, -80.56367286508403)",43.46876766812929,-80.56367286508403,344.0 -10,"(43.4688663679292, -80.56339557798556)",43.4688663679292,-80.56339557798556,344.0 -11,"(43.46896506705499, -80.56311828998469)",43.46896506705499,-80.56311828998469,345.0 -12,"(43.469063765506675, -80.56284100108142)",43.46906376550668,-80.56284100108142,346.0 -13,"(43.46916246328424, -80.5625637112758)",43.46916246328424,-80.5625637112758,346.0 -14,"(43.46926116038769, -80.56228642056779)",43.46926116038769,-80.56228642056779,345.0 -15,"(43.46935985681701, -80.56200912895738)",43.46935985681701,-80.56200912895738,343.0 -16,"(43.4694585525722, -80.56173183644461)",43.4694585525722,-80.56173183644461,343.0 -17,"(43.46955724765325, -80.56145454302944)",43.46955724765325,-80.56145454302944,343.0 -18,"(43.469655942060164, -80.5611772487119)",43.46965594206016,-80.5611772487119,343.0 -19,"(43.46975463579293, -80.56089995349197)",43.46975463579293,-80.56089995349197,341.0 -20,"(43.469853328851556, -80.56062265736965)",43.46985332885156,-80.56062265736965,339.0 -21,"(43.46995202123602, -80.56034536034497)",43.46995202123602,-80.56034536034497,338.0 -22,"(43.47005071294634, -80.56006806241788)",43.47005071294634,-80.56006806241788,338.0 -23,"(43.47014940398248, -80.55979076358844)",43.47014940398248,-80.55979076358844,339.0 -24,"(43.47024809434446, -80.55951346385659)",43.47024809434446,-80.55951346385659,339.0 -25,"(43.47034678403228, -80.55923616322237)",43.47034678403228,-80.55923616322237,338.0 -26,"(43.470445473045906, -80.55895886168578)",43.47044547304591,-80.55895886168578,337.0 -27,"(43.47054416138536, -80.55868155924679)",43.47054416138536,-80.55868155924679,337.0 -28,"(43.470642849050634, -80.55840425590543)",43.47064284905064,-80.55840425590543,336.0 -29,"(43.47074153604173, -80.55812695166168)",43.47074153604173,-80.55812695166168,335.0 -30,"(43.47084022235862, -80.55784964651555)",43.47084022235862,-80.55784964651555,333.0 -31,"(43.47093890800131, -80.55757234046705)",43.47093890800131,-80.55757234046705,333.0 -32,"(43.47103759296979, -80.55729503351616)",43.47103759296979,-80.55729503351616,333.0 -33,"(43.47113627726409, -80.55701772566289)",43.47113627726409,-80.55701772566289,333.0 -34,"(43.471234960884146, -80.55674041690725)",43.47123496088415,-80.55674041690725,333.0 -35,"(43.47133364383001, -80.55646310724921)",43.47133364383001,-80.55646310724921,333.0 -36,"(43.47143232610165, -80.5561857966888)",43.47143232610165,-80.5561857966888,333.0 -37,"(43.471531007699056, -80.555908485226)",43.471531007699056,-80.555908485226,333.0 -38,"(43.47162968862224, -80.55563117286084)",43.47162968862224,-80.55563117286084,334.0 -39,"(43.47172836887118, -80.55535385959328)",43.47172836887118,-80.55535385959328,335.0 -40,"(43.4718270484459, -80.55507654542335)",43.4718270484459,-80.55507654542335,334.0 -41,"(43.471925727346374, -80.55479923035104)",43.47192572734637,-80.55479923035104,335.0 -42,"(43.4720244055726, -80.55452191437635)",43.4720244055726,-80.55452191437635,336.0 -43,"(43.47212308312456, -80.55424459749928)",43.47212308312456,-80.55424459749928,338.0 -44,"(43.47222176000228, -80.55396727971983)",43.47222176000228,-80.55396727971983,339.0 -45,"(43.47232043620573, -80.55368996103799)",43.47232043620573,-80.55368996103799,339.0 -46,"(43.472419111734915, -80.55341264145379)",43.47241911173492,-80.55341264145379,339.0 -47,"(43.47251778658985, -80.55313532096719)",43.47251778658985,-80.55313532096719,339.0 -48,"(43.47261646077049, -80.55285799957822)",43.47261646077049,-80.55285799957822,341.0 -49,"(43.47271513427686, -80.55258067728687)",43.47271513427686,-80.55258067728687,340.0 -50,"(43.47281380710894, -80.55230335409314)",43.47281380710894,-80.55230335409314,341.0 -51,"(43.47291247926674, -80.55202602999704)",43.47291247926674,-80.55202602999704,342.0 -52,"(43.47301115075025, -80.55174870499854)",43.47301115075025,-80.55174870499854,341.0 -53,"(43.47310982155946, -80.55147137909769)",43.47310982155946,-80.55147137909769,342.0 -54,"(43.47320849169437, -80.55119405229445)",43.47320849169437,-80.55119405229445,342.0 -55,"(43.473307161154985, -80.55091672458883)",43.473307161154985,-80.55091672458883,343.0 -56,"(43.47340582994128, -80.55063939598082)",43.47340582994128,-80.55063939598082,344.0 -57,"(43.473504498053266, -80.55036206647046)",43.47350449805327,-80.55036206647046,345.0 -58,"(43.47360316549092, -80.5500847360577)",43.47360316549092,-80.5500847360577,346.0 -59,"(43.47370183225427, -80.54980740474257)",43.47370183225427,-80.54980740474257,348.0 -60,"(43.47380049834328, -80.54953007252504)",43.47380049834328,-80.54953007252504,349.0 -61,"(43.47389916375796, -80.54925273940516)",43.47389916375796,-80.54925273940516,348.0 -62,"(43.473997828498305, -80.54897540538289)",43.47399782849831,-80.54897540538289,346.0 -63,"(43.474096492564314, -80.54869807045824)",43.47409649256432,-80.54869807045824,346.0 -64,"(43.474195155955975, -80.54842073463122)",43.474195155955975,-80.54842073463122,345.0 -65,"(43.47429381867329, -80.54814339790182)",43.47429381867329,-80.54814339790182,344.0 -66,"(43.47439248071624, -80.54786606027004)",43.47439248071624,-80.54786606027004,342.0 -67,"(43.47449114208484, -80.54758872173589)",43.47449114208484,-80.54758872173589,341.0 -68,"(43.47458980277908, -80.54731138229936)",43.47458980277908,-80.54731138229936,340.0 -69,"(43.474688462798944, -80.54703404196044)",43.474688462798944,-80.54703404196044,340.0 -70,"(43.474787122144434, -80.54675670071917)",43.474787122144434,-80.54675670071917,341.0 -71,"(43.474885780815555, -80.54647935857551)",43.47488578081556,-80.54647935857551,340.0 -72,"(43.47498443881229, -80.54620201552946)",43.47498443881229,-80.54620201552946,339.0 -73,"(43.47508309613465, -80.54592467158105)",43.47508309613465,-80.54592467158105,340.0 -74,"(43.47518175278261, -80.54564732673026)",43.47518175278261,-80.54564732673026,342.0 -75,"(43.47528040875618, -80.54536998097709)",43.47528040875618,-80.54536998097709,344.0 -76,"(43.475379064055346, -80.54509263432155)",43.47537906405535,-80.54509263432155,344.0 -77,"(43.47547771868012, -80.54481528676362)",43.47547771868012,-80.54481528676362,344.0 -78,"(43.47557637263047, -80.54453793830332)",43.47557637263047,-80.54453793830332,344.0 -79,"(43.47567502590641, -80.54426058894066)",43.47567502590641,-80.54426058894066,342.0 -80,"(43.47577367850795, -80.54398323867561)",43.47577367850795,-80.54398323867561,341.0 -81,"(43.47587233043505, -80.54370588750818)",43.47587233043505,-80.54370588750818,340.0 -82,"(43.47597098168773, -80.54342853543838)",43.47597098168773,-80.54342853543838,340.0 -83,"(43.47606963226598, -80.5431511824662)",43.47606963226598,-80.5431511824662,341.0 -84,"(43.4761682821698, -80.54287382859165)",43.4761682821698,-80.54287382859165,342.0 -85,"(43.47626693139918, -80.54259647381473)",43.47626693139918,-80.54259647381473,342.0 -86,"(43.47636557995411, -80.54231911813544)",43.47636557995411,-80.54231911813544,342.0 -87,"(43.476464227834605, -80.54204176155376)",43.476464227834605,-80.54204176155376,341.0 -88,"(43.47656287504064, -80.54176440406971)",43.47656287504064,-80.54176440406971,341.0 -89,"(43.47666152157222, -80.54148704568328)",43.47666152157222,-80.54148704568328,340.0 -90,"(43.476760167429326, -80.54120968639448)",43.476760167429326,-80.54120968639448,340.0 -91,"(43.47685881261198, -80.5409323262033)",43.47685881261198,-80.5409323262033,340.0 -92,"(43.47695745712016, -80.54065496510977)",43.47695745712016,-80.54065496510977,340.0 -93,"(43.47705610095387, -80.54037760311384)",43.47705610095387,-80.54037760311384,340.0 -94,"(43.47715474411309, -80.54010024021554)",43.47715474411309,-80.54010024021554,340.0 -95,"(43.47725338659784, -80.53982287641486)",43.47725338659784,-80.53982287641486,341.0 -96,"(43.477352028408085, -80.53954551171182)",43.477352028408085,-80.53954551171182,341.0 -97,"(43.47745066954385, -80.5392681461064)",43.47745066954385,-80.5392681461064,341.0 -98,"(43.47754931000511, -80.5389907795986)",43.47754931000511,-80.5389907795986,341.0 -99,"(43.47764794979187, -80.53871341218844)",43.47764794979187,-80.53871341218844,343.0 -100,"(43.47774658890413, -80.5384360438759)",43.47774658890413,-80.5384360438759,344.0 -101,"(43.477845227341874, -80.53815867466099)",43.477845227341874,-80.53815867466099,344.0 -102,"(43.477943865105104, -80.5378813045437)",43.477943865105104,-80.5378813045437,344.0 -103,"(43.478042502193816, -80.53760393352405)",43.478042502193816,-80.53760393352405,344.0 -104,"(43.478141138608, -80.53732656160201)",43.478141138608,-80.53732656160201,345.0 -105,"(43.47823977434766, -80.5370491887776)",43.47823977434766,-80.5370491887776,346.0 -106,"(43.478338409412785, -80.53677181505083)",43.47833840941279,-80.53677181505083,346.0 -107,"(43.47843704380337, -80.53649444042168)",43.47843704380337,-80.53649444042168,347.0 -108,"(43.47853567751941, -80.53621706489015)",43.47853567751941,-80.53621706489015,348.0 -109,"(43.47863431056091, -80.53593968845625)",43.47863431056091,-80.53593968845625,350.0 -110,"(43.47873294292786, -80.53566231111998)",43.47873294292786,-80.53566231111998,351.0 -111,"(43.47883157462026, -80.53538493288134)",43.47883157462026,-80.53538493288134,353.0 -112,"(43.47863923410959, -80.5352433259979)",43.47863923410959,-80.5352433259979,351.0 -113,"(43.47844689341706, -80.5351017200128)",43.47844689341706,-80.5351017200128,349.0 -114,"(43.47825455254268, -80.53496011492606)",43.47825455254268,-80.53496011492606,348.0 -115,"(43.478062211486446, -80.53481851073765)",43.478062211486446,-80.53481851073765,350.0 -116,"(43.477869870248355, -80.53467690744756)",43.47786987024836,-80.53467690744756,349.0 -117,"(43.47767752882842, -80.53453530505578)",43.47767752882842,-80.53453530505578,349.0 -118,"(43.47748518722664, -80.53439370356232)",43.47748518722664,-80.53439370356232,349.0 -119,"(43.47729284544301, -80.53425210296714)",43.47729284544301,-80.53425210296714,350.0 -120,"(43.477100503477544, -80.53411050327023)",43.47710050347754,-80.53411050327023,351.0 -121,"(43.476908161330236, -80.5339689044716)",43.47690816133024,-80.5339689044716,351.0 -122,"(43.47671581900108, -80.53382730657123)",43.47671581900108,-80.53382730657123,350.0 -123,"(43.476523476490094, -80.5336857095691)",43.476523476490094,-80.5336857095691,350.0 -124,"(43.47633113379728, -80.53354411346521)",43.47633113379728,-80.53354411346521,350.0 -125,"(43.47613879092263, -80.53340251825955)",43.47613879092263,-80.53340251825955,350.0 -126,"(43.47594644786616, -80.5332609239521)",43.47594644786616,-80.5332609239521,350.0 -127,"(43.475754104627846, -80.53311933054285)",43.475754104627846,-80.53311933054285,351.0 -128,"(43.47556176120772, -80.53297773803179)",43.47556176120772,-80.53297773803179,350.0 -129,"(43.47536941760577, -80.53283614641893)",43.47536941760577,-80.53283614641893,351.0 -130,"(43.47517707382198, -80.53269455570423)",43.47517707382198,-80.53269455570423,351.0 -131,"(43.474984729856395, -80.53255296588767)",43.4749847298564,-80.53255296588767,351.0 -132,"(43.474792385709, -80.53241137696929)",43.474792385709,-80.53241137696929,350.0 -133,"(43.47460004137977, -80.53226978894904)",43.47460004137977,-80.53226978894904,347.0 -134,"(43.474407696868745, -80.53212820182691)",43.474407696868745,-80.53212820182691,345.0 -135,"(43.474215352175904, -80.53198661560289)",43.474215352175904,-80.53198661560289,343.0 -136,"(43.474023007301255, -80.531845030277)",43.474023007301255,-80.531845030277,343.0 -137,"(43.473830662244815, -80.53170344584917)",43.473830662244815,-80.53170344584917,343.0 -138,"(43.47372587646144, -80.53196442068774)",43.47372587646144,-80.53196442068774,342.0 -139,"(43.473621090080506, -80.5322253946245)",43.473621090080506,-80.5322253946245,341.0 -140,"(43.47351630310205, -80.53248636765943)",43.47351630310205,-80.53248636765943,340.0 -141,"(43.47341151552607, -80.53274733979254)",43.47341151552607,-80.53274733979254,340.0 -142,"(43.47330672735254, -80.53300831102382)",43.47330672735254,-80.53300831102382,340.0 -143,"(43.4732019385815, -80.5332692813533)",43.4732019385815,-80.5332692813533,340.0 -144,"(43.47309714921293, -80.53353025078094)",43.47309714921293,-80.53353025078094,340.0 -145,"(43.472992359246845, -80.53379121930678)",43.472992359246845,-80.53379121930678,341.0 -146,"(43.472887568683255, -80.53405218693081)",43.472887568683255,-80.53405218693081,341.0 -147,"(43.47278277752214, -80.53431315365303)",43.47278277752214,-80.53431315365303,342.0 -148,"(43.47267798576353, -80.53457411947342)",43.47267798576353,-80.53457411947342,343.0 -149,"(43.47257319340743, -80.53483508439201)",43.47257319340743,-80.53483508439201,344.0 -150,"(43.47246840045383, -80.53509604840879)",43.47246840045383,-80.53509604840879,343.0 -151,"(43.472363606902725, -80.53535701152377)",43.472363606902725,-80.53535701152377,342.0 -152,"(43.472258812754134, -80.53561797373693)",43.47225881275413,-80.53561797373693,340.0 -153,"(43.47215401800807, -80.5358789350483)",43.47215401800807,-80.5358789350483,339.0 -154,"(43.47204922266452, -80.53613989545786)",43.47204922266452,-80.53613989545786,338.0 -155,"(43.4719444267235, -80.53640085496562)",43.4719444267235,-80.53640085496562,339.0 -156,"(43.47183963018501, -80.53666181357157)",43.47183963018501,-80.53666181357157,339.0 -157,"(43.471734833049055, -80.53692277127573)",43.471734833049055,-80.53692277127573,339.0 -158,"(43.47163003531563, -80.53718372807808)",43.47163003531563,-80.53718372807808,340.0 -159,"(43.471525236984746, -80.53744468397863)",43.471525236984746,-80.53744468397863,339.0 -160,"(43.47132285394585, -80.53756280284698)",43.47132285394585,-80.53756280284698,339.0 -161,"(43.471120470777755, -80.53768092092704)",43.47112047077776,-80.53768092092704,339.0 -162,"(43.47091808748045, -80.53779903821885)",43.47091808748045,-80.53779903821885,338.0 -163,"(43.470715704053944, -80.53791715472241)",43.47071570405394,-80.53791715472241,338.0 -164,"(43.470513320498256, -80.53803527043773)",43.470513320498256,-80.53803527043773,338.0 -165,"(43.470310936813355, -80.53815338536482)",43.47031093681336,-80.53815338536482,337.0 -166,"(43.470108552999264, -80.5382714995037)",43.470108552999264,-80.5382714995037,335.0 -167,"(43.46990616905598, -80.53838961285436)",43.46990616905598,-80.53838961285436,334.0 -168,"(43.4697037849835, -80.53850772541682)",43.4697037849835,-80.53850772541682,333.0 -169,"(43.46950140078184, -80.5386258371911)",43.46950140078184,-80.5386258371911,334.0 -170,"(43.46929901645099, -80.5387439481772)",43.46929901645099,-80.5387439481772,335.0 -171,"(43.46909663199095, -80.53886205837513)",43.46909663199095,-80.53886205837513,335.0 -172,"(43.46889424740172, -80.5389801677849)",43.46889424740172,-80.5389801677849,333.0 -173,"(43.468691862683315, -80.53909827640653)",43.46869186268332,-80.53909827640653,332.0 -174,"(43.46848947783573, -80.53921638424004)",43.46848947783573,-80.53921638424004,331.0 -175,"(43.468287092858965, -80.5393344912854)",43.468287092858965,-80.5393344912854,330.0 -176,"(43.468084707753015, -80.53945259754265)",43.468084707753015,-80.53945259754265,329.0 -177,"(43.46788232251789, -80.5395707030118)",43.46788232251789,-80.5395707030118,329.0 -178,"(43.467679937153584, -80.53968880769285)",43.467679937153584,-80.53968880769285,327.0 -179,"(43.46747755166012, -80.53980691158583)",43.46747755166012,-80.53980691158583,326.0 -180,"(43.467275166037474, -80.53992501469072)",43.467275166037474,-80.53992501469072,328.0 -181,"(43.46707278028566, -80.54004311700756)",43.46707278028566,-80.54004311700756,330.0 -182,"(43.46687039440469, -80.54016121853633)",43.46687039440469,-80.54016121853633,331.0 -183,"(43.466668008394535, -80.54027931927706)",43.466668008394535,-80.54027931927706,331.0 -184,"(43.46646562225523, -80.54039741922976)",43.46646562225523,-80.54039741922976,330.0 -185,"(43.466263235986744, -80.54051551839446)",43.46626323598674,-80.54051551839446,330.0 -186,"(43.46606084958911, -80.54063361677112)",43.46606084958911,-80.54063361677112,330.0 -187,"(43.46585846306231, -80.54075171435979)",43.46585846306231,-80.54075171435979,330.0 -188,"(43.46565607640636, -80.54086981116046)",43.46565607640636,-80.54086981116046,332.0 -189,"(43.46545368962124, -80.54098790717316)",43.46545368962124,-80.54098790717316,335.0 -190,"(43.46525130270698, -80.54110600239788)",43.46525130270698,-80.54110600239788,337.0 -191,"(43.46504891566356, -80.54122409683465)",43.46504891566356,-80.54122409683465,337.0 -192,"(43.46484652849099, -80.54134219048346)",43.46484652849099,-80.54134219048346,336.0 -193,"(43.46464414118927, -80.54146028334435)",43.46464414118927,-80.54146028334435,335.0 -194,"(43.4644417537584, -80.54157837541729)",43.4644417537584,-80.54157837541729,334.0 -195,"(43.464304877302574, -80.5413436835921)",43.464304877302574,-80.5413436835921,333.0 -196,"(43.46416800036178, -80.54110899282594)",43.46416800036178,-80.54110899282594,333.0 -197,"(43.46403112293602, -80.5408743031188)",43.46403112293602,-80.5408743031188,334.0 -198,"(43.46389424502531, -80.54063961447065)",43.46389424502531,-80.54063961447065,334.0 -199,"(43.463757366629636, -80.5404049268815)",43.46375736662964,-80.5404049268815,334.0 -200,"(43.46362048774902, -80.54017024035134)",43.46362048774902,-80.54017024035134,333.0 -201,"(43.46348360838345, -80.53993555488016)",43.46348360838345,-80.53993555488016,332.0 -202,"(43.46331969082911, -80.53976512159053)",43.46331969082911,-80.53976512159053,331.0 -203,"(43.46315577301604, -80.53959468922189)",43.46315577301604,-80.53959468922189,332.0 -204,"(43.462991854944235, -80.53942425777419)",43.46299185494424,-80.53942425777419,332.0 -205,"(43.46282793661371, -80.53925382724742)",43.46282793661371,-80.53925382724742,333.0 -206,"(43.46266401802443, -80.53908339764159)",43.46266401802443,-80.53908339764159,333.0