esqueleto-postgis-1.0.1: postgis bindings for esqueleto.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Database.Esqueleto.Postgis

Description

Haskell bindings for postgres postgis for a good explenation see https://postgis.net/

Synopsis

Documentation

data PostgisGeometry point Source #

like GeospatialGeometry but not partial, eg no empty geometries, also only works in a single dimention, eg PostgisGeometry PointXY can't work with PostgisGeometry PointXYZ. so PointXY indicates a 2 dimension space, and PointXYZ a three dimension space.

Instances

Instances details
Functor PostgisGeometry Source # 
Instance details

Defined in Database.Esqueleto.Postgis

Methods

fmap :: (a -> b) -> PostgisGeometry a -> PostgisGeometry b #

(<$) :: a -> PostgisGeometry b -> PostgisGeometry a #

Show point => Show (PostgisGeometry point) Source # 
Instance details

Defined in Database.Esqueleto.Postgis

Eq point => Eq (PostgisGeometry point) Source # 
Instance details

Defined in Database.Esqueleto.Postgis

Methods

(==) :: PostgisGeometry point -> PostgisGeometry point -> Bool #

(/=) :: PostgisGeometry point -> PostgisGeometry point -> Bool #

PersistField (PostgisGeometry PointXY) Source # 
Instance details

Defined in Database.Esqueleto.Postgis

PersistField (PostgisGeometry PointXYZ) Source # 
Instance details

Defined in Database.Esqueleto.Postgis

PersistField (PostgisGeometry PointXYZM) Source # 
Instance details

Defined in Database.Esqueleto.Postgis

PersistFieldSql (PostgisGeometry PointXY) Source # 
Instance details

Defined in Database.Esqueleto.Postgis

PersistFieldSql (PostgisGeometry PointXYZ) Source # 
Instance details

Defined in Database.Esqueleto.Postgis

PersistFieldSql (PostgisGeometry PointXYZM) Source # 
Instance details

Defined in Database.Esqueleto.Postgis

makePolygon :: (Eq point, Show point) => point -> point -> point -> Seq point -> LinearRing point Source #

checks if the first point is the last, and if not so makes it so. this is required for inserting into the database

functions

st_contains Source #

Arguments

:: SqlExpr (Value (PostgisGeometry a))

geom a

-> SqlExpr (Value (PostgisGeometry a))

geom b

-> SqlExpr (Value Bool) 

Returns TRUE if geometry A contains geometry B. https://postgis.net/docs/ST_Contains.html

st_intersects :: SqlExpr (Value (PostgisGeometry a)) -> SqlExpr (Value (PostgisGeometry a)) -> SqlExpr (Value Bool) Source #

Returns true if two geometries intersect. Geometries intersect if they have any point in common. https://postgis.net/docs/ST_Intersects.html

points