https://github.com/knapply/maritime
Tools and Routines for Maritime Data ⚓ 🚢 ⛵ 🛥️
https://github.com/knapply/maritime
Last synced: over 1 year ago
JSON representation
Tools and Routines for Maritime Data ⚓ 🚢 ⛵ 🛥️
- Host: GitHub
- URL: https://github.com/knapply/maritime
- Owner: knapply
- License: other
- Created: 2020-03-21T12:34:11.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-11-25T18:21:22.000Z (over 5 years ago)
- Last Synced: 2025-01-16T03:14:26.317Z (over 1 year ago)
- Language: C++
- Homepage: https://knapply.github.io/maritime/
- Size: 2.16 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
title: "`{maritime}` ⚓ 🚢 ⛵ 🛥️"
output:
github_document:
html_preview: true
toc: true
toc_depth: 2
html_document:
keep_md: yes
always_allow_html: yes
editor_options:
chunk_output_type: console
---
```{r, echo=FALSE}
knitr::opts_chunk$set(
# collapse = TRUE,
fig.align = "center",
comment = "#>",
fig.path = "man/figures/",
message = FALSE,
warning = FALSE
)
options(width = 150)
```
[](https://github.com/knapply/maritime/actions?workflow=R-CMD-check)
[](https://ci.appveyor.com/project/knapply/maritime)
[](https://travis-ci.org/knapply/maritime)
[](https://codecov.io/gh/knapply/maritime?branch=master)
[](https://www.tidyverse.org/lifecycle/#experimental)
[](https://github.com/knapply/maritime/commits/master)
[](https://www.gnu.org/licenses/gpl-3.0)
[](https://www.r-project.org/)
[](https://github.com/knapply/maritime)
[](https://gitter.im/maritime/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[](http://hits.dwyl.io/knapply/maritime)
# Introduction
Tools and routines for `{maritime}` data.
* [ ] High-performance AIS decoding routines.
+ built on [Kurt Schwehr](https://twitter.com/kurtschwehr)'s [__libais__](https://github.com/schwehr/libais)
* [ ] Seavision API wrapper
* [ ] ?
# Installation
You'll need a C++ compiler. If you're using Windows, that means [Rtools](https://cran.r-project.org/bin/windows/Rtools/).
```{r, eval=FALSE}
if (!requireNamespace("remotes", quietly = TRUE)) install.packages("remotes")
remotes::install_github("knapply/maritime")
```
# Usage
```{r}
library(maritime)
```
# AIS Sentence (AIVDM/AIVDO) Decoding
## Status
* [x] Automatic sentence validation and line normalization
* Message Types:
+ [x] `ais_msgs$msg_1_2_3`
+ [x] `ais_msgs$msg_4_11`
+ [x] `ais_msgs$msg_5`
+ [ ] `ais_msgs$msg_6`
+ [x] `ais_msgs$msg_7_13`
+ [ ] `ais_msgs$msg_8`
+ [x] `ais_msgs$msg_9`
+ [x] `ais_msgs$msg_10`
+ [x] `ais_msgs$msg_11`
+ [x] `ais_msgs$msg_12`
+ [x] `ais_msgs$msg_14`
+ [x] `ais_msgs$msg_15`
+ [x] `ais_msgs$msg_16`
+ [x] `ais_msgs$msg_17`
+ [x] `ais_msgs$msg_18`
+ [x] `ais_msgs$msg_19`
+ [x] `ais_msgs$msg_20`
+ [x] `ais_msgs$msg_21`
+ [x] `ais_msgs$msg_22`
+ [x] `ais_msgs$msg_23`
+ [x] `ais_msgs$msg_24`
+ [x] `ais_msgs$msg_25`
+ [x] `ais_msgs$msg_26`
+ [x] `ais_msgs$msg_27`
```{r}
nmea_file <- "inst/example-data/big-files/20200131.log"
paste(round(file.size(nmea_file) / 1e9, 2L), "GB")
readLines(nmea_file, n = 20) # real world data, in all its terrible glory
```
```{r}
ais_decode_filter(msgs = nmea_file, msg_type = ais_msgs$msg_1_2_3)
```
```{r}
ais_decode_df(msgs = nmea_file)
```
## Performance
```{r}
bench::mark(
`ais_decode_list()` = decoded_list <- ais_decode_list(
nmea_file, as_tibble = FALSE, as_sf = FALSE, verbose = FALSE
)
)
```
```{r}
lapply(decoded_list, tibble::as_tibble)
```
# Credits
* AIS decoding routines are built on top of [Kurt Schwehr](https://twitter.com/kurtschwehr)'s [__libais__](https://github.com/schwehr/libais).