Copyright | (c) Joe Canero 2017 |
---|---|
License | BSD3 |
Maintainer | jmc41493@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe |
Language | Haskell2010 |
This module provides types and functions for manipulating tiles, latitude/longitude pairs, and pixels.
See the associated README.md for basic usage examples.
- newtype Z = Z Int
- newtype X = X Int
- newtype Y = Y Int
- newtype Tile = Tile (Z, X, Y)
- newtype Lng = Lng Double
- newtype Lat = Lat Double
- newtype LngLat = LngLat (Lng, Lat)
- newtype Px = Px Int
- newtype Py = Py Int
- newtype Pixel = Pixel (Px, Py)
- data BoxOrigin
- data TileBounds = TileBounds BoxOrigin LngLat LngLat
- maxTileIndex :: Z -> Int
- maxTilesInDimension :: Z -> Int
- maxPixelsInDimension :: Z -> Int
- flipY :: Tile -> Tile
- subTiles :: Tile -> [Tile]
- parentTile :: Tile -> Maybe Tile
- mkTile :: Z -> X -> Y -> Maybe Tile
- tilesInBounds :: BoxOrigin -> Z -> (LngLat, LngLat) -> [Tile]
- tileToPixel :: Tile -> Pixel
- lngLatToPixel :: Z -> LngLat -> Pixel
- pixelToTile :: Z -> Pixel -> Tile
- lngLatToTile :: Z -> LngLat -> Tile
- pixelToLngLat :: Z -> Pixel -> LngLat
- tileToLngLat :: Tile -> LngLat
- tileToBounds :: BoxOrigin -> Tile -> TileBounds
Types
Newtype wrapper around map zoom level.
Newtype wrapper around a tile's x-coordinate.
Newtype wrapper around a tile's y-coordinate.
Newtype wrapper around longitude.
Newtype wrapper around latitude.
Newtype wrapper around a pixel's x-coordinate
Newtype wrapper around a pixel's y-coordinate
Datatype representing the origin point of a bounding box.
data TileBounds Source #
Functions
Tile functionality
maxTileIndex :: Z -> Int Source #
Get the maximum index a tile can have along a given dimension, x or y.
maxTilesInDimension :: Z -> Int Source #
Get the numbers of tiles in a given dimension, x or y, at the specified map zoom level.
maxPixelsInDimension :: Z -> Int Source #
Get the number of pixels in a given dimension, x or y, assuming a tile is 256x256px.
Conversions
To Pixel
To Tile
To LngLat
To TileBounds
tileToBounds :: BoxOrigin -> Tile -> TileBounds Source #
Convert a Tile
into a TileBounds
value representing
the bounding box of that tile.