{-# LANGUAGE DataKinds #-}
module Database.Esqueleto.Postgis.Spatial
( st_contains
, st_intersects
, st_within
, st_touches
, st_crosses
, st_disjoint
, st_equals
, st_covers
, st_coveredby
, st_overlaps
, st_containsproperly
, st_3dintersects
, st_relate
, st_orderingequals
, st_dfullywithin
, st_pointinsidecircle
) where
import Database.Esqueleto.Postgis.Geometry (Postgis, SpatialType(..))
import Database.Esqueleto.Experimental (SqlExpr, Value)
import Database.Esqueleto.Internal.Internal (unsafeSqlFunction)
import Data.Text (Text)
st_contains ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Bool)
st_contains :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Bool)
st_contains SqlExpr (Value (Postgis 'Geometry a))
a SqlExpr (Value (Postgis 'Geometry a))
b = Builder
-> (SqlExpr (Value (Postgis 'Geometry a)),
SqlExpr (Value (Postgis 'Geometry a)))
-> SqlExpr (Value Bool)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_CONTAINS" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_intersects ::
SqlExpr (Value (Postgis spatialType a)) ->
SqlExpr (Value (Postgis spatialType a)) ->
SqlExpr (Value Bool)
st_intersects :: forall (spatialType :: SpatialType) a.
SqlExpr (Value (Postgis spatialType a))
-> SqlExpr (Value (Postgis spatialType a)) -> SqlExpr (Value Bool)
st_intersects SqlExpr (Value (Postgis spatialType a))
a SqlExpr (Value (Postgis spatialType a))
b = Builder
-> (SqlExpr (Value (Postgis spatialType a)),
SqlExpr (Value (Postgis spatialType a)))
-> SqlExpr (Value Bool)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_Intersects" (SqlExpr (Value (Postgis spatialType a))
a, SqlExpr (Value (Postgis spatialType a))
b)
st_within ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Bool)
st_within :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Bool)
st_within SqlExpr (Value (Postgis 'Geometry a))
a SqlExpr (Value (Postgis 'Geometry a))
b = Builder
-> (SqlExpr (Value (Postgis 'Geometry a)),
SqlExpr (Value (Postgis 'Geometry a)))
-> SqlExpr (Value Bool)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_Within" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_touches ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Bool)
st_touches :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Bool)
st_touches SqlExpr (Value (Postgis 'Geometry a))
a SqlExpr (Value (Postgis 'Geometry a))
b = Builder
-> (SqlExpr (Value (Postgis 'Geometry a)),
SqlExpr (Value (Postgis 'Geometry a)))
-> SqlExpr (Value Bool)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_Touches" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_crosses ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Bool)
st_crosses :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Bool)
st_crosses SqlExpr (Value (Postgis 'Geometry a))
a SqlExpr (Value (Postgis 'Geometry a))
b = Builder
-> (SqlExpr (Value (Postgis 'Geometry a)),
SqlExpr (Value (Postgis 'Geometry a)))
-> SqlExpr (Value Bool)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_Crosses" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_disjoint ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Bool)
st_disjoint :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Bool)
st_disjoint SqlExpr (Value (Postgis 'Geometry a))
a SqlExpr (Value (Postgis 'Geometry a))
b = Builder
-> (SqlExpr (Value (Postgis 'Geometry a)),
SqlExpr (Value (Postgis 'Geometry a)))
-> SqlExpr (Value Bool)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_Disjoint" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_equals ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Bool)
st_equals :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Bool)
st_equals SqlExpr (Value (Postgis 'Geometry a))
a SqlExpr (Value (Postgis 'Geometry a))
b = Builder
-> (SqlExpr (Value (Postgis 'Geometry a)),
SqlExpr (Value (Postgis 'Geometry a)))
-> SqlExpr (Value Bool)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_Equals" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_covers ::
SqlExpr (Value (Postgis spatialType a)) ->
SqlExpr (Value (Postgis spatialType a)) ->
SqlExpr (Value Bool)
st_covers :: forall (spatialType :: SpatialType) a.
SqlExpr (Value (Postgis spatialType a))
-> SqlExpr (Value (Postgis spatialType a)) -> SqlExpr (Value Bool)
st_covers SqlExpr (Value (Postgis spatialType a))
a SqlExpr (Value (Postgis spatialType a))
b = Builder
-> (SqlExpr (Value (Postgis spatialType a)),
SqlExpr (Value (Postgis spatialType a)))
-> SqlExpr (Value Bool)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_Covers" (SqlExpr (Value (Postgis spatialType a))
a, SqlExpr (Value (Postgis spatialType a))
b)
st_coveredby ::
SqlExpr (Value (Postgis spatialType a)) ->
SqlExpr (Value (Postgis spatialType a)) ->
SqlExpr (Value Bool)
st_coveredby :: forall (spatialType :: SpatialType) a.
SqlExpr (Value (Postgis spatialType a))
-> SqlExpr (Value (Postgis spatialType a)) -> SqlExpr (Value Bool)
st_coveredby SqlExpr (Value (Postgis spatialType a))
a SqlExpr (Value (Postgis spatialType a))
b = Builder
-> (SqlExpr (Value (Postgis spatialType a)),
SqlExpr (Value (Postgis spatialType a)))
-> SqlExpr (Value Bool)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_CoveredBy" (SqlExpr (Value (Postgis spatialType a))
a, SqlExpr (Value (Postgis spatialType a))
b)
st_overlaps ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Bool)
st_overlaps :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Bool)
st_overlaps SqlExpr (Value (Postgis 'Geometry a))
a SqlExpr (Value (Postgis 'Geometry a))
b = Builder
-> (SqlExpr (Value (Postgis 'Geometry a)),
SqlExpr (Value (Postgis 'Geometry a)))
-> SqlExpr (Value Bool)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_Overlaps" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_containsproperly ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Bool)
st_containsproperly :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Bool)
st_containsproperly SqlExpr (Value (Postgis 'Geometry a))
a SqlExpr (Value (Postgis 'Geometry a))
b = Builder
-> (SqlExpr (Value (Postgis 'Geometry a)),
SqlExpr (Value (Postgis 'Geometry a)))
-> SqlExpr (Value Bool)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_ContainsProperly" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_3dintersects ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Bool)
st_3dintersects :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Bool)
st_3dintersects SqlExpr (Value (Postgis 'Geometry a))
a SqlExpr (Value (Postgis 'Geometry a))
b = Builder
-> (SqlExpr (Value (Postgis 'Geometry a)),
SqlExpr (Value (Postgis 'Geometry a)))
-> SqlExpr (Value Bool)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_3DIntersects" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_relate ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Text)
st_relate :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Text)
st_relate SqlExpr (Value (Postgis 'Geometry a))
a SqlExpr (Value (Postgis 'Geometry a))
b = Builder
-> (SqlExpr (Value (Postgis 'Geometry a)),
SqlExpr (Value (Postgis 'Geometry a)))
-> SqlExpr (Value Text)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_Relate" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_orderingequals ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Bool)
st_orderingequals :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Bool)
st_orderingequals SqlExpr (Value (Postgis 'Geometry a))
a SqlExpr (Value (Postgis 'Geometry a))
b = Builder
-> (SqlExpr (Value (Postgis 'Geometry a)),
SqlExpr (Value (Postgis 'Geometry a)))
-> SqlExpr (Value Bool)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_OrderingEquals" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_dfullywithin ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Double) ->
SqlExpr (Value Bool)
st_dfullywithin :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value Double)
-> SqlExpr (Value Bool)
st_dfullywithin SqlExpr (Value (Postgis 'Geometry a))
a SqlExpr (Value (Postgis 'Geometry a))
b SqlExpr (Value Double)
d = Builder
-> (SqlExpr (Value (Postgis 'Geometry a)),
SqlExpr (Value (Postgis 'Geometry a)), SqlExpr (Value Double))
-> SqlExpr (Value Bool)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_DFullyWithin" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b, SqlExpr (Value Double)
d)
st_pointinsidecircle ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Double) ->
SqlExpr (Value Double) ->
SqlExpr (Value Double) ->
SqlExpr (Value Bool)
st_pointinsidecircle :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value Double)
-> SqlExpr (Value Double)
-> SqlExpr (Value Double)
-> SqlExpr (Value Bool)
st_pointinsidecircle SqlExpr (Value (Postgis 'Geometry a))
a SqlExpr (Value Double)
cx SqlExpr (Value Double)
cy SqlExpr (Value Double)
r = Builder
-> (SqlExpr (Value (Postgis 'Geometry a)), SqlExpr (Value Double),
SqlExpr (Value Double), SqlExpr (Value Double))
-> SqlExpr (Value Bool)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_PointInsideCircle" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value Double)
cx, SqlExpr (Value Double)
cy, SqlExpr (Value Double)
r)