Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data MbtilesT m a
- type Mbtiles a = MbtilesT IO a
- type MbtilesMeta = HashMap Text Text
- data MBTilesError
- newtype Z = Z Int
- newtype X = X Int
- newtype Y = Y Int
- runMbtilesT :: MonadIO m => FilePath -> MbtilesT m a -> m (Either MBTilesError a)
- runMbtiles :: FilePath -> Mbtiles a -> IO (Either MBTilesError a)
- getTile :: (MonadIO m, FromTile a) => Z -> X -> Y -> MbtilesT m (Maybe a)
- writeTile :: (MonadIO m, ToTile a) => Z -> X -> Y -> a -> MbtilesT m ()
- writeTiles :: (MonadIO m, ToTile a) => [(Z, X, Y, a)] -> MbtilesT m ()
- updateTile :: (MonadIO m, ToTile a) => Z -> X -> Y -> a -> MbtilesT m ()
- updateTiles :: (MonadIO m, ToTile a) => [(Z, X, Y, a)] -> MbtilesT m ()
- getMetadata :: MonadIO m => MbtilesT m MbtilesMeta
- getName :: MonadIO m => MbtilesT m Text
- getType :: MonadIO m => MbtilesT m Text
- getVersion :: MonadIO m => MbtilesT m Text
- getDescription :: MonadIO m => MbtilesT m Text
- getFormat :: MonadIO m => MbtilesT m Text
Types
MbtilesT monad that will run actions on an MBTiles file.
type MbtilesMeta = HashMap Text Text Source #
MBTiles files contain metadata in one of their tables. This is a type alias for a mapping between the metadata key and the metadata value.
data MBTilesError Source #
Data type representing various errors that could occur when opening and validating an MBTiles file.
DoesNotExist | The MBTiles file does not exist. |
InvalidSchema | The MBTiles schema is invalid according to the spec. |
InvalidMetadata | The MBTiles |
InvalidTiles | The MBTiles |
The MbtilesT monad transformer
runMbtilesT :: MonadIO m => FilePath -> MbtilesT m a -> m (Either MBTilesError a) Source #
Given a path to an MBTiles file, run the MbtilesT
action.
This will open a connection to the MBTiles file, run the action,
and then close the connection.
Some validation will be performed first. Of course, we will check if the
MBTiles file actually exists. If it does, we need to validate its schema according
to the MBTiles spec.
runMbtiles :: FilePath -> Mbtiles a -> IO (Either MBTilesError a) Source #
Specialized version of runMbtilesT
to run in the IO monad.
Mbtiles read/write functionality
Mbtiles metadata functionality
getMetadata :: MonadIO m => MbtilesT m MbtilesMeta Source #
Returns the MbtilesMeta
that was found in the MBTiles file.
This returns all of the currently available metadata for the MBTiles database.
getName :: MonadIO m => MbtilesT m Text Source #
Helper function for getting the specified name of the MBTiles from metadata.
getType :: MonadIO m => MbtilesT m Text Source #
Helper function for getting the type of the MBTiles from metadata.
getVersion :: MonadIO m => MbtilesT m Text Source #
Helper function for getting the version of the MBTiles from metadata.