import Data_Collector as DC
import pyproj

geodesic = pyproj.Geod(ellps='WGS84')  # notice: [lon lat] notation!!!

area = (38.73, -9.3044, 38.739, -9.279)  # Tagus_Location1
buildings_nodes, buildings_ways = DC.collectBuildings_OSM_data(area)

online_path = [[-9.3021, 38.7374], [-9.302047, 38.737389], [-9.301994, 38.737377], [-9.301941, 38.737366], [-9.301888, 38.737354], [-9.301835, 38.737343], [-9.301781, 38.737331], [-9.301728, 38.73732], [-9.301675, 38.737308], [-9.301622, 38.737297], [-9.301569, 38.737286], [-9.301516, 38.737274], [-9.301463, 38.737263], [-9.30141, 38.737251], [-9.301357, 38.73724], [-9.301304, 38.737228], [-9.301251, 38.737217], [-9.301198, 38.737205], [-9.301144, 38.737194], [-9.301091, 38.737182], [-9.301038, 38.737171], [-9.300985, 38.73716], [-9.300932, 38.737148], [-9.300879, 38.737137], [-9.300826, 38.737125], [-9.300773, 38.737114], [-9.30072, 38.737102], [-9.300667, 38.737091], [-9.300614, 38.737079], [-9.300561, 38.737068], [-9.300507, 38.737057], [-9.300454, 38.737045], [-9.300401, 38.737034], [-9.300348, 38.737022], [-9.300295, 38.737011], [-9.300242, 38.736999], [-9.300189, 38.736988], [-9.300136, 38.736976], [-9.300083, 38.736965], [-9.30003, 38.736953], [-9.299977, 38.736942], [-9.299923, 38.736931], [-9.29987, 38.736919], [-9.299817, 38.736908], [-9.299764, 38.736896], [-9.299711, 38.736885], [-9.299658, 38.736873], [-9.299605, 38.736862], [-9.299552, 38.73685], [-9.299499, 38.736839], [-9.299446, 38.736828], [-9.299393, 38.736816], [-9.29934, 38.736805], [-9.299286, 38.736793], [-9.299233, 38.736782], [-9.29918, 38.73677], [-9.299127, 38.736759], [-9.299074, 38.736747], [-9.299021, 38.736736], [-9.298968, 38.736724], [-9.298915, 38.736713], [-9.298862, 38.736702], [-9.298809, 38.73669], [-9.298756, 38.736679], [-9.298703, 38.736667], [-9.298649, 38.736656], [-9.298596, 38.736644], [-9.298543, 38.736633], [-9.29849, 38.736621], [-9.298437, 38.73661], [-9.298384, 38.736599], [-9.298331, 38.736587], [-9.298278, 38.736576], [-9.298225, 38.736564], [-9.298172, 38.736553], [-9.298119, 38.736541], [-9.298066, 38.73653], [-9.298012, 38.736518], [-9.297959, 38.736507], [-9.297906, 38.736495], [-9.297853, 38.736484], [-9.2978, 38.736473], [-9.297747, 38.736461], [-9.297694, 38.73645], [-9.297641, 38.736438], [-9.297588, 38.736427], [-9.297535, 38.736415], [-9.297482, 38.736404], [-9.297443, 38.736351], [-9.297458, 38.736309], [-9.297472, 38.736268], [-9.297487, 38.736227], [-9.297448, 38.736174], [-9.297395, 38.736162], [-9.297342, 38.736151], [-9.297289, 38.736139], [-9.297236, 38.736128], [-9.297183, 38.736116], [-9.29713, 38.736105], [-9.297077, 38.736093], [-9.297024, 38.736082], [-9.296971, 38.736071], [-9.296917, 38.736059], [-9.296864, 38.736048], [-9.296811, 38.736036], [-9.296758, 38.736025], [-9.296705, 38.736013], [-9.296652, 38.736002], [-9.296599, 38.73599], [-9.296546, 38.735979], [-9.296493, 38.735967], [-9.29644, 38.735956], [-9.296387, 38.735945], [-9.296334, 38.735933], [-9.29628, 38.735922], [-9.296227, 38.73591], [-9.296174, 38.735899], [-9.296121, 38.735887], [-9.296068, 38.735876], [-9.296015, 38.735864], [-9.295962, 38.735853], [-9.295909, 38.735842], [-9.295856, 38.73583], [-9.295803, 38.735819], [-9.29575, 38.735807], [-9.295697, 38.735796], [-9.295643, 38.735784], [-9.29559, 38.735773], [-9.295537, 38.735761], [-9.295484, 38.73575], [-9.295431, 38.735738], [-9.295378, 38.735727], [-9.295325, 38.735716], [-9.295272, 38.735704], [-9.295219, 38.735693], [-9.295166, 38.735681], [-9.295113, 38.73567], [-9.29506, 38.735658], [-9.295006, 38.735647], [-9.294953, 38.735635], [-9.2949, 38.735624], [-9.294847, 38.735612], [-9.294794, 38.735601], [-9.294741, 38.73559], [-9.294688, 38.735578], [-9.294635, 38.735567], [-9.294582, 38.735555], [-9.294529, 38.735544], [-9.294476, 38.735532], [-9.294423, 38.735521], [-9.294369, 38.735509], [-9.294316, 38.735498], [-9.294263, 38.735486], [-9.29421, 38.735475], [-9.294157, 38.735464], [-9.294104, 38.735452], [-9.294051, 38.735441], [-9.293998, 38.735429], [-9.293945, 38.735418], [-9.293892, 38.735406], [-9.293839, 38.735395], [-9.293786, 38.735383], [-9.293732, 38.735372], [-9.293679, 38.735361], [-9.293626, 38.735349], [-9.293573, 38.735338], [-9.29352, 38.735326], [-9.293467, 38.735315], [-9.293414, 38.735303], [-9.293361, 38.735292], [-9.293308, 38.73528], [-9.293255, 38.735269], [-9.293202, 38.735257], [-9.293149, 38.735246], [-9.293095, 38.735235], [-9.293042, 38.735223], [-9.292989, 38.735212], [-9.292936, 38.7352], [-9.292883, 38.735189], [-9.29283, 38.735177], [-9.292777, 38.735166], [-9.292724, 38.735154], [-9.292671, 38.735143], [-9.292618, 38.735131], [-9.292565, 38.73512], [-9.292512, 38.735109], [-9.292458, 38.735097], [-9.292405, 38.735086], [-9.292352, 38.735074], [-9.292299, 38.735063], [-9.292246, 38.735051], [-9.292193, 38.73504], [-9.29214, 38.735028], [-9.292087, 38.735017], [-9.292034, 38.735005], [-9.291981, 38.734994], [-9.291928, 38.734983], [-9.291875, 38.734971], [-9.291821, 38.73496], [-9.291768, 38.734948], [-9.291715, 38.734937], [-9.291662, 38.734925], [-9.291609, 38.734914], [-9.291556, 38.734902], [-9.291503, 38.734891], [-9.29145, 38.734879], [-9.291397, 38.734868], [-9.291344, 38.734857], [-9.291291, 38.734845], [-9.291238, 38.734834], [-9.291184, 38.734822], [-9.291131, 38.734811], [-9.291078, 38.734799], [-9.291025, 38.734788], [-9.290972, 38.734776], [-9.290919, 38.734765], [-9.290866, 38.734753], [-9.290813, 38.734742], [-9.29076, 38.734731], [-9.290707, 38.734719], [-9.290654, 38.734708], [-9.290601, 38.734696], [-9.290547, 38.734685], [-9.290494, 38.734673], [-9.290441, 38.734662], [-9.290388, 38.73465], [-9.290335, 38.734639], [-9.290282, 38.734627], [-9.290229, 38.734616], [-9.290176, 38.734605], [-9.290123, 38.734593], [-9.29007, 38.734582], [-9.290017, 38.73457], [-9.289964, 38.734559], [-9.28991, 38.734547], [-9.289857, 38.734536], [-9.289804, 38.734524], [-9.289751, 38.734513], [-9.289698, 38.734501], [-9.289645, 38.73449], [-9.289592, 38.734479], [-9.289539, 38.734467], [-9.289486, 38.734456], [-9.289433, 38.734444], [-9.28938, 38.734433], [-9.289327, 38.734421], [-9.289273, 38.73441], [-9.28922, 38.734398], [-9.289167, 38.734387], [-9.289114, 38.734375], [-9.289061, 38.734364], [-9.289008, 38.734353], [-9.288955, 38.734341], [-9.288902, 38.73433], [-9.288849, 38.734318], [-9.288796, 38.734307], [-9.288743, 38.734295], [-9.288675, 38.734325], [-9.28866, 38.734367], [-9.288646, 38.734408], [-9.288631, 38.73445], [-9.288564, 38.73448], [-9.288511, 38.734468], [-9.288457, 38.734457], [-9.288404, 38.734445], [-9.288351, 38.734434], [-9.288298, 38.734422], [-9.288245, 38.734411], [-9.288192, 38.7344], [-9.288139, 38.734388], [-9.288086, 38.734377], [-9.288033, 38.734365], [-9.28798, 38.734354], [-9.287927, 38.734342], [-9.287874, 38.734331], [-9.28782, 38.734319], [-9.287767, 38.734308], [-9.287714, 38.734296], [-9.287661, 38.734285], [-9.287608, 38.734274], [-9.287555, 38.734262], [-9.287502, 38.734251], [-9.287449, 38.734239], [-9.287396, 38.734228], [-9.287343, 38.734216], [-9.28729, 38.734205], [-9.287237, 38.734193], [-9.287183, 38.734182], [-9.28713, 38.73417], [-9.287077, 38.734159], [-9.287024, 38.734148], [-9.286971, 38.734136], [-9.286918, 38.734125], [-9.286865, 38.734113], [-9.286812, 38.734102], [-9.286759, 38.73409], [-9.286706, 38.734079], [-9.286653, 38.734067], [-9.2866, 38.734056], [-9.286547, 38.734044], [-9.286493, 38.734033], [-9.28644, 38.734022], [-9.286387, 38.73401], [-9.286334, 38.733999], [-9.286281, 38.733987], [-9.286228, 38.733976], [-9.286175, 38.733964], [-9.286122, 38.733953], [-9.286069, 38.733941], [-9.286016, 38.73393], [-9.285963, 38.733918], [-9.28591, 38.733907], [-9.285856, 38.733896], [-9.285803, 38.733884], [-9.28575, 38.733873], [-9.285697, 38.733861], [-9.285644, 38.73385], [-9.285591, 38.733838], [-9.285538, 38.733827], [-9.285485, 38.733815], [-9.285432, 38.733804], [-9.285379, 38.733792], [-9.285326, 38.733781], [-9.285273, 38.73377], [-9.285219, 38.733758], [-9.285166, 38.733747], [-9.285113, 38.733735], [-9.28506, 38.733724], [-9.285007, 38.733712], [-9.284954, 38.733701], [-9.284901, 38.733689], [-9.284848, 38.733678], [-9.284795, 38.733666], [-9.284742, 38.733655], [-9.284674, 38.733685], [-9.28466, 38.733726], [-9.284645, 38.733768], [-9.28463, 38.733809], [-9.284563, 38.733839], [-9.28451, 38.733828], [-9.284457, 38.733816], [-9.284389, 38.733847], [-9.284374, 38.733888], [-9.28436, 38.733929], [-9.284345, 38.733971], [-9.284277, 38.734001], [-9.284224, 38.733989], [-9.284171, 38.733978], [-9.284118, 38.733967], [-9.284065, 38.733955], [-9.283997, 38.733985], [-9.283983, 38.734027], [-9.283968, 38.734068], [-9.283901, 38.734098], [-9.283848, 38.734087], [-9.283795, 38.734075], [-9.283741, 38.734064], [-9.283688, 38.734052], [-9.283635, 38.734041], [-9.283582, 38.734029], [-9.283529, 38.734018], [-9.283476, 38.734006], [-9.283423, 38.733995], [-9.28337, 38.733984], [-9.283317, 38.733972], [-9.283264, 38.733961], [-9.283211, 38.733949], [-9.283158, 38.733938], [-9.283104, 38.733926], [-9.283051, 38.733915], [-9.282998, 38.733903], [-9.282945, 38.733892], [-9.282892, 38.73388], [-9.282854, 38.733827], [-9.282815, 38.733775], [-9.282777, 38.733722], [-9.282738, 38.733669], [-9.282685, 38.733657], [-9.282632, 38.733646], [-9.282579, 38.733634], [-9.282526, 38.733623], [-9.282487, 38.73357], [-9.282449, 38.733517], [-9.28241, 38.733464], [-9.282372, 38.733411], [-9.282333, 38.733358], [-9.28228, 38.733347], [-9.282227, 38.733335], [-9.282174, 38.733324], [-9.282121, 38.733312], [-9.282068, 38.733301], [-9.282015, 38.733289], [-9.281976, 38.733237], [-9.281938, 38.733184], [-9.281899, 38.733131], [-9.281861, 38.733078], [-9.281808, 38.733066], [-9.281755, 38.733055], [-9.281702, 38.733043], [-9.281649, 38.733032], [-9.281595, 38.73302], [-9.281542, 38.733009], [-9.281504, 38.732956], [-9.281451, 38.732945], [-9.281398, 38.732933], [-9.281345, 38.732922], [-9.281292, 38.73291], [-9.281238, 38.732899], [-9.281185, 38.732887], [-9.281132, 38.732876], [-9.281079, 38.732864], [-9.281026, 38.732853], [-9.280973, 38.732841], [-9.28092, 38.73283]]

offline_path = [[-9.3021, 38.7374], [-9.302047, 38.737389], [-9.301994, 38.737377], [-9.301941, 38.737366], [-9.301888, 38.737354], [-9.301835, 38.737343], [-9.301781, 38.737331], [-9.301728, 38.73732], [-9.301675, 38.737308], [-9.301622, 38.737297], [-9.301569, 38.737286], [-9.301516, 38.737274], [-9.301463, 38.737263], [-9.30141, 38.737251], [-9.301357, 38.73724], [-9.301304, 38.737228], [-9.301251, 38.737217], [-9.301198, 38.737205], [-9.301144, 38.737194], [-9.301091, 38.737182], [-9.301038, 38.737171], [-9.300985, 38.73716], [-9.300932, 38.737148], [-9.300879, 38.737137], [-9.300826, 38.737125], [-9.300773, 38.737114], [-9.30072, 38.737102], [-9.300667, 38.737091], [-9.300614, 38.737079], [-9.300561, 38.737068], [-9.300507, 38.737057], [-9.300454, 38.737045], [-9.300401, 38.737034], [-9.300348, 38.737022], [-9.300295, 38.737011], [-9.300242, 38.736999], [-9.300189, 38.736988], [-9.300136, 38.736976], [-9.300083, 38.736965], [-9.30003, 38.736953], [-9.299977, 38.736942], [-9.299923, 38.736931], [-9.29987, 38.736919], [-9.299817, 38.736908], [-9.299764, 38.736896], [-9.299711, 38.736885], [-9.299658, 38.736873], [-9.299605, 38.736862], [-9.299552, 38.73685], [-9.299499, 38.736839], [-9.299446, 38.736828], [-9.299393, 38.736816], [-9.29934, 38.736805], [-9.299286, 38.736793], [-9.299233, 38.736782], [-9.29918, 38.73677], [-9.299127, 38.736759], [-9.299074, 38.736747], [-9.299021, 38.736736], [-9.298968, 38.736724], [-9.298915, 38.736713], [-9.298862, 38.736702], [-9.298809, 38.73669], [-9.298756, 38.736679], [-9.298703, 38.736667], [-9.298649, 38.736656], [-9.298596, 38.736644], [-9.298543, 38.736633], [-9.29849, 38.736621], [-9.298437, 38.73661], [-9.298384, 38.736599], [-9.298331, 38.736587], [-9.298278, 38.736576], [-9.298225, 38.736564], [-9.298172, 38.736553], [-9.298119, 38.736541], [-9.298066, 38.73653], [-9.298012, 38.736518], [-9.297959, 38.736507], [-9.297906, 38.736495], [-9.297853, 38.736484], [-9.2978, 38.736473], [-9.297747, 38.736461], [-9.297694, 38.73645], [-9.297641, 38.736438], [-9.297588, 38.736427], [-9.297535, 38.736415], [-9.297496, 38.736362], [-9.297511, 38.736321], [-9.297525, 38.736279], [-9.297487, 38.736227], [-9.297501, 38.736185], [-9.297516, 38.736144], [-9.297477, 38.736091], [-9.297424, 38.736079], [-9.297371, 38.736068], [-9.297318, 38.736056], [-9.297265, 38.736045], [-9.297212, 38.736033], [-9.297159, 38.736022], [-9.297106, 38.73601], [-9.297053, 38.735999], [-9.297, 38.735988], [-9.296947, 38.735976], [-9.296894, 38.735965], [-9.29684, 38.735953], [-9.296787, 38.735942], [-9.296734, 38.73593], [-9.296681, 38.735919], [-9.296628, 38.735907], [-9.296575, 38.735896], [-9.296522, 38.735885], [-9.296469, 38.735873], [-9.296416, 38.735862], [-9.296363, 38.73585], [-9.29631, 38.735839], [-9.296257, 38.735827], [-9.296203, 38.735816], [-9.29615, 38.735804], [-9.296097, 38.735793], [-9.296044, 38.735781], [-9.295991, 38.73577], [-9.295938, 38.735759], [-9.295885, 38.735747], [-9.295832, 38.735736], [-9.295779, 38.735724], [-9.295726, 38.735713], [-9.295673, 38.735701], [-9.29562, 38.73569], [-9.295566, 38.735678], [-9.295513, 38.735667], [-9.29546, 38.735655], [-9.295407, 38.735644], [-9.295354, 38.735633], [-9.295301, 38.735621], [-9.295248, 38.73561], [-9.295195, 38.735598], [-9.295142, 38.735587], [-9.295089, 38.735575], [-9.295036, 38.735564], [-9.294983, 38.735552], [-9.294929, 38.735541], [-9.294876, 38.73553], [-9.294823, 38.735518], [-9.29477, 38.735507], [-9.294717, 38.735495], [-9.294664, 38.735484], [-9.294611, 38.735472], [-9.294558, 38.735461], [-9.294505, 38.735449], [-9.294452, 38.735438], [-9.294399, 38.735426], [-9.294346, 38.735415], [-9.294292, 38.735404], [-9.294239, 38.735392], [-9.294186, 38.735381], [-9.294133, 38.735369], [-9.29408, 38.735358], [-9.294027, 38.735346], [-9.293974, 38.735335], [-9.293921, 38.735323], [-9.293868, 38.735312], [-9.293815, 38.7353], [-9.293762, 38.735289], [-9.293709, 38.735278], [-9.293655, 38.735266], [-9.293602, 38.735255], [-9.293549, 38.735243], [-9.293496, 38.735232], [-9.293443, 38.73522], [-9.29339, 38.735209], [-9.293337, 38.735197], [-9.293284, 38.735186], [-9.293231, 38.735174], [-9.293178, 38.735163], [-9.293125, 38.735152], [-9.293072, 38.73514], [-9.293018, 38.735129], [-9.292965, 38.735117], [-9.292912, 38.735106], [-9.292859, 38.735094], [-9.292806, 38.735083], [-9.292753, 38.735071], [-9.2927, 38.73506], [-9.292647, 38.735049], [-9.292594, 38.735037], [-9.292541, 38.735026], [-9.292488, 38.735014], [-9.292435, 38.735003], [-9.292381, 38.734991], [-9.292328, 38.73498], [-9.292275, 38.734968], [-9.292222, 38.734957], [-9.292169, 38.734945], [-9.292116, 38.734934], [-9.292063, 38.734923], [-9.29201, 38.734911], [-9.291957, 38.7349], [-9.291904, 38.734888], [-9.291851, 38.734877], [-9.291798, 38.734865], [-9.291744, 38.734854], [-9.291691, 38.734842], [-9.291638, 38.734831], [-9.291585, 38.734819], [-9.291532, 38.734808], [-9.291479, 38.734797], [-9.291426, 38.734785], [-9.291373, 38.734774], [-9.29132, 38.734762], [-9.291267, 38.734751], [-9.291214, 38.734739], [-9.291161, 38.734728], [-9.291107, 38.734716], [-9.291054, 38.734705], [-9.291001, 38.734693], [-9.290948, 38.734682], [-9.290895, 38.734671], [-9.290842, 38.734659], [-9.290789, 38.734648], [-9.290736, 38.734636], [-9.290683, 38.734625], [-9.29063, 38.734613], [-9.290577, 38.734602], [-9.290524, 38.73459], [-9.29047, 38.734579], [-9.290417, 38.734567], [-9.290364, 38.734556], [-9.290311, 38.734545], [-9.290258, 38.734533], [-9.290205, 38.734522], [-9.290152, 38.73451], [-9.290099, 38.734499], [-9.290046, 38.734487], [-9.289993, 38.734476], [-9.28994, 38.734464], [-9.289887, 38.734453], [-9.289833, 38.734441], [-9.28978, 38.73443], [-9.289727, 38.734419], [-9.289674, 38.734407], [-9.289621, 38.734396], [-9.289568, 38.734384], [-9.289515, 38.734373], [-9.289462, 38.734361], [-9.289409, 38.73435], [-9.289356, 38.734338], [-9.289303, 38.734327], [-9.28925, 38.734315], [-9.289196, 38.734304], [-9.289143, 38.734293], [-9.289076, 38.734323], [-9.289023, 38.734311], [-9.28897, 38.7343], [-9.288916, 38.734288], [-9.288863, 38.734277], [-9.28881, 38.734265], [-9.288757, 38.734254], [-9.288719, 38.734201], [-9.288733, 38.734159], [-9.288748, 38.734118], [-9.288762, 38.734076], [-9.288724, 38.734024], [-9.288739, 38.733982], [-9.2887, 38.733929], [-9.288662, 38.733876], [-9.288608, 38.733865], [-9.288555, 38.733853], [-9.288502, 38.733842], [-9.288449, 38.73383], [-9.288411, 38.733777], [-9.288425, 38.733736], [-9.28844, 38.733695], [-9.288401, 38.733642], [-9.288363, 38.733589], [-9.288324, 38.733536], [-9.288271, 38.733524], [-9.288218, 38.733513], [-9.288165, 38.733501], [-9.288112, 38.73349], [-9.288059, 38.733478], [-9.288006, 38.733467], [-9.287953, 38.733456], [-9.2879, 38.733444], [-9.287832, 38.733474], [-9.287779, 38.733463], [-9.287711, 38.733493], [-9.287644, 38.733523], [-9.287576, 38.733553], [-9.287508, 38.733583], [-9.287441, 38.733613], [-9.287373, 38.733643], [-9.287305, 38.733673], [-9.287238, 38.733703], [-9.28717, 38.733733], [-9.287102, 38.733763], [-9.287035, 38.733793], [-9.286967, 38.733823], [-9.286899, 38.733853], [-9.286832, 38.733883], [-9.286779, 38.733871], [-9.286726, 38.73386], [-9.286672, 38.733849], [-9.286619, 38.733837], [-9.286552, 38.733867], [-9.286499, 38.733856], [-9.286446, 38.733844], [-9.286393, 38.733833], [-9.286339, 38.733821], [-9.286286, 38.73381], [-9.286233, 38.733798], [-9.28618, 38.733787], [-9.286127, 38.733775], [-9.286074, 38.733764], [-9.286021, 38.733753], [-9.285968, 38.733741], [-9.285915, 38.73373], [-9.285862, 38.733718], [-9.285809, 38.733707], [-9.285756, 38.733695], [-9.285702, 38.733684], [-9.285649, 38.733672], [-9.285596, 38.733661], [-9.285543, 38.733649], [-9.28549, 38.733638], [-9.285437, 38.733627], [-9.285384, 38.733615], [-9.285316, 38.733645], [-9.285263, 38.733634], [-9.28521, 38.733622], [-9.285157, 38.733611], [-9.285104, 38.733599], [-9.285051, 38.733588], [-9.284998, 38.733576], [-9.284945, 38.733565], [-9.284892, 38.733553], [-9.284839, 38.733542], [-9.284771, 38.733572], [-9.284756, 38.733613], [-9.284742, 38.733655], [-9.284674, 38.733685], [-9.28466, 38.733726], [-9.284645, 38.733768], [-9.28463, 38.733809], [-9.284616, 38.733851], [-9.284548, 38.733881], [-9.284495, 38.733869], [-9.284442, 38.733858], [-9.284374, 38.733888], [-9.28436, 38.733929], [-9.284345, 38.733971], [-9.284331, 38.734012], [-9.284263, 38.734042], [-9.284195, 38.734072], [-9.284128, 38.734102], [-9.28406, 38.734132], [-9.283992, 38.734162], [-9.283925, 38.734193], [-9.283857, 38.734223], [-9.283789, 38.734253], [-9.283722, 38.734283], [-9.283654, 38.734313], [-9.283586, 38.734343], [-9.283519, 38.734373], [-9.283504, 38.734414], [-9.283489, 38.734456], [-9.283475, 38.734497], [-9.28346, 38.734539], [-9.283446, 38.73458], [-9.283431, 38.734621], [-9.283417, 38.734663], [-9.283402, 38.734704], [-9.283387, 38.734746], [-9.28332, 38.734776], [-9.283252, 38.734806], [-9.283199, 38.734794], [-9.283146, 38.734783], [-9.283093, 38.734772], [-9.283025, 38.734802], [-9.282972, 38.73479], [-9.282919, 38.734779], [-9.282866, 38.734767], [-9.282813, 38.734756], [-9.28276, 38.734744], [-9.282707, 38.734733], [-9.282654, 38.734721], [-9.282601, 38.73471], [-9.282562, 38.734657], [-9.282509, 38.734646], [-9.282456, 38.734634], [-9.282403, 38.734623], [-9.28235, 38.734611], [-9.282297, 38.7346], [-9.282258, 38.734547], [-9.28222, 38.734494], [-9.282181, 38.734441], [-9.282143, 38.734388], [-9.282104, 38.734335], [-9.282066, 38.734282], [-9.282013, 38.734271], [-9.281959, 38.734259], [-9.281921, 38.734206], [-9.281882, 38.734153], [-9.281829, 38.734142], [-9.281776, 38.73413], [-9.281738, 38.734077], [-9.281699, 38.734025], [-9.281661, 38.733972], [-9.281675, 38.73393], [-9.281637, 38.733877], [-9.281598, 38.733824], [-9.28156, 38.733771], [-9.281521, 38.733718], [-9.281483, 38.733665], [-9.281444, 38.733613], [-9.281406, 38.73356], [-9.281367, 38.733507], [-9.281329, 38.733454], [-9.28129, 38.733401], [-9.281252, 38.733348], [-9.281213, 38.733295], [-9.281175, 38.733242], [-9.281136, 38.733189], [-9.281098, 38.733136], [-9.281059, 38.733083], [-9.281074, 38.733042], [-9.281035, 38.732989], [-9.280997, 38.732936], [-9.280958, 38.732883], [-9.28092, 38.73283]]


count = 0
violated_cords = []
for point in online_path:
    for node in buildings_nodes:
        fwd_azimuth, back_azimuth, distance = geodesic.inv(point[0], point[1], node.lon, node.lat)
        if distance < 20:
            print("Violates by :",distance)
            violated_cords.append((point[1],point[0]))
            count += 1

#for pathing in path:
#    print(str(pathing[1])+","+str(pathing[0])+" <green>")
#print("\n\n")
for node in violated_cords:
    print(str(node)[1:-1] + " <orange>")

if count > 0:
    print("Number of times violating margin:", count)
else:
    print("Perfect path")
