~scooter/gpx

Go library for reading GPX files
c8c95a23 — Bryan Burke 1 year, 9 months ago
update README
5627166d — Bryan Burke 1 year, 9 months ago
Create standalone library

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~scooter/gpx
read/write
git@git.sr.ht:~scooter/gpx

You can also use your local clone with git send-email.

#Go GPX 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.

#Example:

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

#GPX Compatibility

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.

#History

Based on:

#License

Licensed under the Apache License, Version 2.0