{-# LANGUAGE DataKinds #-}
module Database.Esqueleto.Postgis.Measurement
( st_distance
, st_dwithin
, st_area
, st_perimeter
, st_length
, st_azimuth
, st_maxdistance
, st_angle
, st_closestpoint
, st_3dclosestpoint
, st_3ddistance
, st_distancesphere
, st_frechetdistance
, st_hausdorffdistance
, st_length2d
, st_3dlength
, st_longestline
, st_3dlongestline
, st_3dmaxdistance
, st_minimumclearance
, st_shortestline
, st_3dshortestline
) where
import Database.Esqueleto.Postgis.Geometry (Postgis, SpatialType(..))
import Database.Esqueleto.Experimental (SqlExpr, Value)
import Database.Esqueleto.Internal.Internal (unsafeSqlFunction)
st_distance ::
SqlExpr (Value (Postgis spatialType a)) ->
SqlExpr (Value (Postgis spatialType a)) ->
SqlExpr (Value Double)
st_distance :: forall (spatialType :: SpatialType) a.
SqlExpr (Value (Postgis spatialType a))
-> SqlExpr (Value (Postgis spatialType a))
-> SqlExpr (Value Double)
st_distance 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 Double)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_distance" (SqlExpr (Value (Postgis spatialType a))
a, SqlExpr (Value (Postgis spatialType a))
b)
st_dwithin ::
SqlExpr (Value (Postgis spatialType a)) ->
SqlExpr (Value (Postgis spatialType a)) ->
SqlExpr (Value Double) ->
SqlExpr (Value Bool)
st_dwithin :: forall (spatialType :: SpatialType) a.
SqlExpr (Value (Postgis spatialType a))
-> SqlExpr (Value (Postgis spatialType a))
-> SqlExpr (Value Double)
-> SqlExpr (Value Bool)
st_dwithin SqlExpr (Value (Postgis spatialType a))
a SqlExpr (Value (Postgis spatialType a))
b SqlExpr (Value Double)
c = Builder
-> (SqlExpr (Value (Postgis spatialType a)),
SqlExpr (Value (Postgis spatialType a)), SqlExpr (Value Double))
-> SqlExpr (Value Bool)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_DWithin" (SqlExpr (Value (Postgis spatialType a))
a, SqlExpr (Value (Postgis spatialType a))
b, SqlExpr (Value Double)
c)
st_area ::
SqlExpr (Value (Postgis spatialType a)) ->
SqlExpr (Value Double)
st_area :: forall (spatialType :: SpatialType) a.
SqlExpr (Value (Postgis spatialType a)) -> SqlExpr (Value Double)
st_area SqlExpr (Value (Postgis spatialType a))
a = Builder
-> SqlExpr (Value (Postgis spatialType a))
-> SqlExpr (Value Double)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_Area" SqlExpr (Value (Postgis spatialType a))
a
st_perimeter ::
SqlExpr (Value (Postgis spatialType a)) ->
SqlExpr (Value Double)
st_perimeter :: forall (spatialType :: SpatialType) a.
SqlExpr (Value (Postgis spatialType a)) -> SqlExpr (Value Double)
st_perimeter SqlExpr (Value (Postgis spatialType a))
a = Builder
-> SqlExpr (Value (Postgis spatialType a))
-> SqlExpr (Value Double)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_Perimeter" SqlExpr (Value (Postgis spatialType a))
a
st_length ::
SqlExpr (Value (Postgis spatialType a)) ->
SqlExpr (Value Double)
st_length :: forall (spatialType :: SpatialType) a.
SqlExpr (Value (Postgis spatialType a)) -> SqlExpr (Value Double)
st_length SqlExpr (Value (Postgis spatialType a))
a = Builder
-> SqlExpr (Value (Postgis spatialType a))
-> SqlExpr (Value Double)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_Length" SqlExpr (Value (Postgis spatialType a))
a
st_azimuth ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Double)
st_azimuth :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Double)
st_azimuth 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 Double)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_Azimuth" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_maxdistance ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Double)
st_maxdistance :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Double)
st_maxdistance 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 Double)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_MaxDistance" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_angle ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Double)
st_angle :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Double)
st_angle 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 Double)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_Angle" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_closestpoint ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a))
st_closestpoint :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a))
st_closestpoint 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 (Postgis 'Geometry a))
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_ClosestPoint" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_3dclosestpoint ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a))
st_3dclosestpoint :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a))
st_3dclosestpoint 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 (Postgis 'Geometry a))
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_3DClosestPoint" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_3ddistance ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Double)
st_3ddistance :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Double)
st_3ddistance 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 Double)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_3DDistance" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_distancesphere ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Double)
st_distancesphere :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Double)
st_distancesphere 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 Double)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_DistanceSphere" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_frechetdistance ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Double)
st_frechetdistance :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Double)
st_frechetdistance 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 Double)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_FrechetDistance" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_hausdorffdistance ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Double)
st_hausdorffdistance :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Double)
st_hausdorffdistance 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 Double)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_HausdorffDistance" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_length2d ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Double)
st_length2d :: forall a.
SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Double)
st_length2d SqlExpr (Value (Postgis 'Geometry a))
a = Builder
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Double)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_Length2D" SqlExpr (Value (Postgis 'Geometry a))
a
st_3dlength ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Double)
st_3dlength :: forall a.
SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Double)
st_3dlength SqlExpr (Value (Postgis 'Geometry a))
a = Builder
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Double)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_3DLength" SqlExpr (Value (Postgis 'Geometry a))
a
st_longestline ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a))
st_longestline :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a))
st_longestline 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 (Postgis 'Geometry a))
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_LongestLine" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_3dlongestline ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a))
st_3dlongestline :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a))
st_3dlongestline 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 (Postgis 'Geometry a))
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_3DLongestLine" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_3dmaxdistance ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Double)
st_3dmaxdistance :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Double)
st_3dmaxdistance 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 Double)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_3DMaxDistance" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_minimumclearance ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value Double)
st_minimumclearance :: forall a.
SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Double)
st_minimumclearance SqlExpr (Value (Postgis 'Geometry a))
a = Builder
-> SqlExpr (Value (Postgis 'Geometry a)) -> SqlExpr (Value Double)
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_MinimumClearance" SqlExpr (Value (Postgis 'Geometry a))
a
st_shortestline ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a))
st_shortestline :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a))
st_shortestline 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 (Postgis 'Geometry a))
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_ShortestLine" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)
st_3dshortestline ::
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a)) ->
SqlExpr (Value (Postgis 'Geometry a))
st_3dshortestline :: forall a.
SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a))
-> SqlExpr (Value (Postgis 'Geometry a))
st_3dshortestline 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 (Postgis 'Geometry a))
forall a b.
UnsafeSqlFunctionArgument a =>
Builder -> a -> SqlExpr (Value b)
unsafeSqlFunction Builder
"ST_3DShortestLine" (SqlExpr (Value (Postgis 'Geometry a))
a, SqlExpr (Value (Postgis 'Geometry a))
b)