LibLatLon.Coords.borrow

You're seeing just the function borrow, go back to LibLatLon.Coords module for more information.

Specs

borrow(
  {number(), number()}
  | nil
  | {dms_ss(), dms_ss()}
  | dms_ss()
  | [number()]
  | map()
  | binary()
  | Keyword.t()
  | Exexif.Data.Gps.t({} | number())
) :: t() | number() | nil | {:error, any()}

Converts literally any input to LibLatLon.Coords instance.

Examples

iex> LibLatLon.Coords.borrow("41°23´16˝N,2°11´50˝E")
%LibLatLon.Coords{lat: 41.38777777777778, lon: 2.197222222222222}

iex> LibLatLon.Coords.borrow("41°23´16.222˝N,2°11´50.333˝E")
%LibLatLon.Coords{lat: 41.387839444444445, lon: 2.197314722222222}

iex> LibLatLon.Coords.borrow({{{41, 23, 16.0}, "N"}, {{2, 11, 50.0}, "E"}})
%LibLatLon.Coords{lat: 41.38777777777778, lon: 2.197222222222222}

iex> LibLatLon.Coords.borrow(lat: 41.38, lon: 2.19)
%LibLatLon.Coords{lat: 41.38, lon: 2.19}

Specs

borrow(dms(), any()) :: number()
borrow(dms_list(), any()) :: number()

Converts {{degree, minute, second}, semisphere} or {[degree, minute, second], semisphere} representation into LibLatLon.Coords.

Link to this function

borrow(d, m, s, ss \\ nil)

View Source

Specs

borrow(number(), number(), number(), any()) :: number()

Converts degree, minute, second, semisphere representation into LibLatLon.Coords. When the last parameter semisphere is not one of: "S" or "W" or -1 or :south or west, it is implicitly considered to be in NE semisphere.