<commit_before>{-# LANGUAGE CPP #-}
module GDAL (
    GDAL
  , GDALType
  , ApproxOK (..)
  , DataType (..)
  , HsType
  , TypeK
  , IsComplex
  , Pair (..)
  , pFst
  , pSnd
  , Envelope (..)
  , Size
  , BlockIx

  , GDALException (..)
  , GDALRasterException (..)
  , ProgressException (..)
  , ErrorType (..)
  , ErrorNum (..)
  , isGDALException
  , isBindingException
  , isProgressFunException
  , isInterruptedException

  , Geotransform (..)
  , GroundControlPoint (..)
  , OverviewResampling (..)
  , Driver (..)
  , Dataset
  , OptionList
  , ReadWrite
  , ReadOnly
  , RWDataset
  , RODataset
  , RWBand
  , ROBand
  , Band
  , MaskType (MaskPerBand, MaskPerDataset)
  , Value (..)
  , ProgressFun
  , HasProgressFun (..)
  , HasOptions (..)
  , ContinueOrStop (..)

  , dataType
  , runGDAL
  , runGDAL_
  , withGDAL
  , initializeGDAL
  , cleanupGDAL
  , isNoData
  , fromValue
  , unValueVector
  , catValues

  , create
  , createMem
  , delete
  , rename
  , copyFiles
  , flushCache
  , openReadOnly
  , openReadWrite
  , closeDataset
  , unsafeToReadOnly
  , createCopy
  , buildOverviews

  , bandAs

  , datasetDriver
  , datasetSize
  , datasetFileList
  , datasetProjection
  , setDatasetProjection
  , datasetGeotransform
  , setDatasetGeotransform
  , datasetGCPs
  , setDatasetGCPs
  , datasetBandCount

  , bandDataType
  , bandBlockSize
  , bandBlockCount
  , bandBlockLen
  , bandSize
  , bandHasOverviews
  , allBand
  , sizeLen
  , bandNodataValue
  , setBandNodataValue
  , addBand
  , getBand
  , readBand
  , createBandMask
  , readBandBlock
  , writeBand
  , writeBandBlock
  , copyBand
  , bandConduit
  , unsafeBandConduit
  , bandSink
  , bandSinkGeo
  , fillBand
  , fmapBand
  , blockConduit
  , unsafeBlockConduit
  , blockSink
  , allBlocks
  , blockSource
  , unsafeBlockSource
  , zipBlocks
  , getZipBlocks


  , metadataDomains
  , metadata
  , metadataItem
  , setMetadataItem
  , description
  , setDescription

  , gcp

  , foldl'
  , ifoldl'
  , foldlWindow'
  , ifoldlWindow'
  , version

  , gcpGeotransform
  , northUpGeotransform
  , applyGeotransform
  , (|$|)
  , invertGeotransform
  , inv
  , composeGeotransforms
  , (|.|)
  , geoEnvelopeTransformer

  , liftIO
  , withConfigOption
  , setConfigOption
  , getConfigOption
  , module Data.Conduit
  , def
#if HAVE_EMBEDDED_DATA
  , ensureDataExists
#endif
) where

import Control.Exception (bracket_)
import Control.Monad.IO.Class (liftIO)

import Data.Default (def)
import Data.Conduit

import GDAL.Internal.CPLConv
import GDAL.Internal.CPLError
import GDAL.Internal.CPLString
import GDAL.Internal.CPLProgress
import GDAL.Internal.GCP
import GDAL.Internal.GDAL as GDAL
import GDAL.Internal.Types
import GDAL.Internal.Types.Value
import GDAL.Internal.Common
import OGR (Envelope(..))

import qualified GDAL.Internal.OGR as OGR
import qualified GDAL.Internal.OSR as OSR

#if HAVE_EMBEDDED_DATA
import qualified GDAL.Internal.GDALData as GD
ensureDataExists :: IO ()
ensureDataExists = GD.ensureExists<commit_msg>expose ensureDataExists when not compiled with embeded data<commit_after>{-# LANGUAGE CPP #-}
module GDAL (
    GDAL
  , GDALType
  , ApproxOK (..)
  , DataType (..)
  , HsType
  , TypeK
  , IsComplex
  , Pair (..)
  , pFst
  , pSnd
  , Envelope (..)
  , Size
  , BlockIx

  , GDALException (..)
  , GDALRasterException (..)
  , ProgressException (..)
  , ErrorType (..)
  , ErrorNum (..)
  , isGDALException
  , isBindingException
  , isProgressFunException
  , isInterruptedException

  , Geotransform (..)
  , GroundControlPoint (..)
  , OverviewResampling (..)
  , Driver (..)
  , Dataset
  , OptionList
  , ReadWrite
  , ReadOnly
  , RWDataset
  , RODataset
  , RWBand
  , ROBand
  , Band
  , MaskType (MaskPerBand, MaskPerDataset)
  , Value (..)
  , ProgressFun
  , HasProgressFun (..)
  , HasOptions (..)
  , ContinueOrStop (..)

  , dataType
  , runGDAL
  , runGDAL_
  , withGDAL
  , initializeGDAL
  , cleanupGDAL
  , isNoData
  , fromValue
  , unValueVector
  , catValues

  , create
  , createMem
  , delete
  , rename
  , copyFiles
  , flushCache
  , openReadOnly
  , openReadWrite
  , closeDataset
  , unsafeToReadOnly
  , createCopy
  , buildOverviews

  , bandAs

  , datasetDriver
  , datasetSize
  , datasetFileList
  , datasetProjection
  , setDatasetProjection
  , datasetGeotransform
  , setDatasetGeotransform
  , datasetGCPs
  , setDatasetGCPs
  , datasetBandCount

  , bandDataType
  , bandBlockSize
  , bandBlockCount
  , bandBlockLen
  , bandSize
  , bandHasOverviews
  , allBand
  , sizeLen
  , bandNodataValue
  , setBandNodataValue
  , addBand
  , getBand
  , readBand
  , createBandMask
  , readBandBlock
  , writeBand
  , writeBandBlock
  , copyBand
  , bandConduit
  , unsafeBandConduit
  , bandSink
  , bandSinkGeo
  , fillBand
  , fmapBand
  , blockConduit
  , unsafeBlockConduit
  , blockSink
  , allBlocks
  , blockSource
  , unsafeBlockSource
  , zipBlocks
  , getZipBlocks


  , metadataDomains
  , metadata
  , metadataItem
  , setMetadataItem
  , description
  , setDescription

  , gcp

  , foldl'
  , ifoldl'
  , foldlWindow'
  , ifoldlWindow'
  , version

  , gcpGeotransform
  , northUpGeotransform
  , applyGeotransform
  , (|$|)
  , invertGeotransform
  , inv
  , composeGeotransforms
  , (|.|)
  , geoEnvelopeTransformer

  , liftIO
  , withConfigOption
  , setConfigOption
  , getConfigOption
  , module Data.Conduit
  , def
  , ensureDataExists
) where

import Control.Exception (bracket_)
import Control.Monad.IO.Class (liftIO)

import Data.Default (def)
import Data.Conduit

import GDAL.Internal.CPLConv
import GDAL.Internal.CPLError
import GDAL.Internal.CPLString
import GDAL.Internal.CPLProgress
import GDAL.Internal.GCP
import GDAL.Internal.GDAL as GDAL
import GDAL.Internal.Types
import GDAL.Internal.Types.Value
import GDAL.Internal.Common
import OGR (Envelope(..))

import qualified GDAL.Internal.OGR as OGR
import qualified GDAL.Internal.OSR as OSR

#if HAVE_EMBEDDED_DATA
import qualified GDAL.Internal.GDALData as GD
ensureDataExists :: IO ()
ensureDataExists = GD.ensureExists
#else
import System.IO
ensureDataExists :: IO ()
ensureDataExists =
  hPutStrLn stderr
  "WARNING: bindingsr-gdal have not been compiled with embeded GDAL_DATA" 
{'fraction_non_alphanumeric': 0.09215181730459955, 'fraction_numerical': 0.0, 'mean_word_length': 3.247950819672131, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2581784', 'n_tokens_mistral': 2301, 'n_tokens_neox': 2238, 'n_words': 418}