-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Slippy map tile functionality. -- -- Tile/lonlat conversion utilities for slippy maps. @package tile @version 0.3.0.0 -- | This module provides types and functions for manipulating tiles, -- latitude/longitude pairs, and pixels. -- -- See the associated README.md for basic usage examples. module Data.Tile -- | Newtype wrapper around map zoom level. newtype Z Z :: Int -> Z -- | Newtype wrapper around a tile's x-coordinate. newtype X X :: Int -> X -- | Newtype wrapper around a tile's y-coordinate. newtype Y Y :: Int -> Y -- | Newtype wrapper around a triple of Z, X, and Y -- representing a single tile in a map's tile system. newtype Tile Tile :: (Z, X, Y) -> Tile -- | Newtype wrapper around longitude. newtype Lng Lng :: Double -> Lng -- | Newtype wrapper around latitude. newtype Lat Lat :: Double -> Lat -- | Newtype wrapper around a tuple of Lng and Lat -- representing a WGS84 latitude and longitude on the map. newtype LngLat LngLat :: (Lng, Lat) -> LngLat -- | Newtype wrapper around a pixel's x-coordinate newtype Px Px :: Int -> Px -- | Newtype wrapper around a pixel's y-coordinate newtype Py Py :: Int -> Py -- | Newtype wrapper around a tuple of Px and Py representing -- a single pixel. newtype Pixel Pixel :: (Px, Py) -> Pixel -- | Datatype representing the origin point of a bounding box. data BoxOrigin -- | Indicates that the origin is in the southwest corner of the bbox, and -- the second point is in the northeast corner of the bbox. SW :: BoxOrigin -- | Indicates that the origin is in the northwest corner of the bbox, and -- the second point is in the southeast corner of the bbox. NW :: BoxOrigin -- | Datatype representing the bounds of a tile as a BoxOrigin and -- two LngLat values. data TileBounds TileBounds :: BoxOrigin -> LngLat -> LngLat -> TileBounds -- | Get the maximum index a tile can have along a given dimension, x or y. maxTileIndex :: Z -> Int -- | Get the numbers of tiles in a given dimension, x or y, at the -- specified map zoom level. maxTilesInDimension :: Z -> Int -- | Get the number of pixels in a given dimension, x or y, assuming a tile -- is 256x256px. maxPixelsInDimension :: Z -> Int -- | Given a Tile, flip its y-coordinate according to the rules of -- TMS. flipY :: Tile -> Tile -- | Given a Tile, return a list of its four subtiles. subTiles :: Tile -> [Tile] -- | Given a Tile, return its parent Tile, if it has one. parentTile :: Tile -> Maybe Tile -- | Smart constructor for tiles. Validates that the X and Y -- values are valid for the value of Z. mkTile :: Z -> X -> Y -> Maybe Tile -- | Given a BoxOrigin, a Z, and a pair of LngLats, -- return a list of all tiles touching or within the bounding box. tilesInBounds :: BoxOrigin -> Z -> (LngLat, LngLat) -> [Tile] -- | Convert a Tile to a Pixel assuming a tile size of -- 256x256px. tileToPixel :: Tile -> Pixel -- | Convert a LngLat into a Pixel. lngLatToPixel :: Z -> LngLat -> Pixel -- | Convert a Pixel into a Tile assuming a tile size of -- 256x256px. pixelToTile :: Z -> Pixel -> Tile -- | Convert a LngLat into a Tile. lngLatToTile :: Z -> LngLat -> Tile -- | Convert a Pixel into a LngLat assuming map resolution as -- defined at the equator. pixelToLngLat :: Z -> Pixel -> LngLat -- | Convert a Tile into a LngLat. tileToLngLat :: Tile -> LngLat -- | Convert a Tile into a TileBounds value representing the -- bounding box of that tile. tileToBounds :: BoxOrigin -> Tile -> TileBounds instance GHC.Classes.Eq Data.Tile.TileBounds instance GHC.Show.Show Data.Tile.TileBounds instance GHC.Classes.Eq Data.Tile.BoxOrigin instance GHC.Show.Show Data.Tile.BoxOrigin instance GHC.Classes.Ord Data.Tile.Pixel instance GHC.Classes.Eq Data.Tile.Pixel instance GHC.Show.Show Data.Tile.Pixel instance GHC.Classes.Ord Data.Tile.Py instance GHC.Classes.Eq Data.Tile.Py instance GHC.Show.Show Data.Tile.Py instance GHC.Classes.Ord Data.Tile.Px instance GHC.Classes.Eq Data.Tile.Px instance GHC.Show.Show Data.Tile.Px instance GHC.Classes.Ord Data.Tile.LngLat instance GHC.Classes.Eq Data.Tile.LngLat instance GHC.Show.Show Data.Tile.LngLat instance GHC.Classes.Ord Data.Tile.Lat instance GHC.Classes.Eq Data.Tile.Lat instance GHC.Show.Show Data.Tile.Lat instance GHC.Classes.Ord Data.Tile.Lng instance GHC.Classes.Eq Data.Tile.Lng instance GHC.Show.Show Data.Tile.Lng instance GHC.Classes.Ord Data.Tile.Tile instance GHC.Classes.Eq Data.Tile.Tile instance GHC.Show.Show Data.Tile.Tile instance GHC.Classes.Ord Data.Tile.Y instance GHC.Classes.Eq Data.Tile.Y instance GHC.Show.Show Data.Tile.Y instance GHC.Classes.Ord Data.Tile.X instance GHC.Classes.Eq Data.Tile.X instance GHC.Show.Show Data.Tile.X instance GHC.Classes.Ord Data.Tile.Z instance GHC.Classes.Eq Data.Tile.Z instance GHC.Show.Show Data.Tile.Z instance GHC.Enum.Bounded Data.Tile.Lng instance GHC.Enum.Bounded Data.Tile.Lat