wroge / elm-geodesy / Geodesy

A coordinate conversion library in elm.

Types


type alias Spheroid =
{ a : Basics.Float, fi : Basics.Float }

Spheroid is represented by major Axis (a) and inverse Flattening (fi)


type alias Projection =
( Spheroid -> Projected2 -> Geographic2
, Spheroid -> Geographic2 -> Projected2 
)

Projection is represented by a projection to and from geographic coordinates.


type alias CoordinateSystem x =
( Spheroid -> x -> Geocentric
, Spheroid -> Geocentric -> x 
)

CoordinateSystem is represented a conversion to and from Geocentric coordinates.


type alias Geocentric =
{ x : Basics.Float
, y : Basics.Float
, z : Basics.Float 
}

Geocentric is represented by x, y, and z coordinates.


type alias Geographic =
{ lon : Basics.Float
, lat : Basics.Float
, h : Basics.Float 
}

Geographic is represented by longitude, latitude and height coordinates.


type alias Geographic2 =
{ lon : Basics.Float
, lat : Basics.Float 
}

Geographic2 is represented by longitude and latitude coordinate.


type alias Projected =
{ east : Basics.Float
, north : Basics.Float
, h : Basics.Float 
}

Projected is represented by eastern, northern and height coordinates.


type alias Projected2 =
{ east : Basics.Float
, north : Basics.Float 
}

Projected2 is represented by eastern and northern coordinate.

Functions

convert : CoordinateSystem x -> CoordinateSystem y -> Spheroid -> x -> y

convert converts coordinates from one CoordinateSystem to another.

normalizeLongitude : Basics.Float -> Basics.Float

normalizeLongitude converts longitude coordinate into the range between 180 and -180 degrees.

Predefined

geocentric : CoordinateSystem Geocentric

geocentric is a CoordinateSystem that do nothing.

geographic : CoordinateSystem Geographic

geographic is a CoordinateSystem that can convert geographic coordinates to geocentric and vice versa.

projected : Projection -> CoordinateSystem Projected

projected takes a projection and returns a CoordinateSystem.

webMercator : Projection

webMercator is a Projection that converts web mercator coordinates to geographic and vice versa.

transverseMercator : TransverseMercator -> Projection

transverseMercator is a Projection that converts transverse mercator coordinates to geographic and vice versa.