var start = [122.191181,29.85273,666666]
var end = [
{
"lng": 122.503174,
"lat": 30.079061,
"altitude": 20
},
{
"lng": 122.412377,
"lat": 30.097221,
"altitude": 20
},
{
"lng": 122.267102,
"lat": 29.529741,
"altitude": 20
},
{
"lng": 122.60305,
"lat": 29.552441,
"altitude": 20
},
{
"lng": 122.235324,
"lat": 29.184714,
"altitude": 20
},
{
"lng": 122.080969,
"lat": 29.28913,
"altitude": 20
},
{
"lng": 122.503174,
"lat": 29.252812,
"altitude": 20
},
{
"lng": 122.385138,
"lat": 29.411706,
"altitude": 20
},
{
"lng": 122.471395,
"lat": 29.738574,
"altitude": 20
},
{
"lng": 122.149067,
"lat": 29.543361,
"altitude": 20
},
{
"lng": 122.076429,
"lat": 28.953182,
"altitude": 20
},
{
"lng": 121.881217,
"lat": 28.984961,
"altitude": 20
},
{
"lng": 121.804039,
"lat": 28.494659,
"altitude": 20
},
{
"lng": 121.826739,
"lat": 28.249508,
"altitude": 20
},
{
"lng": 122.185385,
"lat": 28.726191,
"altitude": 20
},
{
"lng": 122.435076,
"lat": 28.74435,
"altitude": 20
},
{
"lng": 122.8709,
"lat": 28.966802,
"altitude": 20
},
{
"lng": 123.084273,
"lat": 29.902008,
"altitude": 20
},
{
"lng": 122.8709,
"lat": 29.280051,
"altitude": 20
},
{
"lng": 122.61213,
"lat": 28.19957,
"altitude": 20
},
{
"lng": 121.940234,
"lat": 27.523135,
"altitude": 20
},
{
"lng": 121.372755,
"lat": 27.963499,
"altitude": 20
},
{
"lng": 121.254719,
"lat": 27.822764,
"altitude": 20
},
{
"lng": 121.858517,
"lat": 27.840923,
"altitude": 20
},
{
"lng": 121.804039,
"lat": 30.224336,
"altitude": 20
},
{
"lng": 121.990173,
"lat": 30.514885,
"altitude": 20
},
{
"lng": 121.835818,
"lat": 30.623841,
"altitude": 20
},
{
"lng": 121.531649,
"lat": 30.474027,
"altitude": 20
},
{
"lng": 121.440853,
"lat": 30.483106,
"altitude": 20
},
{
"lng": 122.485014,
"lat": 30.837214,
"altitude": 20
},
{
"lng": 122.59851,
"lat": 31.177701,
"altitude": 20
},
{
"lng": 122.952617,
"lat": 31.245799,
"altitude": 20
},
{
"lng": 123.279485,
"lat": 29.534281,
"altitude": 20
},
{
"lng": 123.397521,
"lat": 29.03036,
"altitude": 20
},
{
"lng": 123.265866,
"lat": 28.839687,
"altitude": 20
},
{
"lng": 123.15237,
"lat": 28.376624,
"altitude": 20
},
{
"lng": 122.911759,
"lat": 28.46742,
"altitude": 20
},
{
"lng": 122.639369,
"lat": 29.039439,
"altitude": 20
},
{
"lng": 122.643909,
"lat": 29.724954,
"altitude": 20
},
{
"lng": 122.307961,
"lat": 29.634158,
"altitude": 20
},
{
"lng": 122.362439,
"lat": 29.738574,
"altitude": 20
},
{
"lng": 122.085509,
"lat": 29.602379,
"altitude": 20
},
{
"lng": 121.436313,
"lat": 27.786445,
"altitude": 20
},
{
"lng": 120.896073,
"lat": 27.682029,
"altitude": 20
},
{
"lng": 120.846134,
"lat": 27.414179,
"altitude": 20
},
{
"lng": 122.230784,
"lat": 28.394783,
"altitude": 20
},
{
"lng": 122.825502,
"lat": 28.717111,
"altitude": 20
},
{
"lng": 122.907219,
"lat": 29.906548,
"altitude": 20
}
];
c= end.map((obj)=>{
return {
"geometry": {
"type": "LineString",
"coordinates": [
start,
[obj.lng,obj.lat,obj.altitude],
]
}
}
})
console.log(JSON.stringify(c));
console