postgis-trivial-0.0.1.0: PostGIS extention driver based on postgresql-simple package
Safe HaskellSafe-Inferred
LanguageHaskell2010

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]]

Documentation