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()
  | %Exexif.Data.Gps{
      gps_altitude: term(),
      gps_altitude_ref: term(),
      gps_area_information: term(),
      gps_date_stamp: term(),
      gps_dest_bearing: term(),
      gps_dest_bearing_ref: term(),
      gps_dest_distance: term(),
      gps_dest_distance_ref: term(),
      gps_dest_latitude: term(),
      gps_dest_latitude_ref: term(),
      gps_dest_longitude: term(),
      gps_dest_longitude_ref: term(),
      gps_differential: term(),
      gps_dop: term(),
      gps_h_positioning_errorl: term(),
      gps_img_direction: term(),
      gps_img_direction_ref: term(),
      gps_latitude: term(),
      gps_latitude_ref: term(),
      gps_longitude: term(),
      gps_longitude_ref: term(),
      gps_map_datum: term(),
      gps_measure_mode: term(),
      gps_processing_method: term(),
      gps_satellites: term(),
      gps_speed: term(),
      gps_speed_ref: term(),
      gps_status: term(),
      gps_time_stamp: term(),
      gps_track: term(),
      gps_track_ref: term(),
      gps_version_id: term()
    }
) :: 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.