jord-2.0.0.0: Geographical Position Calculations

Copyright(c) 2020 Cedric Liegeois
LicenseBSD3
MaintainerCedric Liegeois <ofmooseandmen@yahoo.fr>
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Data.Geo.Jord.Positions

Description

Functions to convert position between geodetic and geocentric and to transform position coordinates between ellipsoidal models.

import qualified Data.Geo.Jord.Geocentric as Geocentric
import qualified Data.Geo.Jord.Geodetic as Geodetic
import Data.Geo.Jord.Models
import qualified Data.Geo.Jord.Positions as Positions
import qualified Data.Geo.Jord.Transformations as Transformations
Synopsis

Documentation

toGeodetic :: Model m => Position m -> Position m Source #

toGeodetic p converts the geodetic coordinates of position p to geocentric coordinates.

toGeocentric :: Model m => Position m -> Position m Source #

toGeocentric p converts the geocentric coordinates of position p to geodetic coordinates.

transform :: (Ellipsoidal a, Ellipsoidal b) => Position a -> b -> Graph Params7 -> Maybe (Position b) Source #

transform p1 m2 g transforms the coordinates of the position p1 from its coordinate system into the coordinate system defined by the model m2 using the graph g to find the sequence of transformation parameters. Returns Nothing if the given graph does not contain a transformation from m1 to m2. For example:

>>> let pWGS84 = Positions.toGeocentric (Geodetic.latLongHeightPos 48.6921 6.1844 (Length.metres 188) WGS84)
>>> Positions.transform pWGS84 NAD83 Txs.fixed
Just (Position {gx = 4193.792080781km, gy = 454.433921298km, gz = 4768.166154789km, model = NAD83})

transform' :: (Ellipsoidal a, Ellipsoidal b) => Position a -> b -> Params7 -> Position b Source #

transform' p1 m2 tx transforms the coordinates of the position p1 from its coordinate system into the coordinate system defined by the model m2 using the 7-parameters transformation tx. For example:

>>> let tx = Tx.params7 (995.6, -1910.3, -521.5) (-0.62) (25.915, 9.426, 11.599) -- WGS84 -> NAD83
>>> let pWGS84 = Positions.toGeocentric (Geodetic.latLongHeightPos 48.6921 6.1844 (Length.metres 188) WGS84)
>>> Positions.transform' pWGS84 NAD83 tx
Position {gx = 4193.792080781km, gy = 454.433921298km, gz = 4768.166154789km, model = NAD83}

transformAt :: (EllipsoidalT0 a, EllipsoidalT0 b) => Position a -> Epoch -> b -> Graph Params15 -> Maybe (Position b) Source #

transformAt p1 e m2 g transforms the coordinates of the position p1 observed at epoch e from its coordinate system into the coordinate system defined by the model m2 using the graph g to find the sequence of transformation parameters. Returns Nothing if the given graph does not contain a transformation from m1 to m2. For example:

>>> let pITRF2014 = Positions.toGeocentric (Geodetic.latLongHeightPos 48.6921 6.1844 (Length.metres 188) ITRF2014)
>>> Positions.transformAt pITRF2014 (Epoch 2019.0) NAD83_CORS96 Txs.timeDependent -- through ITRF2000
Just (Position {gx = 4193.791716941km, gy = 454.433860294km, gz = 4768.166466192km, model = NAD83_CORS96})

transformAt' :: (EllipsoidalT0 a, EllipsoidalT0 b) => Position a -> Epoch -> b -> Params15 -> Position b Source #

transformAt' p1 e m2 tx transforms the coordinates of the position p1 observed at epoch e from its coordinate system into the coordinate system defined by the model m2 using the 15-parameters transformation tx. For example:

>>> let tx7 = Tx.params7 (53.7, 51.2, -55.1) 1.2 (0.891, 5.39, -8.712)
>>> let txR = Tx.rates (0.1, 0.1, -1.9) 0.11 (0.81, 0.49, -0.792)
>>> let tx = Tx.Params15 (Epoch 2000.0) tx7 txR -- ITRF2014 -> ETRF2000
>>> let pITRF2014 = Positions.toGeocentric (Geodetic.latLongHeightPos 48.6921 6.1844 (Length.metres 188) ITRF2014)
>>> Positions.transformAt' pITRF2014 (Epoch 2019.0) ETRF2000 tx
Position {gx = 4193.791357037km, gy = 454.435390265km, gz = 4768.166475162km, model = ETRF2000}