update README
Create standalone library
Forked from (https://github.com/tkrajina/gpxgo) under the terms of the Apache 2.0 license. Improvements were made to reduce memory consumption and implement GPX to/from GeoJSON conversions, to clean up and simplify dirty GPX tracks on import, and to provide a more idiomatic API.
A library for parsing and manipulating GPX files. GPX (GPS eXchange Format) is a XML based file format for GPS track logs.
import (
"git.sr.ht/~scooter/gpx"
)
gpxBytes := ...
gpxFile, err := gpx.ParseBytes(gpxBytes)
if err != nil {
...
}
// Analyize/manipulate your track data here...
for _, track := range gpxFile.Tracks {
for _, segment := range track.Segments {
for _, point := range segment.Points {
fmt.Print(point)
}
}
}
// (Check the API for GPX manipulation and analyzing utility methods)
// When ready, you can write the resulting GPX file:
xmlBytes, err := gpxFile.ToXml(gpx.ToXmlParams{Version: "1.1", Indent: true})
...
Compatible with GPX 1.0 and GPX 1.1 files for basic features of the GPX spec. GPX 1.1 extensions are not yet supported.
Based on:
Licensed under the Apache License, Version 2.0