Created
February 26, 2021 01:13
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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