1.0.4 • Published 2 years ago

gps-file-converter v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

GPS File Converter

About

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

Installation

With npm do:

$ npm install gps-file-converter

Dependencies

Basic usage

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)})

Documentation

Disclaimer

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.