Safe Haskell | None |
---|---|
Language | Haskell2010 |
Light wrappers around Geos functions. Must be run within the Geos monad.
- newtype Geom = Geom {}
- newtype GeomConst = GeomConst {}
- class Geometry a where
- type CoordSeqInput a
- data GeomTypeId
- withMaybeGeometry :: Geometry a => Maybe a -> (Ptr GEOSGeometry -> IO b) -> IO b
- getSRID :: Geometry a => a -> Geos (Maybe Int)
- setSRID :: Geometry a => Maybe Int -> a -> Geos a
- getTypeName :: Geometry a => a -> Geos String
- getTypeId :: Geometry a => a -> Geos GeomTypeId
- getCoordinateSequence :: Geometry a => a -> Geos CoordSeq
- getNumCoordinates :: Geometry a => a -> Geos Int
- getNumInteriorRings :: Geometry a => a -> Geos Int
- getNumGeometries :: Geometry a => a -> Geos Int
- getInteriorRingN :: Geometry a => a -> Int -> Geos GeomConst
- getGeometryN :: Geometry a => a -> Int -> Geos GeomConst
- getExteriorRing :: Geometry a => a -> Geos GeomConst
- createPoint :: Geometry b => CoordSeqConst -> Geos b
- createLinearRing :: Geometry a => CoordSeqConst -> Geos a
- createLineString :: Geometry b => CoordSeqConst -> Geos b
- createPolygon :: Geometry a => GeomConst -> [GeomConst] -> Geos a
- createMultiPoint :: Geometry a => [GeomConst] -> Geos a
- createMultiLineString :: Geometry a => [GeomConst] -> Geos a
- createMultiPolygon :: Geometry a => [GeomConst] -> Geos a
- createCollection :: Geometry a => [GeomConst] -> Geos a
- project :: Geometry a => a -> a -> Geos Double
- projectNormalized :: Geometry a => a -> a -> Geos Double
- interpolate :: Geometry a => a -> Double -> Geos Geom
- interpolateNormalized :: Geometry a => a -> Double -> Geos Geom
- disjoint :: Geometry a => a -> a -> Geos Bool
- touches :: Geometry a => a -> a -> Geos Bool
- intersects :: Geometry a => a -> a -> Geos Bool
- crosses :: Geometry a => a -> a -> Geos Bool
- within :: Geometry a => a -> a -> Geos Bool
- contains :: Geometry a => a -> a -> Geos Bool
- overlaps :: Geometry a => a -> a -> Geos Bool
- equals :: Geometry a => a -> a -> Geos Bool
- equalsExact :: Geometry a => a -> a -> Double -> Geos Bool
- covers :: Geometry a => a -> a -> Geos Bool
- coveredBy :: Geometry a => a -> a -> Geos Bool
- area :: Geometry a => a -> Geos Double
- geometryLength :: Geometry a => a -> Geos Double
- distance :: Geometry a => a -> a -> Geos Double
- hausdorffDistance :: Geometry a => a -> a -> Geos Double
- nearestPoints :: (Geometry a, CoordinateSequence b) => a -> a -> Geos b
- normalize :: Geometry a => a -> Geos a
Documentation
A Geom is a wrapper around the C data structure that has finalizers associated with it.
A GeomConst is a wrapper around the C data structure that does *not* have finalizers attached to it. A typical use case for GemoConst is when retrieving a child geometry from a composite geometry. If the parent geometry has finalizers associated with it, we can not separately attempt to deallocate memory occupied by the child geometry.
class Geometry a where Source #
type CoordSeqInput a Source #
withGeometry :: a -> (Ptr GEOSGeometry -> IO b) -> IO b Source #
constructGeometry :: GEOSContextHandle_t -> Ptr GEOSGeometry -> IO a Source #
data GeomTypeId Source #
withMaybeGeometry :: Geometry a => Maybe a -> (Ptr GEOSGeometry -> IO b) -> IO b Source #
createPoint :: Geometry b => CoordSeqConst -> Geos b Source #
The following require CoordSeqConst as arguments since coordinate sequences become owned by the Geometry object.
createLinearRing :: Geometry a => CoordSeqConst -> Geos a Source #
createLineString :: Geometry b => CoordSeqConst -> Geos b Source #
createPolygon :: Geometry a => GeomConst -> [GeomConst] -> Geos a Source #
The second argument is a list of geometries, | NOTE. geometries become owned by caller.
project :: Geometry a => a -> a -> Geos Double Source #
project p g
returns the distance of point p
projected on g
from origin of g
. Geometry g
must be a lineal geometry
interpolate :: Geometry a => a -> Double -> Geos Geom Source #
Return the closest point to given distance within geometry. Geometry must be a LineString
nearestPoints :: (Geometry a, CoordinateSequence b) => a -> a -> Geos b Source #