Parse geographic coordinates from string.
A wide range of commonly used formats is supported. See the unit tests for a complete reference.
If a format you need is missing, please submit a merge request (including unit tests).
```rust // parse a coord let coord : geo::Point = latlon::parse("N 50°5.30385', E 14°26.94732'").unwrap();
// individual lat/lng parsing let lat : f64 = latlon::parselat("N 50°5.30385'").unwrap(); let lng : f64 = latlon::parselng("E 14°26.94732'").unwrap(); ```
Example of supported formats:
40° 26' 46" N 79° 58' 56" W
N 40° 26' 46" W 79° 58' 56"
40° 26.767' N 79° 58.933' W
40° 26' 46" 79° 58' 56"
, 40° 26' 46", 79° 58' 56"
, ...N 40° 26.767' W 79° 58.933'
40° 26.767' 79° 58.933'
, 40° 26.767', 79° 58.933'
, ...N 40.446° W 79.982°
40.446° N 79.982° W
40.446° 79.982°
, 40.446,79.982
, etc.,
) may be used as an alternate decimal separator.’
, ”
) are supported
for minutes and seconds.,
), semicolon (;
), whitespace, or nothing
at all, if not ambiguous.