From b342fd3d5bb480ebbe959b4e5a352577f60d2ff4 Mon Sep 17 00:00:00 2001 From: cathaypacific8747 Date: Mon, 21 Mar 2022 21:05:40 +0800 Subject: [PATCH] correct data and prepare for colour gradient implementations --- README.md | 1 + combined.csv | 2 +- detailed.csv | 66 ++++++++++++++++++++++++++-------------------------- kml.py | 15 ++++++++---- out.kml | 2 +- 5 files changed, 46 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 566ada7..73c6419 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ ADS-B data of the MU5735 crash, collected from flightradar24. For educational purposes only. `detailed` - https://twitter.com/flightradar24/status/1505863117343014916/photo/2 + `coarse` - https://www.flightradar24.com/data/aircraft/b-1791#2b367bc1 ![path](path.png) \ No newline at end of file diff --git a/combined.csv b/combined.csv index a41b69b..1b1dfa6 100644 --- a/combined.csv +++ b/combined.csv @@ -93,4 +93,4 @@ timestamp,lat,lng,altitude,speed,vs,heading,squawk 1647843741.870,23.33031,111.07468,8175,446,-13248,79,2101 1647843747,23.333084,111.086357,6525,414,-25792,75,2101 1647843751.888,23.33533,111.09754,4375,442,-26752,73,2101 -1647843755.972,23.33752,111.10558,3225,376,-30976,87,2101 +1647843755.972,23.33752,111.10558,3225,376,-30976,87,2101 \ No newline at end of file diff --git a/detailed.csv b/detailed.csv index 8f2d6df..86d8945 100644 --- a/detailed.csv +++ b/detailed.csv @@ -1,33 +1,33 @@ -1647843557,23.38095,110.6546,29100,457,0,100 -1647843567,23.37723,110.67724,29100,457,64,100 -1647843572,23.37524,110.6894,29100,457,64,100 -1647843577,23.37337,110.70074,29100,457,0,100 -1647843587,23.36948,110.72466,29100,457,-64,100 -1647843591,23.36829,110.7319,29100,457,0,100 -1647843593,23.36769,110.73554,29100,457,0,100 -1647843594,23.36732,110.73782,29100,458,0,100 -1647843596,23.36618,110.74458,29100,457,0,100 -1647843597,23.36583,110.74682,29100,457,0,100 -1647843599,23.36508,110.75134,29100,457,0,100 -1647843608,23.36182,110.77128,29100,457,0,100 -1647843613,23.35987,110.78303,29100,457,0,100 -1647843619,23.35791,110.79478,29100,457,0,100 -1647843624,23.35593,110.80695,29100,457,0,100 -1647843634,23.35236,110.82868,29100,457,0,100 -1647843639,23.35043,110.84042,29100,457,0,100 -1647843644,23.34874,110.85083,29100,457,0,100 -1647843660,23.35812,110.88536,27025,433,-21696,98 -1647843664,23.35744,110.89615,24925,425,-30784,91 -1647843669,23.35661,110.90543,22250,386,-30976,100 -1647843675,23.35263,110.91592,17325,429,-30976,123 -1647843680,23.34474,110.92432,15325,520,-22528,140 -1647843691,23.3231,110.94439,12725,551,-16832,127 -1647843695,23.31711,110.95592,11000,556,-21312,112 -1647843701,23.3142,110.96949,9150,558,-21888,100 -1647843706,23.3149,110.98338,7850,590,-15744,81 -1647843716,23.30773,111.01476,7425,565,3520,75 -1647843721,23.3094,111.02875,8025,531,7360,84 -1647843725,23.30974,111.04041,8600,507,8448,88 -1647843742,23.33031,111.07468,8175,446,-13248,79 -1647843752,23.33533,111.09754,4375,442,-26752,73 -1647843756,23.33752,111.10558,3225,376,-30976,87 +1647843556.570,23.38095,110.6546,29100,457,0,100 +1647843566.908,23.37723,110.67724,29100,457,64,100 +1647843572.020,23.37524,110.6894,29100,457,64,100 +1647843577.038,23.37337,110.70074,29100,457,0,100 +1647843587.156,23.36948,110.72466,29100,457,-64,100 +1647843590.666,23.36829,110.7319,29100,457,0,100 +1647843592.580,23.36769,110.73554,29100,457,0,100 +1647843593.572,23.36732,110.73782,29100,458,0,100 +1647843596.386,23.36618,110.74458,29100,457,0,100 +1647843597.120,23.36583,110.74682,29100,457,0,100 +1647843599.386,23.36508,110.75134,29100,457,0,100 +1647843607.620,23.36182,110.77128,29100,457,0,100 +1647843612.932,23.35987,110.78303,29100,457,0,100 +1647843618.822,23.35791,110.79478,29100,457,0,100 +1647843623.936,23.35593,110.80695,29100,457,0,100 +1647843633.596,23.35236,110.82868,29100,457,0,100 +1647843638.772,23.35043,110.84042,29100,457,0,100 +1647843643.714,23.34874,110.85083,29100,457,0,100 +1647843659.832,23.35812,110.88536,27025,433,-21696,98 +1647843664.116,23.35744,110.89615,24925,425,-30784,91 +1647843669.150,23.35661,110.90543,22250,386,-30976,100 +1647843674.952,23.35263,110.91592,17325,429,-30976,123 +1647843679.828,23.34474,110.92432,15325,520,-22528,140 +1647843690.678,23.3231,110.94439,12725,551,-16832,127 +1647843695.160,23.31711,110.95592,11000,556,-21312,112 +1647843700.820,23.3142,110.96949,9150,558,-21888,100 +1647843705.578,23.3149,110.98338,7850,590,-15744,81 +1647843715.848,23.30773,111.01476,7425,565,3520,75 +1647843721.064,23.3094,111.02875,8025,531,7360,84 +1647843725.000,23.30974,111.04041,8600,507,8448,88 +1647843741.870,23.33031,111.07468,8175,446,-13248,79 +1647843751.888,23.33533,111.09754,4375,442,-26752,73 +1647843755.972,23.33752,111.10558,3225,376,-30976,87 \ No newline at end of file diff --git a/kml.py b/kml.py index 957aedb..6302338 100644 --- a/kml.py +++ b/kml.py @@ -1,6 +1,7 @@ import pandas from fastkml import kml from fastkml.geometry import Geometry +from fastkml.styles import LineStyle from shapely.geometry import Point, LineString k = kml.KML() @@ -8,13 +9,17 @@ d = kml.Document() line = [] df = pandas.read_csv('combined.csv') -for i in df.itertuples(): - line.append(Point(i.lng, i.lat, i.altitude * 0.3048)) +df_s = [(i.lng, i.lat, i.altitude * 0.3048) for i in df.itertuples()] -p = kml.Placemark() -p.geometry = Geometry(geometry=LineString(line), altitude_mode="absolute") +for j in range(len(df_s)-1): + p = kml.Placemark() + p.geometry = Geometry(geometry=LineString([ + Point(*df_s[j]), + Point(*df_s[j+1]), + ]), altitude_mode="absolute") + + d.append(p) -d.append(p) k.append(d) with open('out.kml', 'w+', encoding='utf-8') as f: diff --git a/out.kml b/out.kml index 3ed840c..56708f9 100644 --- a/out.kml +++ b/out.kml @@ -1 +1 @@ -11absolute102.905052,25.088350,2560.320000 102.896881,25.081970,2621.280000 102.885353,25.073175,2705.100000 102.873535,25.064301,2773.680000 102.862495,25.056061,2834.640000 102.848770,25.045570,2994.660000 102.838562,25.037796,3192.780000 102.827576,25.029789,3383.280000 102.813416,25.017883,3619.500000 102.809181,25.011122,3695.700000 102.807106,25.005116,3764.280000 102.805939,24.998566,3825.240000 102.806122,24.991196,3893.820000 102.807411,24.984833,3977.640000 102.809853,24.978115,4061.460000 102.813667,24.971054,4099.560000 102.817993,24.965561,4152.900000 102.825264,24.958374,4221.480000 102.830658,24.954025,4251.960000 102.839600,24.948042,4297.680000 102.847595,24.943680,4358.640000 102.855736,24.939972,4419.600000 102.863853,24.936638,4488.180000 102.872299,24.933100,4564.380000 102.881012,24.929306,4632.960000 102.888847,24.925873,4701.540000 102.936760,24.904449,5166.360000 102.991127,24.879519,5562.600000 103.092850,24.833990,6080.760000 103.134102,24.812716,6309.360000 103.140869,24.807175,6347.460000 103.142288,24.805872,6355.080000 103.147575,24.800518,6431.280000 103.160858,24.781403,6507.480000 103.164780,24.773191,6553.200000 103.168739,24.764236,6614.160000 103.172455,24.755493,6659.880000 103.175606,24.748077,6705.600000 103.219048,24.654922,7277.100000 103.226662,24.645639,7330.440000 103.233490,24.637527,7360.920000 103.241119,24.628555,7421.880000 103.248940,24.620129,7475.220000 103.266098,24.604208,7574.280000 103.388268,24.517731,8168.640000 103.523239,24.456219,8679.180000 103.559044,24.439739,8801.100000 108.971939,23.690340,8869.680000 109.106262,23.682100,8877.300000 109.257454,23.655533,8869.680000 109.400940,23.626373,8869.680000 109.540199,23.597946,8869.680000 109.678093,23.569702,8869.680000 109.817787,23.540955,8869.680000 109.957016,23.512024,8869.680000 110.097191,23.482864,8869.680000 110.235718,23.453979,8869.680000 110.374756,23.426250,8869.680000 110.513969,23.403809,8869.680000 110.638763,23.383530,8869.680000 110.654600,23.380950,8869.680000 110.677240,23.377230,8869.680000 110.689400,23.375240,8869.680000 110.700740,23.373370,8869.680000 110.724660,23.369480,8869.680000 110.731900,23.368290,8869.680000 110.735540,23.367690,8869.680000 110.737820,23.367320,8869.680000 110.744580,23.366180,8869.680000 110.746820,23.365830,8869.680000 110.751340,23.365080,8869.680000 110.771280,23.361820,8869.680000 110.783030,23.359870,8869.680000 110.794780,23.357910,8869.680000 110.806950,23.355930,8869.680000 110.828680,23.352360,8869.680000 110.840420,23.350430,8869.680000 110.850830,23.348740,8869.680000 110.885360,23.358120,8237.220000 110.896150,23.357440,7597.140000 110.905430,23.356610,6781.800000 110.915920,23.352630,5280.660000 110.924320,23.344740,4671.060000 110.944390,23.323100,3878.580000 110.955920,23.317110,3352.800000 110.969490,23.314200,2788.920000 110.983380,23.314900,2392.680000 111.014760,23.307730,2263.140000 111.028750,23.309400,2446.020000 111.040410,23.309740,2621.280000 111.063889,23.327911,2766.060000 111.074680,23.330310,2491.740000 111.086357,23.333084,1988.820000 111.097540,23.335330,1333.500000 111.105580,23.337520,982.980000 \ No newline at end of file +11absolute102.905052,25.088350,2560.320000 102.896881,25.081970,2621.2800001absolute102.896881,25.081970,2621.280000 102.885353,25.073175,2705.1000001absolute102.885353,25.073175,2705.100000 102.873535,25.064301,2773.6800001absolute102.873535,25.064301,2773.680000 102.862495,25.056061,2834.6400001absolute102.862495,25.056061,2834.640000 102.848770,25.045570,2994.6600001absolute102.848770,25.045570,2994.660000 102.838562,25.037796,3192.7800001absolute102.838562,25.037796,3192.780000 102.827576,25.029789,3383.2800001absolute102.827576,25.029789,3383.280000 102.813416,25.017883,3619.5000001absolute102.813416,25.017883,3619.500000 102.809181,25.011122,3695.7000001absolute102.809181,25.011122,3695.700000 102.807106,25.005116,3764.2800001absolute102.807106,25.005116,3764.280000 102.805939,24.998566,3825.2400001absolute102.805939,24.998566,3825.240000 102.806122,24.991196,3893.8200001absolute102.806122,24.991196,3893.820000 102.807411,24.984833,3977.6400001absolute102.807411,24.984833,3977.640000 102.809853,24.978115,4061.4600001absolute102.809853,24.978115,4061.460000 102.813667,24.971054,4099.5600001absolute102.813667,24.971054,4099.560000 102.817993,24.965561,4152.9000001absolute102.817993,24.965561,4152.900000 102.825264,24.958374,4221.4800001absolute102.825264,24.958374,4221.480000 102.830658,24.954025,4251.9600001absolute102.830658,24.954025,4251.960000 102.839600,24.948042,4297.6800001absolute102.839600,24.948042,4297.680000 102.847595,24.943680,4358.6400001absolute102.847595,24.943680,4358.640000 102.855736,24.939972,4419.6000001absolute102.855736,24.939972,4419.600000 102.863853,24.936638,4488.1800001absolute102.863853,24.936638,4488.180000 102.872299,24.933100,4564.3800001absolute102.872299,24.933100,4564.380000 102.881012,24.929306,4632.9600001absolute102.881012,24.929306,4632.960000 102.888847,24.925873,4701.5400001absolute102.888847,24.925873,4701.540000 102.936760,24.904449,5166.3600001absolute102.936760,24.904449,5166.360000 102.991127,24.879519,5562.6000001absolute102.991127,24.879519,5562.600000 103.092850,24.833990,6080.7600001absolute103.092850,24.833990,6080.760000 103.134102,24.812716,6309.3600001absolute103.134102,24.812716,6309.360000 103.140869,24.807175,6347.4600001absolute103.140869,24.807175,6347.460000 103.142288,24.805872,6355.0800001absolute103.142288,24.805872,6355.080000 103.147575,24.800518,6431.2800001absolute103.147575,24.800518,6431.280000 103.160858,24.781403,6507.4800001absolute103.160858,24.781403,6507.480000 103.164780,24.773191,6553.2000001absolute103.164780,24.773191,6553.200000 103.168739,24.764236,6614.1600001absolute103.168739,24.764236,6614.160000 103.172455,24.755493,6659.8800001absolute103.172455,24.755493,6659.880000 103.175606,24.748077,6705.6000001absolute103.175606,24.748077,6705.600000 103.219048,24.654922,7277.1000001absolute103.219048,24.654922,7277.100000 103.226662,24.645639,7330.4400001absolute103.226662,24.645639,7330.440000 103.233490,24.637527,7360.9200001absolute103.233490,24.637527,7360.920000 103.241119,24.628555,7421.8800001absolute103.241119,24.628555,7421.880000 103.248940,24.620129,7475.2200001absolute103.248940,24.620129,7475.220000 103.266098,24.604208,7574.2800001absolute103.266098,24.604208,7574.280000 103.388268,24.517731,8168.6400001absolute103.388268,24.517731,8168.640000 103.523239,24.456219,8679.1800001absolute103.523239,24.456219,8679.180000 103.559044,24.439739,8801.1000001absolute103.559044,24.439739,8801.100000 108.971939,23.690340,8869.6800001absolute108.971939,23.690340,8869.680000 109.106262,23.682100,8877.3000001absolute109.106262,23.682100,8877.300000 109.257454,23.655533,8869.6800001absolute109.257454,23.655533,8869.680000 109.400940,23.626373,8869.6800001absolute109.400940,23.626373,8869.680000 109.540199,23.597946,8869.6800001absolute109.540199,23.597946,8869.680000 109.678093,23.569702,8869.6800001absolute109.678093,23.569702,8869.680000 109.817787,23.540955,8869.6800001absolute109.817787,23.540955,8869.680000 109.957016,23.512024,8869.6800001absolute109.957016,23.512024,8869.680000 110.097191,23.482864,8869.6800001absolute110.097191,23.482864,8869.680000 110.235718,23.453979,8869.6800001absolute110.235718,23.453979,8869.680000 110.374756,23.426250,8869.6800001absolute110.374756,23.426250,8869.680000 110.513969,23.403809,8869.6800001absolute110.513969,23.403809,8869.680000 110.638763,23.383530,8869.6800001absolute110.638763,23.383530,8869.680000 110.654600,23.380950,8869.6800001absolute110.654600,23.380950,8869.680000 110.677240,23.377230,8869.6800001absolute110.677240,23.377230,8869.680000 110.689400,23.375240,8869.6800001absolute110.689400,23.375240,8869.680000 110.700740,23.373370,8869.6800001absolute110.700740,23.373370,8869.680000 110.724660,23.369480,8869.6800001absolute110.724660,23.369480,8869.680000 110.731900,23.368290,8869.6800001absolute110.731900,23.368290,8869.680000 110.735540,23.367690,8869.6800001absolute110.735540,23.367690,8869.680000 110.737820,23.367320,8869.6800001absolute110.737820,23.367320,8869.680000 110.744580,23.366180,8869.6800001absolute110.744580,23.366180,8869.680000 110.746820,23.365830,8869.6800001absolute110.746820,23.365830,8869.680000 110.751340,23.365080,8869.6800001absolute110.751340,23.365080,8869.680000 110.771280,23.361820,8869.6800001absolute110.771280,23.361820,8869.680000 110.783030,23.359870,8869.6800001absolute110.783030,23.359870,8869.680000 110.794780,23.357910,8869.6800001absolute110.794780,23.357910,8869.680000 110.806950,23.355930,8869.6800001absolute110.806950,23.355930,8869.680000 110.828680,23.352360,8869.6800001absolute110.828680,23.352360,8869.680000 110.840420,23.350430,8869.6800001absolute110.840420,23.350430,8869.680000 110.850830,23.348740,8869.6800001absolute110.850830,23.348740,8869.680000 110.885360,23.358120,8237.2200001absolute110.885360,23.358120,8237.220000 110.896150,23.357440,7597.1400001absolute110.896150,23.357440,7597.140000 110.905430,23.356610,6781.8000001absolute110.905430,23.356610,6781.800000 110.915920,23.352630,5280.6600001absolute110.915920,23.352630,5280.660000 110.924320,23.344740,4671.0600001absolute110.924320,23.344740,4671.060000 110.944390,23.323100,3878.5800001absolute110.944390,23.323100,3878.580000 110.955920,23.317110,3352.8000001absolute110.955920,23.317110,3352.800000 110.969490,23.314200,2788.9200001absolute110.969490,23.314200,2788.920000 110.983380,23.314900,2392.6800001absolute110.983380,23.314900,2392.680000 111.014760,23.307730,2263.1400001absolute111.014760,23.307730,2263.140000 111.028750,23.309400,2446.0200001absolute111.028750,23.309400,2446.020000 111.040410,23.309740,2621.2800001absolute111.040410,23.309740,2621.280000 111.063889,23.327911,2766.0600001absolute111.063889,23.327911,2766.060000 111.074680,23.330310,2491.7400001absolute111.074680,23.330310,2491.740000 111.086357,23.333084,1988.8200001absolute111.086357,23.333084,1988.820000 111.097540,23.335330,1333.5000001absolute111.097540,23.335330,1333.500000 111.105580,23.337520,982.980000 \ No newline at end of file