Popularity
6.1
Declining
Activity
0.0
Stable
10
3
5

Monthly Downloads: 4
Programming language: Haskell
License: MIT License
Tags: Database     Haskell    

haskell-postgis alternatives and similar packages

Based on the "haskell" category.
Alternatively, view haskell-postgis alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of haskell-postgis or a related project?

Add another 'haskell' Package

README

Haskell-Postgis

A collection of types and parsers to use with the PostGIS extesion to PostgreSQL.

Installation

git clone https://github.com/ewestern/haskell-postgis.git
cd haskell-postgis
cabal install

Example Usage with postgresql-simple

import Database.PostgreSQL.Simple.ToRow
import Database.PostgreSQL.Simple.ToField
import Database.PostgreSQL.Simple.FromRow
import Database.PostgreSQL.Simple.FromField 
import Database.Postgis

data Table = Table {
  geometry :: Geometry
}
instance FromRow Table where
  fromRow = Table <$> field

instance ToRow Table where
  toRow (Table g)  = [toField g]

instance ToField Geometry where
  toField  =  Plain . fromByteString . writeGeometry 

instance FromField Geometry where
    fromField f m = case m of
              Just bs -> return $ readGeometry bs
              Nothing -> error "Invalid Field"