Crate coordfmt

Crate coordfmt 

Source
Expand description

§Geographic coordinates format conversions

Reader format types can be constructed from string slices, using relaxed format rules. Latitude magnitudes must not exceed 90°, while longitude magnitudes are limited to 180°. All minutes and seconds values must be less than 60. Leading and trailing space characters are trimmed.

Writer format types are constructed from Reader types. They are used to display coordinates in formatted output.

§Example

Generate 50°53'39.70''N 10°57'19.23''E from decimal input:

use coordfmt::{Decimal, DMS};
use std::str::FromStr;
println!("{}", DMS::from_reader(&Decimal::from_str("50.894361, 10.955342").unwrap()));

§Command line interface

See coordfmt(1).

Modules§

man
COORDFMT(1)

Structs§

Coordinates
Base type.
DD
Reader and Writer for decimal degrees format, e.g 50.894361°N 10.955342°E.
DDM
Reader and Writer for degrees, decimal minutes format, e.g 50°53.6617'N 10°57.3205'E.
DMS
Reader and Writer for degrees, minutes, seconds format, e.g 50°53'39.70''N 10°57'19.23''E.
Decimal
Reader and Writer for decimal format, e.g 50.894361, 10.955342.
FL95
Reader and Writer for the fl95 waypoint format, e.g N 50 53.7 E 010 57.3.
FPL
Writer for the AIS flight plan waypoint format, e.g 5054N01057E.
ICAO
Generic Reader for ICAO formats FPL and NOTAM.
NOTAM
Writer for the format used in AIS NOTAMs, e.g 505342N 0105718E.

Enums§

Error
Parse and format identifier errors.

Traits§

Reader
Parse string slice into Coordinates.
Writer
Formatted output of Reader’s Coordinates.

Functions§

from_identifier
Factory function returning a Writer implemention pointer for the provided format identifier and the provided Reader.
from_str
Factory function returning a Reader implemention pointer for the provided string slice.