[ANN] QstarzGPS.jl : A package to ease loading GPS logs produced by a Qstarz GPS module

A few years ago a client suggested we look at using the Qstarz GPS modules to record location information as part of our experiments. This proved useful, however the workflow was typically something along the lines of:

  • Capture the positions with the GPS logger
  • Connect the GPS logger to a PC using USB
  • Use their Windows application (running in a VM) to export the log into a CSV file
  • Copy the CSV file to the Linux server where the rest of our data is captured and the analysis is performed
  • Load the CSV file into Julia (using CSV.jl) and perform the analysis

Due to the hassle of having to fire up my Windows VM to run the extraction utility, I started wondering if it wouldn’t be possible to trim these steps and do it more directly. I reached out to Qstarz with the suggestion of making an open source implementation available to read their log files. They graciously
provided me with some information which allowed me to implement the reader. Since my ultimate step was to get the data from the log format into Julia, I decided to skip intermediate steps and implement it to directly load the data into a Julia vector object.
The data is stored as an array of structures, but I also implemented helper functions to be able to easily extract the individual fields of the structure into vectors (see the Extended Example on https://github.com/lwabeke/QstarzGPS.jl/.

julia> using QstarzGPS

julia> filename = "230502_120613.BIN"

julia> gpsLog = readQstarzLog(filename)
5325-element Vector{GpsLogEntry}:
 GpsLogEntry(0x03, 0x54, 0x0258, -25.75720058333333, 28.27944851666667, 0x6450fcb5, 6.7598f0, 1423.27f0, 178.39f0, 0.26171875f0, -0.28515625f0, 0.87109375f0, 0x0031, 1.97f0, 1.0f0, 15, 5, 0x01, 90, 0x00000000, 0x00000000)
 GpsLogEntry(0x03, 0x54, 0x02bc, -25.75720188333333, 28.279449366666668, 0x6450fcb5, 7.5006f0, 1423.351f0, 179.87f0, 0.26171875f0, -0.546875f0, 1.2070312f0, 0x0031, 1.97f0, 1.0f0, 15, 5, 0x01, 90, 0x00000000, 0x00000000)
    ...

julia> using Dates

julia> unix2datetime.(gpsLog.time[1:3])
3-element Vector{DateTime}:
 2023-05-02T12:06:13.600
 2023-05-02T12:06:13.700
 2023-05-02T12:06:13.800

By using Leaflet this can be easily visualised (for details see the Extended Example on https://github.com/lwabeke/QstarzGPS.jl/):

3 Likes

That is awesome @lwabeke , thanks for the contribution.

Are you aware of the Tables.jl interface? Perhaps the output of your function could follow it to maximize integration with existing stacks.

If you want to go one step further, you could even load the data as a geotable as discussed in the Geospatial Data Science with Julia book.

Alternatively, we can add the backend to GeoIO.jl so that users can automatically load the GPS data into the stack.

1 Like

It sounds like it outputs a vector of structs, which satisfies the interface by default (as a row table).

1 Like

@lwabeke it is good practice to add tests to the package. In this case, it is also a good idea to add a small example file that people can load. Right now it is not possible to reproduce the example in the README, nor test the package properly.