Giter Site home page Giter Site logo

arabia's Introduction

arabia

Tools to Read ‘Lowrance’ Binary Track Files

Description

Lowrance’ (http://www.lowrance.com/) chart plotters use an ugly but straightforward binary format to encode their tracks. Tools are provided to read ‘SL2’ files (and, very likely ‘SLG’ and ‘SL3’ files, too).

What’s Inside The Tin

The following functions are implemented:

  • read_sl2: Read Lowrance binary track files
  • read_sl2_cpp: A “No Frills” Faster Version in C++ (uncomment things in the package if you want this as the OP was having issues on Windows with Rtools) — look in old-source for the CPP version

Installation

devtools::install_git("https://gitlab.com/hrbrmstr/arabia")

Usage

library(arabia)
library(tidyverse)

# current verison
packageVersion("arabia")
## [1] '0.1.0'

Give it a go

system.time(xdf <- read_sl2(system.file("exdat", "example.sl2", package="arabia")))
## Format: sl2

## Block size: downscan

## .............

##    user  system elapsed 
##   2.263   0.047   2.411
xdf
## # A tibble: 1,308 x 22
##    channel   upperLimit lowerLimit frequency waterDepth keelDepth speedGps temperature lng_enc lat_enc speedWater track
##    <chr>          <dbl>      <dbl> <chr>          <dbl>     <dbl>    <dbl>       <dbl>   <int>   <int>      <dbl> <dbl>
##  1 Secondary         0.       13.3 200 KHz         2.62     0.328    0.500        15.8 4433307 7003054      0.500  4.97
##  2 DSI (Dow…         0.       13.4 200 KHz         2.62     0.328    0.500        15.8 4433307 7003054      0.500  4.97
##  3 Primary           0.       13.3 200 KHz         2.62     0.328    0.500        15.9 4433307 7003054      0.500  4.97
##  4 Secondary         0.       13.3 200 KHz         2.62     0.328    0.500        15.9 4433307 7003054      0.500  4.97
##  5 DSI (Dow…         0.       13.4 200 KHz         2.59     0.328    0.           15.8 4433307 7003054      0.     4.97
##  6 Secondary         0.       13.3 200 KHz         2.59     0.328    0.           15.8 4433307 7003054      0.     4.97
##  7 Secondary         0.       13.3 200 KHz         2.52     0.328    0.           15.9 4433307 7003054      0.     4.97
##  8 DSI (Dow…         0.       13.4 200 KHz         2.52     0.328    0.           15.9 4433307 7003054      0.     4.97
##  9 Primary           0.       13.3 200 KHz         2.52     0.328    0.           15.8 4433307 7003054      0.     4.97
## 10 DSI (Dow…         0.       13.4 200 KHz         2.52     0.328    0.           15.8 4433307 7003054      0.     4.97
## # ... with 1,298 more rows, and 10 more variables: altitude <dbl>, heading <dbl>, timeOffset <int>, headingValid <lgl>,
## #   altitudeValid <lgl>, gpsSpeedValid <lgl>, waterTempValid <lgl>, positionValid <lgl>, waterSpeedValid <lgl>,
## #   trackValid <lgl>
glimpse(xdf)
## Observations: 1,308
## Variables: 22
## $ channel         <chr> "Secondary", "DSI (Downscan)", "Primary", "Secondary", "DSI (Downscan)", "Secondary", "Seco...
## $ upperLimit      <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
## $ lowerLimit      <dbl> 13.3, 13.4, 13.3, 13.3, 13.4, 13.3, 13.3, 13.4, 13.3, 13.4, 13.3, 13.4, 13.3, 13.4, 13.3, 1...
## $ frequency       <chr> "200 KHz", "200 KHz", "200 KHz", "200 KHz", "200 KHz", "200 KHz", "200 KHz", "200 KHz", "20...
## $ waterDepth      <dbl> 2.620, 2.620, 2.620, 2.620, 2.586, 2.586, 2.516, 2.516, 2.516, 2.516, 2.516, 2.516, 2.516, ...
## $ keelDepth       <dbl> 0.328084, 0.328084, 0.328084, 0.328084, 0.328084, 0.328084, 0.328084, 0.328084, 0.328084, 0...
## $ speedGps        <dbl> 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0...
## $ temperature     <dbl> 15.84112, 15.84112, 15.86293, 15.86293, 15.79128, 15.79128, 15.86293, 15.86293, 15.81620, 1...
## $ lng_enc         <int> 4433307, 4433307, 4433307, 4433307, 4433307, 4433307, 4433307, 4433307, 4433307, 4433307, 4...
## $ lat_enc         <int> 7003054, 7003054, 7003054, 7003054, 7003054, 7003054, 7003054, 7003054, 7003054, 7003054, 7...
## $ speedWater      <dbl> 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0...
## $ track           <dbl> 4.974188, 4.974188, 4.974188, 4.974188, 4.974188, 4.974188, 4.974188, 4.974188, 4.974188, 4...
## $ altitude        <dbl> 324.7375, 324.7375, 324.7375, 324.7375, 324.8687, 324.8687, 324.8687, 324.8687, 324.8687, 3...
## $ heading         <dbl> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
## $ timeOffset      <int> 1317703, 1317706, 1318036, 1318905, 1318946, 1318982, 1319130, 1319140, 1319216, 1319222, 1...
## $ headingValid    <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, ...
## $ altitudeValid   <lgl> TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FAL...
## $ gpsSpeedValid   <lgl> TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FAL...
## $ waterTempValid  <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, ...
## $ positionValid   <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, ...
## $ waterSpeedValid <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, ...
## $ trackValid      <lgl> FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, ...

arabia's People

Contributors

hrbrmstr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

mikeadams1

arabia's Issues

devtools installation issue with Rcpp

Hello! First, just wanted to say thanks for working on this; I'm pretty excited to be able to use the data Lowrance .sl2 files.

I'm primarily having problems with installing the library using devtools::install_git("https://gitlab.com/hrbrmstr/arabia").

I routinely get the following error message, which seems to indicate that the library is unable to locate my Rcpp package during compilation. I've confirmed that Rcpp has been downloaded, in the directory ~/R/x86_64-pc-linux-gnu-library/3.4/Rcpp and when I copy Rcpp.h to the arabia/src folder and use #include "Rcpp.h" instead of #include <Rcpp.h>, the compiler moves onto the next #include <file> that is located in the Rcpp directory but not the arabia library itself. I see the g++ flag for -I/usr/share/R/include, but am unsure what that entails.

Part of this might be that my R environment is pretty new; I don't usually use this ecosystem, and so it's certainly possible that certain libraries aren't in the right place, although I've tried to follow the default paths for installations, so it's feasible that others might run into this problem at some point as well. I'm running this on a derivative of Ubuntu 17.10. Thanks!


Downloading git repo https://github.com/hrbrmstr/arabia.git
Installing arabia
'/usr/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet  \
CMD INSTALL '/tmp/Rtmpyz1hVz/file19af788ca11b'  \
--library='/home/username/R/x86_64-pc-linux-gnu-library/3.4' --install-tests 

* installing *source* package ‘arabia’ ...
** libs
g++  -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-1q72bO/r-base-3.4.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c arabia-main.cpp -o arabia-main.o
arabia-main.cpp:1:10: fatal error: Rcpp.h: No such file or directory
#include <Rcpp.h>
        ^~~~~~~~
compilation terminated.
/usr/lib/R/etc/Makeconf:168: recipe for target 'arabia-main.o' failed
make: *** [arabia-main.o] Error 1
ERROR: compilation failed for package ‘arabia’
* removing ‘/home/username/R/x86_64-pc-linux-gnu-library/3.4/arabia’
Installation failed: Command failed (1)
Error in library(arabia) : there is no package called ‘arabia’
Execution halted 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.