hgeos-0.1.1.0: Simple Haskell bindings to GEOS C API

Copyright(C) Richard Cook, 2016
LicenseMIT
Maintainerrcook@rcook.org
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Data.Geolocation.GEOS

Description

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.

Synopsis

Documentation

data Context Source

Represents a GEOS context

data CoordinateSequence Source

References a GEOS coordinate sequence

data Geometry Source

References a GEOS geometry

data Reader Source

References a WKT reader

data Writer Source

References a WKT writer

envelope :: Geometry -> IO Geometry Source

Returns a Geometry instance representing the envelope of the supplied Geometry

exteriorRing :: Geometry -> IO Geometry Source

Returns a Geometry instance representing the exterior ring of the supplied Geometry

intersection :: Geometry -> Geometry -> IO Geometry Source

Returns a Geometry instance representing the intersection of the two supplied Geometry instances:

mkReader :: Context -> IO Reader Source

Creates a reader used to deserialize Geometry instances from WKT-format text:

mkWriter :: Context -> IO Writer Source

Creates a writer used to serialize Geometry instances to WKT-format text:

readGeometry :: Reader -> String -> IO Geometry Source

Deserializes a Geometry instance from the given String using the supplied Reader:

withContext :: (Context -> IO a) -> IO a Source

Creates a GEOS context, passes it to a block and releases the context and all associated objects such as readers, writers and geometries at the end:

   withContext $ ctx -> do

       -- Use context

       return ()

writeGeometry :: Writer -> Geometry -> IO String Source

Serializes a Geometry instance to a String using the supplied Writer: