lib_lat_lon v0.2.0 LibLatLon.Coords

Link to this section Summary

Functions

iex> LibLatLon.Coords.borrow(“41°23´16˝N,2°11´50˝E”)

%LibLatLon.Coords{lat: 41.38777777777778, lon: 2.197222222222222}

Converts lat/lon between floats and [degree,minute,second,semisphere] representations

Retrieves coordinates from barely anything

iex> LibLatLon.Coords.lend([41.38777777777778, 2.197222222222222])

{{{41, 23, 16.0}, "N"}, {{2, 11, 50.0}, "E"}}

Link to this section Types

Link to this type dms()
dms() :: {number(), number(), number()}
Link to this type dms_array()
dms_array() :: [number()]
Link to this type dms_ss()
dms_ss() :: {dms() | dms_array(), binary() | nil}
Link to this type t()
t() :: %LibLatLon.Coords{alt: number(), direction: number(), lat: number(), lon: number(), magnetic?: true | false}

Link to this section Functions

Link to this function borrow(lat_or_lon)
borrow({number(), number()} | nil | {dms_ss(), dms_ss()} | dms_ss() | [number()] | map() | binary() | Keyword.t() | %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()} | number()) ::
  LibLatLon.Coords.t() |
  number() |
  nil
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}
Link to this function borrow(arg1, ss)
borrow(dms(), any()) :: number()
borrow(dms_array(), any()) :: number()

Converts lat/lon between floats and [degree,minute,second,semisphere] representations.

Link to this function borrow(d, m, s, ss \\ nil)
borrow(number(), number(), number(), any()) :: number()
Link to this function coordinate(buffer)
coordinate(nil | binary() | %{} | any()) ::
  {:ok, LibLatLon.Coords.t()} |
  {:error, atom()}

Retrieves coordinates from barely anything.

iex> {:ok, result} = LibLatLon.Coords.coordinate("test/inputs/1.jpg")
...> result
#Coord<[lat: 41.37600333333334, lon: 2.1486783333333332, fancy: "41°22´33.612˝N,2°8´55.242˝E"]>

iex> LibLatLon.Coords.coordinate!("test/inputs/1.jpg")
#Coord<[lat: 41.37600333333334, lon: 2.1486783333333332, fancy: "41°22´33.612˝N,2°8´55.242˝E"]>

iex> LibLatLon.Coords.coordinate("test/inputs/unknown.jpg")
{:error, :illegal_source_file}
Link to this function coordinate!(whatever)
Link to this function do_lend(arg)
do_lend({number(), 0 | 1}) :: dms_ss()
Link to this function lend(arg1)
lend({number(), number()}) :: {dms_ss(), dms_ss()}
lend([number()]) :: {dms_ss(), dms_ss()}
lend(LibLatLon.Coords.t()) :: {dms_ss(), dms_ss()}
Link to this function lend(dms1, dms2)
lend(number(), number()) :: {dms_ss(), dms_ss()}
iex> LibLatLon.Coords.lend([41.38777777777778, 2.197222222222222])
{{{41, 23, 16.0}, "N"}, {{2, 11, 50.0}, "E"}}