Coder Social home page Coder Social logo

gpxgo's Introduction

Go GPX library

gpxgo is a golang library for parsing and manipulating GPX files. GPX (GPS eXchange Format) is a XML based file format for GPS track logs.

Example:

import (
    ...
    "github.com/tkrajina/gpxgo/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

Gpxgo can read/write both GPX 1.0 and GPX 1.1 files. The only not-yet-supported part of the GPX 1.1 specification are extensions.

gpxinfo

gpxinfo is a command line utility for writing basic stats from gpx files:

$ go run gpxinfo.go test_files/Mojstrovka.gpx
File: /Users/puzz/golang/src/github.com/tkrajina/gpxgo/test_files/Mojstrovka.gpx
GPX name:
GPX desctiption:
GPX version: 1.0
Author:
Email:


Global stats:
 Points: 184
 Length 2D: 2.6958067369682577
 Length 3D: 3.00439590990862
 Bounds: 46.430350, 46.435641, 13.738842, 13.748333
 Moving time: 0
 Stopped time: 0
 Max speed: 0.000000m/s = 0.000000km/h
 Total uphill: 446.4893280000001
 Total downhill: 417.65524800000026
 Started: 1901-12-13 20:45:52 +0000 UTC
 Ended: 1901-12-13 20:45:52 +0000 UTC


Track #1:
     Points: 184
     Length 2D: 2.6958067369682577
     Length 3D: 3.00439590990862
     Bounds: 46.430350, 46.435641, 13.738842, 13.748333
     Moving time: 0
     Stopped time: 0
     Max speed: 0.000000m/s = 0.000000km/h
     Total uphill: 446.4893280000001
...etc...

History

Gpxgo is based on:

License

gpxgo is licensed under the Apache License, Version 2.0

gpxgo's People

Contributors

tkrajina avatar ptrv avatar mlouielu avatar flopp avatar

Stargazers

Lord of Scripts ™ avatar

Watchers

James Cloos avatar Martha Augsburger avatar Gabriel Nelle avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.