Author: Thomas DuBuisson Copyright: Thomas DuBuisson License: BSD3
A basic GPS library with calculations for distance and speed along with helper functions for filtering/smoothing trails. All distances are in meters and time is in seconds. Speed is thus meters/second
The current intent of this library is to 1) Provide a standard type class interface for coordinates 2) Include fleshed out support for relevant libraries, a task too often neglected in modern Hackage packages.
Integration includes KML support via the xml package, pretty printing, anb binary.
- type Distance = Double
- type Heading = Double
- type Speed = Double
- type Vector = (Distance, Heading)
- type Trail a = [a]
- north :: Heading
- south :: Heading
- east :: Heading
- west :: Heading
- radiusOfEarth :: Double
- restLocations :: (Lat a, Lon a, Time a) => Distance -> NominalDiffTime -> Trail a -> [Trail a]
- closestDistance :: (Lat a, Lon a) => Trail a -> Trail a -> Maybe Distance
- getRadianPair :: (Lat p, Lon p) => p -> (LatitudeType, LongitudeType)
- addVector :: (Lat c, Lon c) => Vector -> c -> c
- divideArea :: (Lat c, Lon c) => Distance -> Distance -> c -> c -> [[c]]
- convexHull :: (Eq c, Lat c, Lon c) => [c] -> [c]
- module Data.Geo.GPX
Types and Classes
Angles are expressed in radians from North. 0 == North pi/2 == West pi == South (32)pi == East == - (pi 2)
Creates a list of trails all of which are within the given distance of each other spanning atleast the given amount of time.
restLocations 50 600
would return lists of all points that are within 50 meters of each other and
span at least 10 minutes (600 seconds).
Note this gives points within fifty meters of the earliest point - wandering in a rest area with a 50 meter radius could result in several rest points ([a,b..]) or even none if the distance between individual points exceeds 50m.
Returns the closest distance between two trails (or Nothing if a trail is empty) O( (n * m) * log (n * m) )
Provides a lat/lon pair of doubles in radians
Given a vector and coordinate, computes a new coordinate. Within some epsilon it should hold that if
dest = addVector (dist,heading) start
heading == dmsHeading start dest
dist == distance start dest
divideArea vDist hDist nw se divides an area into a grid of equally
spaced coordinates within the box drawn by the northwest point (nw) and
southeast point (se). Because this uses floating point there might be a
different number of points in some rows (the last might be too far east based
on a heading from the se point).
Uses Grahams scan to compute the convex hull of the given points. This operation requires sorting of the points, so don't try it unless you have notably more memory than the list of points will consume.