fromString

fun fromString(coordinates: String): WGSCoord

Parses a WGS-84 latitude/longitude pair from a textual representation. Supports decimal degrees, degrees-minutes (D M) and degrees-minutes-seconds (D M S) on each axis, with optional N/S and E/W hemisphere markers. The decoration characters ° ′ ″ ' " * , ; and whitespace act as separators.

The parser rejects every input it cannot interpret as a valid coordinate pair — blank input, unrecognized tokens, hemisphere markers without a number, repeated hemisphere markers, an odd number of unmarked tokens, more than three D/M/S parts, negative minutes or seconds, and angles outside [-90, 90] / [-180, 180].

Throws

when the string is not a well-formed coordinate pair.