naqsha-0.1.0.0: A library for working with geospatial data types.

Naqsha.Position

Contents

Description

This module captures position of a point on the globe.

Synopsis

# Basics

A point on the globe is specified by giving its geo coordinates captures by the type Geo. It is essentially a pair of the Latitude and Longitude of the point.

## Examples

kanpurLatitude  :: Latitude
kanpurLatitude  = lat $degree 26.4477777 kanpurLongitude :: Longitude kanpurLongitude = lon$ degree 80.3461111
kanpurLatitude  = lat $degree 26 <> minute 26 <> second 52 kanpurLongitude = lon$ degree 80 <> minute 20 <> second 46

The show and read instance of the Latitude and Longitude types uses degrees for displaying and reading respectively. Show and Read instances can express these quantities up to Nano degree precision.

## Convention on sign.

For latitudes, positive means north and negative means south. For longitudes, positive means east and negative means west. However, if you find these conventions confusing you can use the combinators north, south, east, and west when constructing latitudes or longitudes.

data Geo Source #

The coordinates of a point on the earth's surface.

Constructors

 Geo !Latitude !Longitude

Instances

The North pole

The South pole

## Latitudes

data Latitude Source #

The latitude of a point. Positive denotes North of Equator where as negative South.

Instances

Convert an angle to a northern latitude

tropicOfCancer = north $degree 23.5 Convert an angle to a southern latitude.  tropicOfCapricon = south$ degree 23.5

Construct latitude out of an angle.

The latitude of equator.

The latitude corresponding to the Tropic of Cancer.

The latitude corresponding to the Tropic of Capricon

## Longitudes.

data Longitude Source #

The longitude of a point. Positive denotes East of the Greenwich meridian where as negative denotes West.

Instances

 Source # Methods Source # Methods Source # Methods Source # Methods Source # MethodsshowList :: [Longitude] -> ShowS # Source # Methodsmconcat :: [Longitude] -> Longitude # Source # Methods Source # Methodspow :: Integral x => Longitude -> x -> Longitude # Source # Methods Source # MethodsbasicUnsafeCopy :: PrimMonad m => Mutable Vector (PrimState m) Longitude -> Vector Longitude -> m () #elemseq :: Vector Longitude -> Longitude -> b -> b # Source # MethodsbasicUnsafeNew :: PrimMonad m => Int -> m (MVector (PrimState m) Longitude) #basicInitialize :: PrimMonad m => MVector (PrimState m) Longitude -> m () #basicUnsafeReplicate :: PrimMonad m => Int -> Longitude -> m (MVector (PrimState m) Longitude) #basicUnsafeWrite :: PrimMonad m => MVector (PrimState m) Longitude -> Int -> Longitude -> m () #basicClear :: PrimMonad m => MVector (PrimState m) Longitude -> m () #basicSet :: PrimMonad m => MVector (PrimState m) Longitude -> Longitude -> m () #basicUnsafeCopy :: PrimMonad m => MVector (PrimState m) Longitude -> MVector (PrimState m) Longitude -> m () #basicUnsafeMove :: PrimMonad m => MVector (PrimState m) Longitude -> MVector (PrimState m) Longitude -> m () #basicUnsafeGrow :: PrimMonad m => MVector (PrimState m) Longitude -> Int -> m (MVector (PrimState m) Longitude) # data Vector Longitude Source # data MVector s Longitude Source # data MVector s Longitude = MLongV (MVector s Angle)

Convert angle to an eastern longitude.

kanpurLongitude = east $degree 80.3461 Convert angle to a western longitude newyorkLongitude = west$ degree 74.0059

Convert angles to longitude.

The zero longitude.