naqsha- A library for working with geospatial data types.

Safe HaskellNone




Geometric operations on earth surface assuming that earth is a sphere of radius 6371008 m.


Distance calculation.

distance Source #


:: Geo 
-> Geo 
-> Double

Distance in meters.

This combinator computes the distance (in meters) between two geo-locations using the haversine distance between two points. For Position which have an

distance' Source #


:: Double

Radius (in whatever unit)

-> Geo 
-> Geo 
-> Double 

A generalisation of dHvS that takes the radius as argument. Will work on Mars for example once we set up a latitude longitude system there. For this function units does not matter --- the computed distance is in the same unit as the input radius. We have

distance = distance' rMean

rMean :: Double Source #

Mean earth radius in meters. This is the radius used in the haversine formula of dHvs.