Documentation ¶
Index ¶
Constants ¶
const LatMax = 90
const LonMax = 180
const MaxZoom = 22
MaxZoom is the lowest zoom (furthest in)
const MvtTileDim = 4096.0
MvtTileDim is the number of pixels in a tile
const WebMercatorMax = 20037508.34
WebMercatorMax is the max size in meters of a tile
Variables ¶
This section is empty.
Functions ¶
func PixelsToNative ¶
PixelsToProjectedUnits scalar conversion of pixels into projected units TODO (@ear7h): this only considers the tile's native width
Types ¶
type Grid ¶
type Grid interface { // SRID returns the SRID of the coordinate system of the // implementer. The geomtries returned by the other methods // will be in these coordinates. SRID() uint // Size returns a tile where the X and Y are the size of that zoom's // tile grid. AKA: // Tile{z, MaxX + 1, MaxY + 1 Size(z uint) (*Tile, bool) // FromNative converts from a point (in the Grid's coordinates system) and zoom // to a tile. ok will be false if the point is not valid for this coordinate // system. FromNative(z uint, pt geom.Point) (tile *Tile, ok bool) // ToNative returns the tiles upper left point. ok will be false if // the tile is not valid. A note on implemetation is that this method // should be able to take tiles with x and y values 1 higher than the max, // this is to fetch the bottom right corner of the grid ToNative(*Tile) (pt geom.Point, ok bool) }
TileGrid contains the tile layout, including ability to get WGS84 coordinates for tile extents
type Tile ¶
Tile describes a slippy tile.
func FromBounds ¶
FromBounds returns a list of tiles that make up the bound given. The bounds should be defined as the following lng/lat points [4]float64{west,south,east,north}
func NewTileMinMaxer ¶
NewTileMinMaxer returns the smallest tile which fits the geom.MinMaxer. Note: it assumes the values of ext are EPSG:4326 (lng/lat)