Convert GPX to CZML

gpx2czml

A package to convert .gpx file data to .czml file data for use with the Cesium ecosystem

Usage

import (
	"io/ioutil"
	"os"

	"github.com/cocncannon/czml"
	"github.com/cconcannon/gpx"
	"github.com/cconcannon/gpx2czml"
)
// use a package to unmarshal GPX data from the XML file
// i.e. [github.com/cconcannon/gpx](https://github.com/cconcannon/gpx)

file, err := os.Open("input.xml")
data, err := ioutil.ReadAll(file)

if err != nil {
	fmt.Println(err)
	return
}

var g gpx.Gpx
err = gpx.Unmarshal(data, &g)

// transform the data from GPX to CZML properties
// Polyline is just one type of valid material to use

c := gpx2czml.CreatePolyline("abc123-packet-id", "Packet Name", g)

// write the data to file using a package to marshal CZML data to JSON
// i.e [github.com/cconcannon/czml](https://github.com/cconcannon/czml)

transform, err := czml.Marshal(c)

if err != nil {
	fmt.Println(err)
}

ioutil.WriteFile("output.czml", transform, 0644)

Dependencies

I created these two Go modules to handle the .gpx and .czml data interfaces that are required for the conversion:

Owner
Chris Concannon
Sr. Solutions Engineer @ Okta
Chris Concannon
Similar Resources

Convert Golang Struct To GraphQL Object On The Fly

Straf Convert Golang Struct To GraphQL Object On The Fly Easily Create GraphQL Schemas Example Converting struct to GraphQL Object type UserExtra stru

Oct 26, 2022

⚙️ Convert HTML to Markdown. Even works with entire websites and can be extended through rules.

⚙️ Convert HTML to Markdown. Even works with entire websites and can be extended through rules.

html-to-markdown Convert HTML into Markdown with Go. It is using an HTML Parser to avoid the use of regexp as much as possible. That should prevent so

Jan 6, 2023

Convert xml and json to go struct

xj2go The goal is to convert xml or json file to go struct file. Usage Download and install it: $ go get -u -v github.com/wk30/xj2go/cmd/... $ xj [-t

Oct 23, 2022

Convert Go values to their AST

valast - convert Go values to their AST Valast converts Go values at runtime into their go/ast equivalent,

Dec 21, 2022

Convert scanned image PDF file to text annotated PDF file

Convert scanned image PDF file to text annotated PDF file

Jisui (自炊) This tool is PoC (Proof of Concept). Jisui is a helper tool to create e-book. Ordinary the scanned book have not text information, so you c

Dec 11, 2022

Convert data exports from various services to a single SQLite database

Convert data exports from various services to a single SQLite database

Bionic Bionic is a tool to convert data exports from web apps to a single SQLite database. Bionic currently supports data exports from Google, Apple H

Dec 9, 2022

Convert Microsoft Word Document to Markdown

Convert Microsoft Word Document to Markdown

docx2md Convert Microsoft Word Document to Markdown Usage $ docx2md NewDocument.docx Installation $ go get github.com/mattn/docx2md Supported Styles

Jan 4, 2023

convert sql to elasticsearch DSL in golang(go)

_____ _ _ ____ _____ ___ ____ ____ ___ _ | ____| | / \ / ___|_ _|_ _|/ ___|/ ___| / _ \ | | | _| | | / _ \ \___ \ |

Jan 7, 2023

A cross-platform tool to convert images into ascii art and print them on the console

A cross-platform tool to convert images into ascii art and print them on the console

A cross-platform tool to convert images into ascii art and print them on the console

Dec 30, 2022

Convert images to computer generated art using delaunay triangulation.

Convert images to computer generated art using delaunay triangulation.

▲ Triangle is a tool for generating triangulated image using delaunay triangulation. It takes a source image and converts it to an abstract image comp

Dec 29, 2022

Floppa programming language inspired by the brainf*ck programming language. Created just for fun and you can convert your brainf*ck code to floppa code.

Floppa Programming Language Created just for fun. But if you want to contribute, why not? Floppa p.l. inspired by the brainf*ck programming language.

Oct 20, 2022

word2text - a tool is to convert word documents (DocX) to text on the CLI with zero dependencies for free

word2text - a tool is to convert word documents (DocX) to text on the CLI with zero dependencies for free

This tool is to convert word documents (DocX) to text on the CLI with zero dependencies for free. This tool has been tested on: - Linux 32bit and 64 bit - Windows 32 bit and 64 bit - OpenBSD 64 bit

Apr 19, 2021

Dredger is a utility to help convert helm charts to Terraform modules using kubernetes provider.

dredger Dredger is a utility to help convert helm charts to Terraform modules using kubernetes provider. Dredger is made of dark magic and cannot full

Aug 25, 2022

Convert various benchmarking formats to benchfmt

benchfmt-convert This repo contains tools for converting various formats to benchfmt for use with benchstat. Most useful is github.com/prattmic/benchf

Sep 17, 2021

A solution to convert PDFs into audiobooks (offline).

A solution to convert PDFs into audiobooks (offline). This solution kit consists of an Opentts engine hosted on docker and a CLI client that parses the given PDF file for text content & connects with Opentts to generate audio files.

Dec 28, 2022

CLI tool (hcron) and Go library (cron) to convert CRON expression into human readable description.

cron cron is a Go library that parses a cron expression and outputs a human readable description of the cron schedule. For example, given the expressi

Nov 12, 2022

Convert SSH Ed25519 keys to age keys. This is useful for usage in sops-nix and sops

ssh-to-age Convert SSH Ed25519 keys to age keys. This is useful for usage in sops-nix and sops Usage Exports the private key: $ ssh-to-age -private-ke

Dec 21, 2022

Simple tool to handle hosts file black lists that can remove comments, remove duplicates, compress to 9 domains per line, add IPv6 entries, as well as can convert black lists to multiple other black list formats compatible with other software.

Hosts-BL Simple tool to handle hosts file black lists that can remove comments, remove duplicates, compress to 9 domains per line, add IPv6 entries, a

Sep 23, 2022

Shellcode implementation of Reflective DLL Injection by Golang. Convert DLLs to position independent shellcode

Shellcode implementation of Reflective DLL Injection by Golang. Convert DLLs to position independent shellcode

🐸 Frog For Automatic Scan 🐶 Doge For Defense Evasion&Offensive Security Doge-sRDI Shellcode implementation of Reflective DLL Injection by Golang. Co

Dec 8, 2022
A solution to convert PDFs into audiobooks (offline).

A solution to convert PDFs into audiobooks (offline). This solution kit consists of an Opentts engine hosted on docker and a CLI client that parses the given PDF file for text content & connects with Opentts to generate audio files.

Dec 28, 2022
A tool to convert markdown to html.

mdconv A tool to convert markdown files to html files. Usage md2html -i <md-file> -o <html-file> Options supported -i - specify the input markdown fil

Oct 12, 2022
Convert document to pdf with golang

Convert document to pdf Build docker: docker build --pull --rm -f "Dockerfile" -t convertdocument:latest "." docker run -p 3000:3000 registry.gitlab.

Nov 29, 2021
Read data from rss, convert in pdf and send to kindle. Amazon automatically convert them in azw3.

Kindle-RSS-PDF-AZW3 The Kindle RSS PDF AZW3 is a personal project. The Kindle RSS PDF AZW3 is a personal project. I received a Kindle for Christmas, a

Jan 10, 2022
timestamp convert & compare tool. 时间戳转换与对比工具

ts timestamp convert & compare tool Install Shell Install support Linux & MacOS # binary will be $(go env GOPATH)/bin/ts $: curl -sfL https://raw.gith

Sep 26, 2022
Query, update and convert data structures from the command line. Comparable to jq/yq but supports JSON, TOML, YAML, XML and CSV with zero runtime dependencies.
Query, update and convert data structures from the command line. Comparable to jq/yq but supports JSON, TOML, YAML, XML and CSV with zero runtime dependencies.

dasel Dasel (short for data-selector) allows you to query and modify data structures using selector strings. Comparable to jq / yq, but supports JSON,

Jan 2, 2023
Convert string to duration in golang

Go String To Duration (go-str2duration) This package allows to get a time.Duration from a string. The string can be a string retorned for time.Duratio

Dec 7, 2022
:foggy: Convert image to ASCII
:foggy: Convert image to ASCII

?? Image2ascii Image2ASCII is a library that converts images into ASCII images and provides command-line tools for easy use. Installation go get githu

Jan 8, 2023
Convert struct, slice, array, map or others for Golang

XConv zh-CN XConv is a golang type convertor. It convert any value between types (base type, struct, array, slice, map, etc.) Features Convert between

Dec 8, 2022
Query, update and convert data structures from the command line. Comparable to jq/yq but supports JSON, TOML, YAML, XML and CSV with zero runtime dependencies.
Query, update and convert data structures from the command line. Comparable to jq/yq but supports JSON, TOML, YAML, XML and CSV with zero runtime dependencies.

dasel Dasel (short for data-selector) allows you to query and modify data structures using selector strings. Comparable to jq / yq, but supports JSON,

Jan 2, 2023