File: README.md

package info (click to toggle)
rust-iso6709parse 0.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 172 kB
  • sloc: makefile: 2
file content (32 lines) | stat: -rw-r--r-- 1,012 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# ISO6709 parser

[![Rust CI](https://github.com/TimLikesTacos/iso6709parse/actions/workflows/rust-ci.yml/badge.svg)](https://github.com/TimLikesTacos/iso6709parse/actions/workflows/rust-ci.yml)

This library uses the `nom` crate to create parsers to quickly convert ISO6709 formatted strings.  This results in a much faster parse than using Regex based libraries, from 4 to 10x faster.

`From` traits have been implemented for the `geo_types` crate for easy conversion from strings.

Supports formats for latitude with `N` or `S` and `E` and `W` instead of `+` or `-`:  
`±DD.DD`  
`±DDMM.MMM`
`±DDMMSS.SSS`

for longitude:
`±DDD.DDD`
`±DDDMM.MMM`
`±DDDMMSS.SSS`

along with altitude when properly formatted IAW ISO6709, for example `+1200.00-02130.00+2321CRS_WGS_85/`

Also supports the "Human Readable" format:
`DD°MM′SS.SSS″N DDD°MM′SS.SSS″W`  


```rust
use iso6709parse::parse;

let coord: geo_types::Coord = parse("N35.50W170.10+8712CRSWGS_85/").unwrap();
assert_eq!(coord.y, 35.5);

```