Coord v0.1.0 Coord.Point.LatLng View Source

A point represented by a latitude and longitude.

iex> use Coord
iex> _point = LatLng.new(51.178861, -1.826412)
%Coord.Point.LatLng{lat: 51.178861, lng: -1.826412}

By the way, the default values of the struct point to the same point at Stonehenge as the default values of the Coord.Point.LatLng struct for testing purposes.

Concept

The latitude of a point is defined as the angle between a line from that point to the center of the earth and the equatorial plane. Latitude lines run from north to south. This library follows the convention that north of the equator is positive and south of the equator is negative.

The longitude of a point is defined as the angle between the meridian that passes through that point and the prime meridian. Longitude lines run east to west. This library follows the convention that meridians east of the prime meridian are positive and meridians west of the prime meridian are negative.

Great ellipses are the intersection the earth and planes that pass through the center of the earth. Meridians are halves of the great ellipses which also pass through the poles.

Source: https://en.wikipedia.org/wiki/Geographic_coordinate_system#Latitude_and_longitude

Link to this section Summary

Types

t()

A struct containing a latitude and longitude.

Functions

Create a LatLng point from an UTM point.

Create a new LatLng point for a latitude and longitude

Link to this section Types

Specs

t() :: %Coord.Point.LatLng{lat: float(), lng: float()}

A struct containing a latitude and longitude.

Keys:

  • :lat: The latitude as a float
  • :lng: The longitude as a float

Link to this section Functions

Specs

from(Coord.Point.UTM.t()) :: t()

Create a LatLng point from an UTM point.

Uses Karney's method. Accurate up to 5nm if the point is within 3900km of the central meridian.

Specs

new(float(), float()) :: t()

Create a new LatLng point for a latitude and longitude