Skip to content

Instantly share code, notes, and snippets.

@dillten
Created February 26, 2021 01:13
Show Gist options
  • Save dillten/71722d0c4d4ae7ca61c709800d0609c8 to your computer and use it in GitHub Desktop.
Save dillten/71722d0c4d4ae7ca61c709800d0609c8 to your computer and use it in GitHub Desktop.
Quick and dirty JS for processing ForeFlight KML/GeoJSON properties into timestamps for kepler.gl
const fs = require('fs');
fs.readFile("input.geojson", function(err, data) {
if (err) throw err;
let track = JSON.parse(data);
for (let i = 0; i < track.features[0].geometry.coordinates.length; i++) {
let timestamp = Date.parse(track.features[0].properties.coordTimes[i])
track.features[0].geometry.coordinates[i][3] = timestamp
}
fs.writeFileSync('output.geojson',JSON.stringify(track))
console.log('done!')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment