• Stars
    star
    37
  • Rank 720,807 (Top 15 %)
  • Language
    Go
  • License
    MIT License
  • Created over 8 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Package gpx provides convenience types for reading and writing GPX files.

go-gpx

GoDoc

Package gpx provides convenince methods for reading and writing GPX documents.

Read example

r := bytes.NewBufferString(`
    <?xml version="1.0" encoding="UTF-8"?>
    <gpx version="1.0" creator="ExpertGPS 1.1 - http://www.topografix.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/0" xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
        <wpt lat="42.438878" lon="-71.119277">
        <ele>44.586548</ele>
        <time>2001-11-28T21:05:28Z</time>
        <name>5066</name>
        <desc>5066</desc>
        <sym>Crossing</sym>
        <type>Crossing</type>
        </wpt>
    </gpx>
`)
t, err := gpx.Read(r)
if err != nil {
    fmt.Printf("err == %v", err)
    return
}
fmt.Printf("t.Wpt[0] == %+v", t.Wpt[0])
// Output:
// t.Wpt[0] == &{Lat:42.438878 Lon:-71.119277 Ele:44.586548 Time:2001-11-28 21:05:28 +0000 UTC MagVar:0 GeoidHeight:0 Name:5066 Cmt: Desc:5066 Src: Link:[] Sym:Crossing Type:Crossing Fix: Sat:0 HDOP:0 VDOP:0 PDOP:0 AgeOfDGPSData:0 DGPSID:[] Extensions:<nil>}

Write example

g := &gpx.GPX{
    Version: "1.0",
    Creator: "ExpertGPS 1.1 - http://www.topografix.com",
    Wpt: []*gpx.WptType{
        {
            Lat:  42.438878,
            Lon:  -71.119277,
            Ele:  44.586548,
            Time: time.Date(2001, 11, 28, 21, 5, 28, 0, time.UTC),
            Name: "5066",
            Desc: "5066",
            Sym:  "Crossing",
            Type: "Crossing",
        },
    },
}
if _, err := os.Stdout.WriteString(xml.Header); err != nil {
    fmt.Printf("err == %v", err)
}
if err := g.WriteIndent(os.Stdout, "", "  "); err != nil {
    fmt.Printf("err == %v", err)
}
// Output:
// <?xml version="1.0" encoding="UTF-8"?>
// <gpx version="1.0" creator="ExpertGPS 1.1 - http://www.topografix.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/0" xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
//   <wpt lat="42.438878" lon="-71.119277">
//     <ele>44.586548</ele>
//     <time>2001-11-28T21:05:28Z</time>
//     <name>5066</name>
//     <desc>5066</desc>
//     <sym>Crossing</sym>
//     <type>Crossing</type>
//   </wpt>
// </gpx>

License

MIT

More Repositories

1

chezmoi

Manage your dotfiles across multiple diverse machines, securely.
Go
13,267
star
2

go-geom

Package geom implements efficient geometry types for geospatial applications.
Go
848
star
3

dotfiles

My dotfiles, managed with https://chezmoi.io.
Shell
304
star
4

go-jsonstruct

Generate Go structs from multiple JSON or YAML objects.
Go
298
star
5

go-polyline

Package polyline implements a Google Maps Encoding Polyline encoder and decoder.
Go
109
star
6

go-kml

Package kml provides convenience methods for creating and writing KML documents.
Go
88
star
7

go-vfs

Package vfs provides an abstraction of the os and io packages that is easy to test.
Go
81
star
8

go-geos

Package geos provides an interface to GEOS.
Go
80
star
9

go-xmlstruct

Generate Go structs from multiple XML documents.
Go
75
star
10

igc2kmz

IGC to Google Earth converter
Python
49
star
11

find-duplicates

Find duplicate files quickly.
Go
46
star
12

go-proj

Package proj provides an interface to proj.org.
Go
32
star
13

pgx-geos

Package pgx-geos provides PostGIS and GEOS support for github.com/jackc/pgx/v5 via github.com/twpayne/go-geos.
Go
26
star
14

webglmaps

Blows Leaflet out of the water (if you have a good computer)
JavaScript
24
star
15

gogeom

Geometry functions for Go
Go
21
star
16

paragliding-articles

20
star
17

go-shapefile

Package shapefile provides a native Go reader for ESRI Shapefiles.
Go
19
star
18

go-mbtiles

Package mbtiles reads and writes files in the MBTiles format.
Go
17
star
19

go-svg

Package svg provides convenience methods for creating and writing SVG documents.
Go
17
star
20

go-pinentry

Package pinentry provides a client to GnuPG's pinentry.
Go
16
star
21

flatjson

flatjson converts JSON files to a "flat" representation with one value per line.
Go
15
star
22

flightrecorder

Download tracklogs and upload waypoints for popular flight recorders on UNIX-like operating systems
Python
12
star
23

g-record

IGC g-record signing proof of concept
C
11
star
24

pgx-geom

Package pgx-geom provides PostGIS support for github.com/jackc/pgx/v5 via github.com/twpayne/go-geom.
Go
11
star
25

osm-extract

Extract features from OpenStreetMap PBF files as GeoJSON.
Go
10
star
26

go-darksky

Package darksky implements a client for the Dark Sky API. See https://darksky.net/dev.
Go
9
star
27

go-sse

Package sse implements a Server-Sent Events server.
Go
8
star
28

gopolyline

Google Maps polyline encoding and decoding for Go
Go
8
star
29

go-doarama

Go client library for the Doarama GPS track visualizer
Go
8
star
30

go-pubsub

Package pubsub is a simple publish-subscribe implementation using generics.
Go
7
star
31

find-typos

Find typos.
Go
6
star
32

gpsbabel-flytec

Brauniger/Flytec support for GPSBabel
C
6
star
33

go-meteomatics

Package meteomatics is a client library for the Meteomatics API.
Go
6
star
34

go-shell

Package shell returns the user's shell across multiple platforms.
Go
6
star
35

webgl-utils

Python
6
star
36

go-heap

Package heap implements a generic heap data structure.
Go
6
star
37

go-geobabel

Package geobabel converts geometry types between popular geometry libraries.
Go
6
star
38

go-pinentry-minimal

A version of github.com/twpayne/go-pinentry with minimal dependencies.
Go
5
star
39

go-xdg

Package xdg provides support for the XDG Base Directory Specification.
Go
5
star
40

maxxc

Cross country flight optimiser
C
5
star
41

scoop-bucket

Scoop bucket, see https://scoop.sh.
5
star
42

go-waypoint

Package waypoint reads and writes waypoints in formats used by the free flying community.
Go
4
star
43

vim-igc

VIM syntax highlighting for IGC files
Vim Script
4
star
44

igcscrape

Scrape IGC tracklogs from XC leagues
Python
4
star
45

waypointviewer

Google Maps/Google App Engine application for displaying waypoints
JavaScript
4
star
46

nagios-plugin-bacula

A Nagios plugin for checking Bacula client backups
Python
4
star
47

vscode-testscript

testscript support for Visual Studio Code
3
star
48

libselinux-ruby-puppet

The minimal SELinux bindings for Ruby required to run puppet
C
3
star
49

go-kmz

Package kmz provides convenience methods for creating and writing KMZ files.
Go
3
star
50

nagios-plugin-xserve_raid

A Nagios plugin for checking Apple Xserve RAIDs
Python
3
star
51

forge

A simple utility to clone and open local and remote git repos.
Go
3
star
52

go-xctrack

Package xctrack implements XCTrack's task format.
Go
3
star
53

openlayers-googleearthview

OpenLayers Control to link an OpenLayers map to a Google Earth plugin
JavaScript
3
star
54

go-igc

Package igc handles IGC files.
Go
3
star
55

xcscore-js

Cross country league flight scoring for paragliding
TypeScript
2
star
56

go-affine2d

Package affine2d implements 2D affine transformations.
Go
2
star
57

flytecfs

Userspace filesystem for Flytec and Brauniger flight recorders
Python
2
star
58

ol3-under-the-hood

OpenLayers 3 Under The Hood talk
JavaScript
2
star
59

go-lazy

Package lazy implements lazily-evaluated values.
Go
2
star
60

vim-testscript

VIM syntax highlighting for github.com/rogpeppe/go-internal/testscript
Vim Script
2
star
61

go-fanet

Package fanet generates and parses FANET sentences.
Go
2
star
62

go-vali

Package go-vali implements an API to the FAI's Open Validation Service.
Go
2
star
63

igc2kmz.rb

IGC to Google Earth converter (depreciated Ruby version)
Ruby
2
star
64

netcf-ruby

Ruby bindings for NetCF
C
2
star
65

devfest-zurich2012-whats-hot-on-google-plus

Visualize Google+ posts in a heatmap on Google Maps via Google FusionTables (hosted on Google Drive)
Python
2
star
66

go-serial

Package serial handles serial ports.
Go
2
star
67

gopher-advent-2022-hot-function

Code for my Gopher Advent articles.
Go
2
star
68

tcx2kmz

Garmin Training Center Database to Google Earth converter
Python
2
star
69

python-columnparser

A Python library for parsing columnar tables
Python
2
star
70

aircotini

Download tracklogs from Aircotec flight recorders
1
star
71

pnggrid

Python
1
star
72

vscode-igc

IGC file support for Visual Studio Code.
CUE
1
star
73

tini

Download tracklogs from Brauniger and Flytec flight recorders
C
1
star
74

iripper

Command line interface to the BBC's iPlayer
1
star
75

github-cli

A minimal CLI for making GitHub API calls.
Go
1
star
76

garmini

Download IGC tracklogs from Garmin GPSs
C
1
star
77

go-openaip

Package openaip decodes http://www.openaip.net/ airspace files.
Go
1
star
78

igc2czml

IGC to CZML file converter
Python
1
star
79

closure-toy

Toy project demonstrating Google's Closure tools
JavaScript
1
star
80

go-vfsbilly

Package vfsbilly provides a compatibility layer between github.com/twpayne/go-vfs and github.com/go-git/go-billy.
Go
1
star
81

map-toy

Supporting materials for the JavaScript Romandie talk on "Mapping with JavaScript"
1
star
82

dotfiles-example

Example chezmoi dotfiles
1
star
83

go-nmea

Package nmea parses NMEA sentences.
Go
1
star
84

go-httpd

A trivial HTTP server written in Go
Go
1
star
85

go-xxtea

Package xxtea implements the XXTEA block cipher.
Go
1
star