This module provides a basic data structure to represent locations as a pair of latitude/longitude variables.
Split coordinate component parts Sign is either -1 or 1 and all other components are positive
A list of (x, y) coordinates
Re-expose Angle from elm-units
Re-expose Length from elm-units
Create location from lat/lng values
Create location from lat/lng values
Parse a single coordinate with the given pair of directions
This can be used to specify the N-S or E-W directions or localized versions of those symbols
Example parseCoord ("L", "O") "45°10'50.12L" ==> Coord 1 45 10 50 120
Format a decimal latitude or longitude coordinate
coordToString -45.5 "N" "S" ==> "45°30'00.00\"S"Google Maps URL associated with the given location
Extract coordinate parts from float
Distance between two points, in meters.
Uses the great circle distance (https://en.wikipedia.org/wiki/Great-circle_distance)
This approximates the Earth by a sphere, which in most occasions is good enough.
Converts Coord to float
Convert LatLng to a tuple of floats
We can move points specifying variations in lat/lon Angles, Meters or in Coords
Move point east by given longitude cooordinates (in degrees, minutes, seconds, milliseconds)
Move point west by given longitude cooordinates (in degrees, minutes, seconds, milliseconds)
Move point south by given latitude cooordinates (in degrees, minutes, seconds, milliseconds)
Move point south by given latitude cooordinates (in degrees, minutes, seconds, milliseconds)
Make a chain of transformations in the given point
Each transformation is typically an operation like moveNorth (meters 5)
Return a list of partial applications.
Example:
chain loc
[ move (meters 60) (meters 10)
, northByCoords 0 0 1 256
, westBy (Angle.degrees 180)
]Create linear path starting at the given LatLng point
The conversion assumes the earth is locally flat, i.e., it gives good results for nearby points and poor conversions if distances are comensuarable to Earth radius.
Convert Polyline into path, taking the center point as the origin.
Convert Polyline into path
Works like pathFrom, but uses the first element of list as the origin reference
Decode location from a string with a pair of floats
Decode LatLng from a prettified representation in a JSON string
Decode location from a string with a pair of floats
A Point with latitude/longitude coordinates