| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Database.Esqueleto.Postgis.Wkb
Description
Ewkb is deeply integrated into Wkb, which is why we kept this around. For postgis we mostly want Ewkb.
This module Allows parsing of ByteString into a Geospatial Object, and provides foundational elements for constructing an Ewkb.
Refer to the WKB Wikipedia page https://en.wikipedia.org/wiki/Well-known_text#Well-known_binary
Synopsis
- parseByteString :: ByteString -> Either String GeospatialGeometry
- parseHexByteString :: Base16 ByteString -> Either String GeospatialGeometry
- toByteString :: EndianType -> GeospatialGeometry -> ByteString
- data CoordinateType
- data GeometryType
- data WkbGeometryType = WkbGeom GeometryType CoordinateType
- type BuilderWkbGeometryType = EndianType -> WkbGeometryType -> Builder
- getWkbGeom :: EndianType -> Get WkbGeometryType
- builderWkbGeom :: EndianType -> WkbGeometryType -> Builder
- geoPositionWithoutCRSToCoordinateType :: GeoPositionWithoutCRS -> Maybe CoordinateType
- coordTypeOfSequence :: Seq GeoPositionWithoutCRS -> CoordinateType
- coordTypeOfLinearRings :: Seq (LinearRing GeoPositionWithoutCRS) -> CoordinateType
- data EndianType
- getEndianType :: Get EndianType
- getFourBytes :: EndianType -> Get Word32
- getDouble :: EndianType -> Get Double
- builderEndianType :: EndianType -> Builder
- builderFourBytes :: EndianType -> Word32 -> Builder
- builderDouble :: EndianType -> Double -> Builder
- getPoint :: EndianType -> CoordinateType -> Get GeospatialGeometry
- getMultiPoint :: (EndianType -> Get WkbGeometryType) -> EndianType -> CoordinateType -> Get GeospatialGeometry
- getGeoPoint :: EndianType -> CoordinateType -> Get GeoPoint
- getCoordPoint :: EndianType -> CoordinateType -> Get GeoPositionWithoutCRS
- getCoordPoints :: EndianType -> CoordinateType -> Word32 -> Get (Seq GeoPositionWithoutCRS)
- builderPoint :: BuilderWkbGeometryType -> EndianType -> GeoPoint -> Builder
- builderMultiPoint :: BuilderWkbGeometryType -> EndianType -> GeoMultiPoint -> Builder
- builderCoordPoint :: EndianType -> GeoPositionWithoutCRS -> Builder
- builderCoordPoints :: EndianType -> Seq GeoPositionWithoutCRS -> Builder
Documentation
parseByteString :: ByteString -> Either String GeospatialGeometry Source #
Representation of WKB as Binary
parseHexByteString :: Base16 ByteString -> Either String GeospatialGeometry Source #
Representation of WKB as a String in Base16/Hex form i.e. "0101000000000000000000f03f0000000000000040" is POINT 1.0 2.0
toByteString :: EndianType -> GeospatialGeometry -> ByteString Source #
Produce the binary representation of WKB given its EndianType (Little or Big - Intel is Little). Use EWKB when you know the SRID.
Core
the greasy gears inside for experienced users or the brave!
Geometry
data CoordinateType Source #
Instances
| Show CoordinateType Source # | |
Defined in Database.Esqueleto.Postgis.Wkb.Geometry Methods showsPrec :: Int -> CoordinateType -> ShowS # show :: CoordinateType -> String # showList :: [CoordinateType] -> ShowS # | |
| Eq CoordinateType Source # | |
Defined in Database.Esqueleto.Postgis.Wkb.Geometry Methods (==) :: CoordinateType -> CoordinateType -> Bool # (/=) :: CoordinateType -> CoordinateType -> Bool # | |
data GeometryType Source #
Constructors
| Geometry | |
| Point | |
| LineString | |
| Polygon | |
| MultiPoint | |
| MultiLineString | |
| MultiPolygon | |
| GeometryCollection |
Instances
| Show GeometryType Source # | |
Defined in Database.Esqueleto.Postgis.Wkb.Geometry Methods showsPrec :: Int -> GeometryType -> ShowS # show :: GeometryType -> String # showList :: [GeometryType] -> ShowS # | |
| Eq GeometryType Source # | |
Defined in Database.Esqueleto.Postgis.Wkb.Geometry | |
data WkbGeometryType Source #
Constructors
| WkbGeom GeometryType CoordinateType |
Instances
| Show WkbGeometryType Source # | |
Defined in Database.Esqueleto.Postgis.Wkb.Geometry Methods showsPrec :: Int -> WkbGeometryType -> ShowS # show :: WkbGeometryType -> String # showList :: [WkbGeometryType] -> ShowS # | |
| Eq WkbGeometryType Source # | |
Defined in Database.Esqueleto.Postgis.Wkb.Geometry Methods (==) :: WkbGeometryType -> WkbGeometryType -> Bool # (/=) :: WkbGeometryType -> WkbGeometryType -> Bool # | |
type BuilderWkbGeometryType = EndianType -> WkbGeometryType -> Builder Source #
builderWkbGeom :: EndianType -> WkbGeometryType -> Builder Source #
Endian
data EndianType Source #
Constructors
| LittleEndian | |
| BigEndian |
Instances
| Show EndianType Source # | |
Defined in Database.Esqueleto.Postgis.Wkb.Endian Methods showsPrec :: Int -> EndianType -> ShowS # show :: EndianType -> String # showList :: [EndianType] -> ShowS # | |
| Eq EndianType Source # | |
Defined in Database.Esqueleto.Postgis.Wkb.Endian | |
getFourBytes :: EndianType -> Get Word32 Source #
builderFourBytes :: EndianType -> Word32 -> Builder Source #
builderDouble :: EndianType -> Double -> Builder Source #
Point
getPoint :: EndianType -> CoordinateType -> Get GeospatialGeometry Source #
getMultiPoint :: (EndianType -> Get WkbGeometryType) -> EndianType -> CoordinateType -> Get GeospatialGeometry Source #
getGeoPoint :: EndianType -> CoordinateType -> Get GeoPoint Source #
getCoordPoints :: EndianType -> CoordinateType -> Word32 -> Get (Seq GeoPositionWithoutCRS) Source #
builderPoint :: BuilderWkbGeometryType -> EndianType -> GeoPoint -> Builder Source #