Skip to content

A simple command line tool for extracting latitude and longitude values from a NMEA encoded ascii file and store them into a single JSON file.

License

Notifications You must be signed in to change notification settings

physycom/nmea_to_json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

documentclass title author
physycomen
nmea_to_json
Di Cristina, Fabbri, Sinigardi
© Physics of Complex Systems Laboratory - Physics and Astronomy Department - University of Bologna
Build Status
Build Status

Purpose

This tool has been written in order to convert NMEA data into our standard .json format for GNSS coordinates

Installation

CMake, boost and a C++11 compatible compiler are required. To build the executable, clone the repo and then type

mkdir build ; cd build ; cmake .. ; cmake --build .

With CMake you can also deploy projects for the most common IDEs.
Contains jsoncons as a git submodule.

Usage

nmea_to_json.exe -i input.txt -o output.json -f [output style, 'a' (no quotes) for array or 'o' for object]

where input.txt must be an existing NMEA ASCII-encoded file while output.json is the name of the output file.

The optional -f specifies the style of the output .json file. If omitted, the object-style will be used.

Input Samples

Sample #1
$GPRMC,135221.000,V,4429.94755,N,01121.18915,E,0.0,-18.4,300615,,E*40
$GPRMC,135222.000,V,4429.94755,N,01121.18915,E,0.0,-18.4,300615,,E*43
Sample #2
$GNRMC,140502.20,A,4430.12967,N,01121.89356,E,7.201,56.95,300615,,,A*40
$GNRMC,140503.00,A,4430.12729,N,01121.89572,E,9.035,58.54,300615,,,A*4F
Sample #3
$GNGGA,135148.00,4429.97640,N,01121.21051,E,1,08,1.63,41.9,M,45.5,M,,*7F
$GNGGA,135148.20,4429.97639,N,01121.21050,E,1,08,1.63,41.9,M,45.5,M,,*72

Output Sample

Object-style:

{
    "gps_record_0000001":
    {
        "lat":44.5021611,
        "lon":11.3648926
    },
    "gps_record_0000002":
    {
        "lat":44.5021381,
        "lon":11.3648768
    }
}

array-style:

[
    {
        "lat":44.5021611,
        "lon":11.3648926
    },
    {
        "lat":44.5021381,
        "lon":11.3648768
    }
]

More details about file formats is available here.

About

A simple command line tool for extracting latitude and longitude values from a NMEA encoded ascii file and store them into a single JSON file.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published