{-# LANGUAGE EmptyDataDecls, FlexibleContexts, FlexibleInstances,
  ForeignFunctionInterface, IncoherentInstances,
  MultiParamTypeClasses, OverlappingInstances, TemplateHaskell,
  TypeFamilies, TypeSynonymInstances #-}
module GDAL.OGRGeometry.Implementation where
import Data.Monoid
import Data.Word
import Data.Int
import Foreign.C
import Foreign.Ptr
import Language.Haskell.TH
import Language.Haskell.TH.Syntax
import System.IO.Unsafe
import FFICXX.Runtime.Cast
import FFICXX.Runtime.CodeGen.Cxx
import FFICXX.Runtime.TH
import GDAL.OGRGeometry.RawType
import GDAL.OGRGeometry.FFI
import GDAL.OGRGeometry.Interface
import GDAL.OGRGeometry.Cast
import GDAL.OGRGeometry.RawType
import GDAL.OGRGeometry.Cast
import GDAL.OGRGeometry.Interface
import GDAL.OGRPolygon.RawType
import GDAL.OGRPolygon.Cast
import GDAL.OGRPolygon.Interface
import GDAL.OGRMultiPolygon.RawType
import GDAL.OGRMultiPolygon.Cast
import GDAL.OGRMultiPolygon.Interface
import GDAL.OGREnvelope.RawType
import GDAL.OGREnvelope.Cast
import GDAL.OGREnvelope.Interface
import GDAL.OGRPoint.RawType
import GDAL.OGRPoint.Cast
import GDAL.OGRPoint.Interface
import STD.Deletable.RawType
import STD.Deletable.Cast
import STD.Deletable.Interface

instance () => IOGRGeometry (OGRGeometry) where
        getGeometryType :: OGRGeometry -> IO CUInt
getGeometryType = (Ptr RawOGRGeometry -> IO CUInt) -> OGRGeometry -> IO CUInt
forall a ca y cy.
(Castable a ca, Castable y cy) =>
(ca -> IO cy) -> a -> IO y
xform0 Ptr RawOGRGeometry -> IO CUInt
c_ogrgeometry_getgeometrytype
        getEnvelope :: forall c0. (IOGREnvelope c0, FPtr c0) => OGRGeometry -> c0 -> IO ()
getEnvelope = (Ptr RawOGRGeometry -> Ptr RawOGREnvelope -> IO ())
-> OGRGeometry -> c0 -> IO ()
forall a ca x1 cx1 y cy.
(Castable a ca, Castable x1 cx1, Castable y cy) =>
(ca -> cx1 -> IO cy) -> a -> x1 -> IO y
xform1 Ptr RawOGRGeometry -> Ptr RawOGREnvelope -> IO ()
c_ogrgeometry_getenvelope
        intersects :: forall c0.
(IOGRGeometry c0, FPtr c0) =>
OGRGeometry -> c0 -> IO CBool
intersects = (Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO CBool)
-> OGRGeometry -> c0 -> IO CBool
forall a ca x1 cx1 y cy.
(Castable a ca, Castable x1 cx1, Castable y cy) =>
(ca -> cx1 -> IO cy) -> a -> x1 -> IO y
xform1 Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO CBool
c_ogrgeometry_intersects
        equals :: forall c0.
(IOGRGeometry c0, FPtr c0) =>
OGRGeometry -> c0 -> IO CBool
equals = (Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO CBool)
-> OGRGeometry -> c0 -> IO CBool
forall a ca x1 cx1 y cy.
(Castable a ca, Castable x1 cx1, Castable y cy) =>
(ca -> cx1 -> IO cy) -> a -> x1 -> IO y
xform1 Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO CBool
c_ogrgeometry_equals
        disjoint :: forall c0.
(IOGRGeometry c0, FPtr c0) =>
OGRGeometry -> c0 -> IO CBool
disjoint = (Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO CBool)
-> OGRGeometry -> c0 -> IO CBool
forall a ca x1 cx1 y cy.
(Castable a ca, Castable x1 cx1, Castable y cy) =>
(ca -> cx1 -> IO cy) -> a -> x1 -> IO y
xform1 Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO CBool
c_ogrgeometry_disjoint
        touches :: forall c0.
(IOGRGeometry c0, FPtr c0) =>
OGRGeometry -> c0 -> IO CBool
touches = (Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO CBool)
-> OGRGeometry -> c0 -> IO CBool
forall a ca x1 cx1 y cy.
(Castable a ca, Castable x1 cx1, Castable y cy) =>
(ca -> cx1 -> IO cy) -> a -> x1 -> IO y
xform1 Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO CBool
c_ogrgeometry_touches
        crosses :: forall c0.
(IOGRGeometry c0, FPtr c0) =>
OGRGeometry -> c0 -> IO CBool
crosses = (Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO CBool)
-> OGRGeometry -> c0 -> IO CBool
forall a ca x1 cx1 y cy.
(Castable a ca, Castable x1 cx1, Castable y cy) =>
(ca -> cx1 -> IO cy) -> a -> x1 -> IO y
xform1 Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO CBool
c_ogrgeometry_crosses
        within :: forall c0.
(IOGRGeometry c0, FPtr c0) =>
OGRGeometry -> c0 -> IO CBool
within = (Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO CBool)
-> OGRGeometry -> c0 -> IO CBool
forall a ca x1 cx1 y cy.
(Castable a ca, Castable x1 cx1, Castable y cy) =>
(ca -> cx1 -> IO cy) -> a -> x1 -> IO y
xform1 Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO CBool
c_ogrgeometry_within
        contains :: forall c0.
(IOGRGeometry c0, FPtr c0) =>
OGRGeometry -> c0 -> IO CBool
contains = (Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO CBool)
-> OGRGeometry -> c0 -> IO CBool
forall a ca x1 cx1 y cy.
(Castable a ca, Castable x1 cx1, Castable y cy) =>
(ca -> cx1 -> IO cy) -> a -> x1 -> IO y
xform1 Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO CBool
c_ogrgeometry_contains
        overlaps :: forall c0.
(IOGRGeometry c0, FPtr c0) =>
OGRGeometry -> c0 -> IO CBool
overlaps = (Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO CBool)
-> OGRGeometry -> c0 -> IO CBool
forall a ca x1 cx1 y cy.
(Castable a ca, Castable x1 cx1, Castable y cy) =>
(ca -> cx1 -> IO cy) -> a -> x1 -> IO y
xform1 Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO CBool
c_ogrgeometry_overlaps
        boundary :: OGRGeometry -> IO OGRGeometry
boundary = (Ptr RawOGRGeometry -> IO (Ptr RawOGRGeometry))
-> OGRGeometry -> IO OGRGeometry
forall a ca y cy.
(Castable a ca, Castable y cy) =>
(ca -> IO cy) -> a -> IO y
xform0 Ptr RawOGRGeometry -> IO (Ptr RawOGRGeometry)
c_ogrgeometry_boundary
        distance :: forall c0.
(IOGRGeometry c0, FPtr c0) =>
OGRGeometry -> c0 -> IO CDouble
distance = (Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO CDouble)
-> OGRGeometry -> c0 -> IO CDouble
forall a ca x1 cx1 y cy.
(Castable a ca, Castable x1 cx1, Castable y cy) =>
(ca -> cx1 -> IO cy) -> a -> x1 -> IO y
xform1 Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO CDouble
c_ogrgeometry_distance
        convexHull :: OGRGeometry -> IO OGRGeometry
convexHull = (Ptr RawOGRGeometry -> IO (Ptr RawOGRGeometry))
-> OGRGeometry -> IO OGRGeometry
forall a ca y cy.
(Castable a ca, Castable y cy) =>
(ca -> IO cy) -> a -> IO y
xform0 Ptr RawOGRGeometry -> IO (Ptr RawOGRGeometry)
c_ogrgeometry_convexhull
        buffer :: OGRGeometry -> CDouble -> CInt -> IO OGRGeometry
buffer = (Ptr RawOGRGeometry -> CDouble -> CInt -> IO (Ptr RawOGRGeometry))
-> OGRGeometry -> CDouble -> CInt -> IO OGRGeometry
forall a ca x1 cx1 x2 cx2 y cy.
(Castable a ca, Castable x1 cx1, Castable x2 cx2, Castable y cy) =>
(ca -> cx1 -> cx2 -> IO cy) -> a -> x1 -> x2 -> IO y
xform2 Ptr RawOGRGeometry -> CDouble -> CInt -> IO (Ptr RawOGRGeometry)
c_ogrgeometry_buffer
        intersection :: forall c0.
(IOGRGeometry c0, FPtr c0) =>
OGRGeometry -> c0 -> IO OGRGeometry
intersection = (Ptr RawOGRGeometry
 -> Ptr RawOGRGeometry -> IO (Ptr RawOGRGeometry))
-> OGRGeometry -> c0 -> IO OGRGeometry
forall a ca x1 cx1 y cy.
(Castable a ca, Castable x1 cx1, Castable y cy) =>
(ca -> cx1 -> IO cy) -> a -> x1 -> IO y
xform1 Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO (Ptr RawOGRGeometry)
c_ogrgeometry_intersection
        union :: forall c0.
(IOGRGeometry c0, FPtr c0) =>
OGRGeometry -> c0 -> IO OGRGeometry
union = (Ptr RawOGRGeometry
 -> Ptr RawOGRGeometry -> IO (Ptr RawOGRGeometry))
-> OGRGeometry -> c0 -> IO OGRGeometry
forall a ca x1 cx1 y cy.
(Castable a ca, Castable x1 cx1, Castable y cy) =>
(ca -> cx1 -> IO cy) -> a -> x1 -> IO y
xform1 Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO (Ptr RawOGRGeometry)
c_ogrgeometry_union
        unionCascaded :: OGRGeometry -> IO OGRGeometry
unionCascaded = (Ptr RawOGRGeometry -> IO (Ptr RawOGRGeometry))
-> OGRGeometry -> IO OGRGeometry
forall a ca y cy.
(Castable a ca, Castable y cy) =>
(ca -> IO cy) -> a -> IO y
xform0 Ptr RawOGRGeometry -> IO (Ptr RawOGRGeometry)
c_ogrgeometry_unioncascaded
        difference :: forall c0.
(IOGRGeometry c0, FPtr c0) =>
OGRGeometry -> c0 -> IO OGRGeometry
difference = (Ptr RawOGRGeometry
 -> Ptr RawOGRGeometry -> IO (Ptr RawOGRGeometry))
-> OGRGeometry -> c0 -> IO OGRGeometry
forall a ca x1 cx1 y cy.
(Castable a ca, Castable x1 cx1, Castable y cy) =>
(ca -> cx1 -> IO cy) -> a -> x1 -> IO y
xform1 Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO (Ptr RawOGRGeometry)
c_ogrgeometry_difference
        symDifference :: forall c0.
(IOGRGeometry c0, FPtr c0) =>
OGRGeometry -> c0 -> IO OGRGeometry
symDifference = (Ptr RawOGRGeometry
 -> Ptr RawOGRGeometry -> IO (Ptr RawOGRGeometry))
-> OGRGeometry -> c0 -> IO OGRGeometry
forall a ca x1 cx1 y cy.
(Castable a ca, Castable x1 cx1, Castable y cy) =>
(ca -> cx1 -> IO cy) -> a -> x1 -> IO y
xform1 Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO (Ptr RawOGRGeometry)
c_ogrgeometry_symdifference
        centroid :: forall c0. (IOGRPoint c0, FPtr c0) => OGRGeometry -> c0 -> IO CInt
centroid = (Ptr RawOGRGeometry -> Ptr RawOGRPoint -> IO CInt)
-> OGRGeometry -> c0 -> IO CInt
forall a ca x1 cx1 y cy.
(Castable a ca, Castable x1 cx1, Castable y cy) =>
(ca -> cx1 -> IO cy) -> a -> x1 -> IO y
xform1 Ptr RawOGRGeometry -> Ptr RawOGRPoint -> IO CInt
c_ogrgeometry_centroid
        simplify :: OGRGeometry -> CDouble -> IO OGRGeometry
simplify = (Ptr RawOGRGeometry -> CDouble -> IO (Ptr RawOGRGeometry))
-> OGRGeometry -> CDouble -> IO OGRGeometry
forall a ca x1 cx1 y cy.
(Castable a ca, Castable x1 cx1, Castable y cy) =>
(ca -> cx1 -> IO cy) -> a -> x1 -> IO y
xform1 Ptr RawOGRGeometry -> CDouble -> IO (Ptr RawOGRGeometry)
c_ogrgeometry_simplify
        delaunayTriangulation :: OGRGeometry -> CDouble -> CInt -> IO OGRGeometry
delaunayTriangulation = (Ptr RawOGRGeometry -> CDouble -> CInt -> IO (Ptr RawOGRGeometry))
-> OGRGeometry -> CDouble -> CInt -> IO OGRGeometry
forall a ca x1 cx1 x2 cx2 y cy.
(Castable a ca, Castable x1 cx1, Castable x2 cx2, Castable y cy) =>
(ca -> cx1 -> cx2 -> IO cy) -> a -> x1 -> x2 -> IO y
xform2 Ptr RawOGRGeometry -> CDouble -> CInt -> IO (Ptr RawOGRGeometry)
c_ogrgeometry_delaunaytriangulation
        polygonize :: OGRGeometry -> IO OGRGeometry
polygonize = (Ptr RawOGRGeometry -> IO (Ptr RawOGRGeometry))
-> OGRGeometry -> IO OGRGeometry
forall a ca y cy.
(Castable a ca, Castable y cy) =>
(ca -> IO cy) -> a -> IO y
xform0 Ptr RawOGRGeometry -> IO (Ptr RawOGRGeometry)
c_ogrgeometry_polygonize
        distance3D :: forall c0.
(IOGRGeometry c0, FPtr c0) =>
OGRGeometry -> c0 -> IO CDouble
distance3D = (Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO CDouble)
-> OGRGeometry -> c0 -> IO CDouble
forall a ca x1 cx1 y cy.
(Castable a ca, Castable x1 cx1, Castable y cy) =>
(ca -> cx1 -> IO cy) -> a -> x1 -> IO y
xform1 Ptr RawOGRGeometry -> Ptr RawOGRGeometry -> IO CDouble
c_ogrgeometry_distance3d

instance () => IDeletable (OGRGeometry) where
        delete :: OGRGeometry -> IO ()
delete = (Ptr RawOGRGeometry -> IO ()) -> OGRGeometry -> IO ()
forall a ca y cy.
(Castable a ca, Castable y cy) =>
(ca -> IO cy) -> a -> IO y
xform0 Ptr RawOGRGeometry -> IO ()
c_ogrgeometry_delete

oGRGeometry_SimplifyPreserveTopology ::
                                       () => OGRGeometry -> CDouble -> IO OGRGeometry
oGRGeometry_SimplifyPreserveTopology :: OGRGeometry -> CDouble -> IO OGRGeometry
oGRGeometry_SimplifyPreserveTopology
  = (Ptr RawOGRGeometry -> CDouble -> IO (Ptr RawOGRGeometry))
-> OGRGeometry -> CDouble -> IO OGRGeometry
forall a ca x1 cx1 y cy.
(Castable a ca, Castable x1 cx1, Castable y cy) =>
(ca -> cx1 -> IO cy) -> a -> x1 -> IO y
xform1 Ptr RawOGRGeometry -> CDouble -> IO (Ptr RawOGRGeometry)
c_ogrgeometry_ogrgeometry_simplifypreservetopology

oGRGeometry_toPolygon :: () => OGRGeometry -> IO OGRPolygon
oGRGeometry_toPolygon :: OGRGeometry -> IO OGRPolygon
oGRGeometry_toPolygon = (Ptr RawOGRGeometry -> IO (Ptr RawOGRPolygon))
-> OGRGeometry -> IO OGRPolygon
forall a ca y cy.
(Castable a ca, Castable y cy) =>
(ca -> IO cy) -> a -> IO y
xform0 Ptr RawOGRGeometry -> IO (Ptr RawOGRPolygon)
c_ogrgeometry_ogrgeometry_topolygon

oGRGeometry_toMultiPolygon ::
                             () => OGRGeometry -> IO OGRMultiPolygon
oGRGeometry_toMultiPolygon :: OGRGeometry -> IO OGRMultiPolygon
oGRGeometry_toMultiPolygon
  = (Ptr RawOGRGeometry -> IO (Ptr RawOGRMultiPolygon))
-> OGRGeometry -> IO OGRMultiPolygon
forall a ca y cy.
(Castable a ca, Castable y cy) =>
(ca -> IO cy) -> a -> IO y
xform0 Ptr RawOGRGeometry -> IO (Ptr RawOGRMultiPolygon)
c_ogrgeometry_ogrgeometry_tomultipolygon