| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Database.Postgis.Trivial
Description
Allows PostGIS to work with Traversable geospatial data enclosed in Traversable data structures.
Example of suitable data types for LineString and Polygon.
{-# LANGUAGE TypeFamilies #-}
data LatLon =
LatLon !Double !Double
deriving (Show, Eq)
type instance Cast LatLon = P2D
instance Castable LatLon where
toPointND (LatLon y x) = Point2D x y
fromPointND (Point2D x y) = LatLon y x
type LineStringData = [LatLon]
type PolygonData = [[LatLon], [LatLon]]