Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Haskell bindings for postgres postgis for a good explenation see https://postgis.net/
Synopsis
- data PostgisGeometry point
- = Point point
- | MultiPoint (NonEmpty point)
- | Line (LineString point)
- | Multiline (NonEmpty (LineString point))
- | Polygon (LinearRing point)
- | MultiPolygon (NonEmpty (LinearRing point))
- | Collection (NonEmpty (PostgisGeometry point))
- makePolygon :: (Eq point, Show point) => point -> point -> point -> Seq point -> LinearRing point
- st_contains :: SqlExpr (Value (PostgisGeometry a)) -> SqlExpr (Value (PostgisGeometry a)) -> SqlExpr (Value Bool)
- st_intersects :: SqlExpr (Value (PostgisGeometry a)) -> SqlExpr (Value (PostgisGeometry a)) -> SqlExpr (Value Bool)
- st_point :: SqlExpr (Value Double) -> SqlExpr (Value Double) -> SqlExpr (Value (PostgisGeometry PointXY))
- st_point_xyz :: SqlExpr (Value Double) -> SqlExpr (Value Double) -> SqlExpr (Value Double) -> SqlExpr (Value (PostgisGeometry PointXYZ))
- st_point_xyzm :: SqlExpr (Value Double) -> SqlExpr (Value Double) -> SqlExpr (Value Double) -> SqlExpr (Value Double) -> SqlExpr (Value (PostgisGeometry PointXYZM))
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.
Point point | |
MultiPoint (NonEmpty point) | |
Line (LineString point) | |
Multiline (NonEmpty (LineString point)) | |
Polygon (LinearRing point) | |
MultiPolygon (NonEmpty (LinearRing point)) | |
Collection (NonEmpty (PostgisGeometry point)) |
Instances
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
:: 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
st_point :: SqlExpr (Value Double) -> SqlExpr (Value Double) -> SqlExpr (Value (PostgisGeometry PointXY)) Source #