| Copyright | (c) 2018 Cedric Liegeois |
|---|---|
| License | BSD3 |
| Maintainer | Cedric Liegeois <ofmooseandmen@yahoo.fr> |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Data.Geo.Jord.GeoPos
Description
Types to represent a geographic position by its latitude and longitude.
Synopsis
- data GeoPos
- latLong :: Angle -> Angle -> GeoPos
- latLongE :: Angle -> Angle -> Either String GeoPos
- latLongF :: MonadFail m => Angle -> Angle -> m GeoPos
- latLongDecimal :: Double -> Double -> GeoPos
- latLongDecimalE :: Double -> Double -> Either String GeoPos
- latLongDecimalF :: MonadFail m => Double -> Double -> m GeoPos
- readGeoPos :: String -> GeoPos
- readGeoPosE :: String -> Either String GeoPos
- readGeoPosF :: MonadFail m => String -> m GeoPos
- toDecimalDegrees' :: GeoPos -> (Double, Double)
The GeoPos type
A geographic position (latitude and longitude).
Smart constructors
read
readGeoPos :: String -> GeoPos Source #
Obtains a GeoPos from the given string formatted as either:
- DD(MM)(SS)[N|S]DDD(MM)(SS)[E|W] - e.g. 553621N0130002E or 0116S03649E or 47N122W
Angle[N|S]Angle[E|W] - e.g. 55°36'21''N 13°0'02''E or 11°16'S 36°49'E or 47°N 122°W
This simply calls read s :: GeoPos so error should be handled at the call site.
readGeoPosE :: String -> Either String GeoPos Source #
Same as readGeoPos but returns a Either.
readGeoPosF :: MonadFail m => String -> m GeoPos Source #
Same as readGeoPos but returns a MonadFail.