View Source Geocalc.DMS (Geocalc v0.8.5)

The Geocalc.DMS is a struct which contains degrees, minutes, seconds and cardinal direction.

Also have functions to convert DMS to decimal degrees.

Link to this section Summary

Functions

to_decimal(dms) deprecated

Converts Geocalc.DMS to decimal degrees.

Link to this section Types

@type t() :: %Geocalc.DMS{
  direction: term(),
  hours: term(),
  minutes: term(),
  seconds: term()
}

Link to this section Functions

This function is deprecated. Use to_degrees/1 instead.
@spec to_decimal(t()) :: number() | :error
@spec to_degrees(t()) :: number() | :error

Converts Geocalc.DMS to decimal degrees.

examples

Examples

iex> dms = %Geocalc.DMS{hours: 13, minutes: 31, seconds: 59.998, direction: "N"}
iex> Geocalc.DMS.to_degrees(dms)
13.533332777777778