gps-file-converter is a nodejs module that imports and exports geolocation files and strings. gps-file-converter is asynchronous when needed.
Supported formats are .gpx, .kml and GeoJSON
With npm do:
$ npm install gps-file-converter
Create an instance
const GFC = require('gps-file-converter')
const gfc = new GFC()
Then give it some input with in.gpx, a file of your choise...
gfc.importGeoFile('in.gpx')
.then(async(fileInfo) => {
console.log(fileInfo)
const content = gfc.getContent()
})
.catch(e => {console.log(e)})
Then you can for example export it as a .kml-file, out.kml
gfc.exportKML('out.kml')
.then(async() => {
console.log('Saved to disk')
})
.catch(e => {console.log(e)})
gps-file-converter only supports waypoints, tracks and metadata concerning that. In kml-files the Placemark has to be directly on the map or in the first Folder.