gnsstools

module
v0.39.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2026 License: Apache-2.0

README

GNSS Tools

GoDoc

This repository contains a Golang module with packages for working with data types related to GNSS (Global Navigation Satellite System). It includes support for serialization and deserialization of GNSS data in various formats (e.g., BINEX, RINEX, RTCM, ...), as well as utility functions for handling GNSS-specific computations. Additionally, the repository provides several command-line utilities for interacting with GNSS data.

├── LICENSE
├── README.md
├── cmd
├── go.mod
├── go.sum
└── pkg

Packages

Common
  • gnss: Core GNSS data types
Encoding
  • binex: BINEX deserialization.
  • bottle: Bottle deserialization.
  • fcn: Functions for retreiving GLONASS Fequency Channel Numbers.
  • met: Meteorologic data serialization and deserialization.
  • novatel: NovAtel receiver format deserialization.
  • pos: EarthScope's daily integrated position solution format.
  • rinex: RINEX format serialization and deserialization.
  • rtcm: RTCM3 serialization and deserialization.
  • sbf: Septentrio Binary Format (SBF) serialization and deserialization.
  • sinex: SINEX deserialization (todo).
  • sp3: SP3 deserialization.
  • tdb: TileDB serialization and deserialization.
  • ublox: U-Blox serialization and deserialization.
  • vaisala: Vaisala weather data deserialization.
Supported RINEX Message Types
Message Type Description Deserialization Serialization
RINEX 2.11 Obs GNSS Observations ✅ Supported ✅ Supported
RINEX 2.11 Nav GNSS Observations ✅ Supported ✅ Supported
RINEX 2.11 Met GNSS Observations ✅ Supported 📝 To Do
RINEX 3.05 Obs GNSS Observations ✅ Supported ✅ Supported
RINEX 3.05 Nav GNSS Observations ✅ Supported ✅ Supported
RINEX 3.05 Met GNSS Observations ✅ Supported 📝 To Do
RINEX 4.01 Obs GNSS Observations ✅ Supported ✅ Supported
RINEX 4.01 Nav GNSS Navigation ✅ Supported ✅ Supported
RINEX 4.01 Met GNSS Meteorological ✅ Supported 📝 To Do
RINEX 4.02 Obs GNSS Observations ✅ Supported ✅ Supported
RINEX 4.02 Nav GNSS Navigation ✅ Supported ✅ Supported
RINEX 4.02 Met GNSS Meteorological ✅ Supported 📝 To Do
Supported BINEX Message Types
Message Type Description Deserialization Serialization
0x00 Metadata 🚧 Under Construction 📝 To Do
0x01-00 Ephemeris 📝 To Do 📝 To Do
0x01-01 Ephemeris ✅ Supported 📝 To Do
0x01-02 Ephemeris ✅ Supported 📝 To Do
0x01-03 Ephemeris ✅ Supported 📝 To Do
0x01-04 Ephemeris 📝 To Do 📝 To Do
0x01-05 Ephemeris ✅ Supported 📝 To Do
0x01-06 Ephemeris ✅ Supported 📝 To Do
0x01-07 Ephemeris ✅ Supported 📝 To Do
0x01-14 Ephemeris ✅ Supported 📝 To Do
0x05 Position ✅ Supported 📝 To Do
0x7d-00 Receiver State ✅ Supported 📝 To Do
0x7e-00 Ancillary Site Data ✅ Supported 📝 To Do
0x7e-01 Ancillary Site Data ✅ Supported 📝 To Do
0x7f-00 Observable Data 📝 To Do 📝 To Do
0x7f-01 Observable Data 📝 To Do 📝 To Do
0x7f-02 Observable Data 📝 To Do 📝 To Do
0x7f-03 Observable Data ✅ Supported 📝 To Do
0x7f-04 Observable Data 📝 To Do 📝 To Do
0x7f-05 Observable Data ✅ Supported 📝 To Do
Supported Septentrio Binary Format (SBF) Message Types
Message Type Description Deserialization Serialization
4001 DOP ✅ Supported ✅ Supported
4002 GALNav ✅ Supported ✅ Supported
4006 PVTCartesian ✅ Supported ✅ Supported
4007 PVTGeodetic ✅ Supported ✅ Supported
4008 PVTSatCartesian ✅ Supported ✅ Supported
4011 RAIMStatistics ✅ Supported ✅ Supported
4012 SatVisibility ✅ Supported ✅ Supported
4013 ChannelStatus ✅ Supported ✅ Supported
4014 ReceiverStatus ✅ Supported ✅ Supported
4027 MeasEpoch ✅ Supported ✅ Supported
4044 PosCart ✅ Supported ✅ Supported
4075 ASCIIIn ✅ Supported ✅ Supported
5891 GPSNav ✅ Supported ✅ Supported
5914 ReceiverTime ✅ Supported ✅ Supported
Supported RTCM 3 Message Types
Message Type Description Deserialization Serialization
1077 GPS MSM 7 ✅ Supported ✅ Supported
1087 GLONASS MSM 7 ✅ Supported ✅ Supported
1097 Galileo MSM 7 ✅ Supported ✅ Supported
1107 SBAS MSM 7 ✅ Supported ✅ Supported
1117 QZSS MSM 7 ✅ Supported ✅ Supported
1127 Beidou MSM 7 ✅ Supported ✅ Supported
Supported Novatel Binary Message Types
Message Type Description Deserialization Serialization
140 RANGECMP ✅ Supported 📝 To Do
Supported U-blox Binary Message Types
Message Type Description Deserialization Serialization
ubx-rxm-rawx GNSS Raw Observation Data ✅ Supported ✅ Supported
NTRIP

| Package | Description | Support | | 'client' | NTRIP 2.0 Client | ✅ Supported |

Position
Package Description Support
ssp Single Point Positioning ✅ Supported
PubSub
Package Description Support
pubsub Implements publish-subscribe mechanisms for GNSS data. ✅ Supported
Velocity
Package Description Support
tdcp Time-Differenced Carrier Phase (TDCP) velocity estimation ✅ Supported

Command-Line Tools

The cmd directory contains command-line tools for working with supported GNSS data formats. Each subdirectory under cmd represents a different tool.

Available Tools
Tool Description Status
gnss-inspect Inspect and analyze GNSS data in various formats with JSON output ✅ Active
gnss-convert Convert GNSS data between formats (RINEX to Parquet/TileDB) ✅ Active
ntrip-client NTRIP client for connecting to NTRIP casters ✅ Active
ntrip NTRIP server tools and utilities ✅ Active
position Single Point Positioning (SPP) tools ✅ Active
velocity Time-Differenced Carrier Phase (TDCP) velocity estimation ✅ Active
translation Format translation utilities ✅ Active
tiledb TileDB-specific tools and utilities ✅ Active
test Testing and validation tools ✅ Active
gnss-inspect

A powerful tool for inspecting and analyzing GNSS data in various formats. Outputs detailed JSON for easy parsing and analysis.

Features:

  • Supports 12+ GNSS formats (BINEX, RINEX, SBF, RTCM3, U-blox, NovAtel, etc.)
  • JSON output for easy scripting and data analysis
  • Network streaming support (BINEX)
  • Cross-platform compatibility

Quick Start:

# Inspect RINEX observation file
gnss-inspect rnx --file data.25o

# Inspect BINEX with network streaming
gnss-inspect binex --host localhost:2101

# Filter GPS observations only
gnss-inspect rnx --file data.25o | jq 'select(.System == "GPS")'

Supported Formats:

  • BINEX: Binary Exchange format with TCP streaming
  • RINEX: Observation, Navigation, and Meteorological files (v2.11, v3.05, v4.02)
  • SBF: Septentrio Binary Format
  • RTCM3: Real-time correction messages
  • U-blox: Binary and serial formats
  • NovAtel: ASCII and binary formats
  • SP3: Precise ephemeris
  • Bottle: UNAVCO bottle format
  • FCN: GLONASS Frequency Channel Numbers

See the gnss-inspect README for complete documentation.

gnss-convert

Convert GNSS data from RINEX to modern data formats like Apache Parquet and TileDB.

Features:

  • RINEX to Parquet conversion with Hive partitioning
  • RINEX to TileDB conversion
  • Cloud-native S3 support
  • Session-based data organization

Quick Start:

# Convert RINEX to TileDB on S3
gnss-convert convert --input rinex:./data.25o --output tiledb:s3://bucket/path

# Convert RINEX to Parquet locally
gnss-convert convert --input rinex:./data.25o --output parquet:./output

See the gnss-convert README for complete documentation.

ntrip-client

Connect to NTRIP casters and stream GNSS correction data.

Features:

  • NTRIP 1.0/2.0 client support
  • TLS/SSL encryption support
  • Automatic reconnection
  • Configurable authentication
  • Real-time data streaming

Quick Start:

# Connect to NTRIP caster
ntrip-client connect --host caster.example.com:2101 --user user --pass pass --mountpoint MOUNT

# Connect with TLS
ntrip-client connect --host caster.example.com:443 --user user --pass pass --mountpoint MOUNT --tls

# Get source table
ntrip-client srctab --host caster.example.com:2101 --user user --pass pass

See the ntrip-client README for complete documentation.

Installation

go get gitlab.com/earthscope/gnsstools

Testing

Prerequisites

Some tests require TileDB. TileDB must be installed either:

  • System-wide in /usr/local/lib (default)
  • In the project directory at cmd/gnss-convert/tiledb/lib
  • Or you can use the setup script to download it automatically
Running Tests

First-time setup (recommended for new clones):

# Automatically detects TileDB location, downloads if needed, and runs tests
./scripts/test-setup.sh

If TileDB is already installed (system-wide or project-local):

# Run all tests (assumes TileDB is in /usr/local/lib)
make test

# Run short tests only
make test-short

Manual setup (if TileDB is in /usr/local/lib):

# Set environment variables for system TileDB installation
export CGO_CPPFLAGS="-I/usr/local/include"
export CGO_LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
go test ./...

Direct go test (requires manual environment setup):

# Run all tests
go test ./...

# Run specific package tests
go test ./pkg/encoding/rtcm/rtcm3/...

# Run tests with verbose output
go test -v ./...
Troubleshooting

"Library not loaded: @rpath/libtiledb.dylib"

This error occurs when TileDB is not found or CGO_LDFLAGS is not set. Solutions:

  1. Use the setup script (recommended for first-time setup):

    ./scripts/test-setup.sh
    

    This will automatically detect TileDB, download it if needed, and run tests.

  2. Use the Makefile (if TileDB is already installed):

    make test
    
  3. Set environment variables manually:

    export CGO_CPPFLAGS="-I/usr/local/include"
    export CGO_LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
    go test ./...
    
  4. Install TileDB system-wide:

    cd cmd/gnss-convert && make install-tiledb-system
    
  5. Download TileDB to project directory:

    cd cmd/gnss-convert && make tiledb-setup
    

Alternative: Use DYLD_LIBRARY_PATH (macOS only, not recommended)

# macOS
export DYLD_LIBRARY_PATH="/usr/local/lib:$DYLD_LIBRARY_PATH"
go test ./...

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (C) 2023 Henry Berglund, EarthScope Data Services

Directories

Path Synopsis
cmd
gnss-convert command
gnss-inspect command
gnss-process command
ntrip-client command
rinex-splitter command
test-spp command
test/misc/cddis command
tiledb/bnx2tile command
pkg
common/coordinates
Package coordinates provides functions for coordinate transformations between geodetic, ECEF, ENU, and body frames, including ionospheric pierce point calculations.
Package coordinates provides functions for coordinate transformations between geodetic, ECEF, ENU, and body frames, including ionospheric pierce point calculations.
common/gnss/sun
Package sun provides a low-precision Sun position calculator in ECEF coordinates.
Package sun provides a low-precision Sun position calculator in ECEF coordinates.
encoding/antex
Package antex provides reading and writing of ANTEX (Antenna Exchange) format files.
Package antex provides reading and writing of ANTEX (Antenna Exchange) format files.
encoding/sitelog
package sitelog handles a GNSS site with its antenna, receiver etc.
package sitelog handles a GNSS site with its antenna, receiver etc.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL