Copyright | (C) Richard Cook, 2016 |
---|---|

License | MIT |

Maintainer | rcook@rcook.org |

Stability | experimental |

Portability | portable |

Safe Haskell | None |

Language | Haskell2010 |

A high-level API for interoperating with GEOS C API which includes automatic management of lifetimes of objects such as readers, writers and geometries.

For the low-level FFI bindings, see Data.Geolocation.GEOS.Imports.

For the monad transformer wrappers, see Data.Geolocation.GEOS.Trans.

- data Context
- data CoordinateSequence
- data Geometry
- data GeometryType
- data Reader
- data Writer
- area :: Geometry -> IO (Maybe Double)
- createCoordSeq :: Context -> Word -> Word -> IO (Maybe CoordinateSequence)
- createLinearRing :: CoordinateSequence -> IO (Maybe Geometry)
- createPolygon :: Geometry -> [Geometry] -> IO (Maybe Geometry)
- envelope :: Geometry -> IO (Maybe Geometry)
- geomTypeId :: Geometry -> IO (Maybe GeometryType)
- getCoordSeq :: Geometry -> IO (Maybe CoordinateSequence)
- getErrorMessage :: IO String
- getExteriorRing :: Geometry -> IO (Maybe Geometry)
- getGeometry :: Geometry -> Int -> IO (Maybe Geometry)
- getNumGeometries :: Geometry -> IO (Maybe Int)
- getOrdinate :: CoordinateSequence -> Word -> Word -> IO (Maybe Double)
- getSize :: CoordinateSequence -> IO (Maybe Word)
- getX :: CoordinateSequence -> Word -> IO (Maybe Double)
- getY :: CoordinateSequence -> Word -> IO (Maybe Double)
- getZ :: CoordinateSequence -> Word -> IO (Maybe Double)
- intersection :: Geometry -> Geometry -> IO (Maybe Geometry)
- isEmpty :: Geometry -> IO (Maybe Bool)
- mkReader :: Context -> IO (Maybe Reader)
- mkWriter :: Context -> IO (Maybe Writer)
- readGeometry :: Reader -> String -> IO (Maybe Geometry)
- setOrdinate :: CoordinateSequence -> Word -> Word -> Double -> IO (Maybe ())
- setX :: CoordinateSequence -> Word -> Double -> IO (Maybe ())
- setY :: CoordinateSequence -> Word -> Double -> IO (Maybe ())
- setZ :: CoordinateSequence -> Word -> Double -> IO (Maybe ())
- version :: IO String
- withGEOS :: (Context -> IO a) -> IO a
- writeGeometry :: Writer -> Geometry -> IO (Maybe String)

# Documentation

data CoordinateSequence Source

References a GEOS coordinate sequence

data GeometryType Source

Represents a GEOS geometry type ID

createCoordSeq :: Context -> Word -> Word -> IO (Maybe CoordinateSequence) Source

Creates an empty `CoordinateSequence`

instance

createLinearRing :: CoordinateSequence -> IO (Maybe Geometry) Source

Returns a linear ring `Geometry`

instance from the given coordinate
sequence

createPolygon :: Geometry -> [Geometry] -> IO (Maybe Geometry) Source

Returns a polygon `Geometry`

instance from the given shell and optional
array of holes

geomTypeId :: Geometry -> IO (Maybe GeometryType) Source

Returns type of a `Geometry`

instance

getCoordSeq :: Geometry -> IO (Maybe CoordinateSequence) Source

Returns a `CoordinateSequence`

from the supplied `Geometry`

getErrorMessage :: IO String Source

Returns message in case of error

getNumGeometries :: Geometry -> IO (Maybe Int) Source

Gets the number of geometries in a `Geometry`

instance

getOrdinate :: CoordinateSequence -> Word -> Word -> IO (Maybe Double) Source

Gets an ordinate value from a coordinate sequence

getX :: CoordinateSequence -> Word -> IO (Maybe Double) Source

Gets an x-ordinate value from a coordinate sequence

getY :: CoordinateSequence -> Word -> IO (Maybe Double) Source

Gets a y-ordinate value from a coordinate sequence

getZ :: CoordinateSequence -> Word -> IO (Maybe Double) Source

Gets a z-ordinate value from a coordinate sequence

isEmpty :: Geometry -> IO (Maybe Bool) Source

Returns value indicating if specified `Geometry`

instance is empty

setOrdinate :: CoordinateSequence -> Word -> Word -> Double -> IO (Maybe ()) Source

Sets an x-ordinate value within a coordinate sequence

setX :: CoordinateSequence -> Word -> Double -> IO (Maybe ()) Source

Sets an x-ordinate value within a coordinate sequence

setY :: CoordinateSequence -> Word -> Double -> IO (Maybe ()) Source

Sets a y-ordinate value within a coordinate sequence

setZ :: CoordinateSequence -> Word -> Double -> IO (Maybe ()) Source

Sets a z-ordinate value within a coordinate sequence