Documentation ¶
Overview ¶
Package maptile defines a Tile type and methods to work with web map projected tile data.
Index ¶
- func Fraction(ll orb.Point, z Zoom) orb.Point
- type Set
- type Tile
- func (t Tile) Bound(tileBuffer ...float64) orb.Bound
- func (t Tile) Center() orb.Point
- func (t Tile) Children() Tiles
- func (t Tile) Contains(tile Tile) bool
- func (t Tile) Parent() Tile
- func (t Tile) Quadkey() uint64
- func (t Tile) Range(z Zoom) (min, max Tile)
- func (t Tile) SharedParent(tile Tile) Tile
- func (t Tile) Siblings() Tiles
- func (t Tile) Valid() bool
- type Tiles
- type Zoom
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Set ¶
Set is a map/hash of tiles.
func (Set) ToFeatureCollection ¶
func (s Set) ToFeatureCollection() *geojson.FeatureCollection
ToFeatureCollection converts a set of tiles into a feature collection. This method is mostly useful for debugging output.
type Tile ¶
Tile is an x, y, z web mercator tile.
func At ¶
At creates a tile for the point at the given zoom. Will create a valid tile for the zoom. Points outside the range lat [-85.0511, 85.0511] will be snapped to the max or min tile as appropriate.
func FromQuadkey ¶
FromQuadkey creates the tile from the quadkey.
func (Tile) Bound ¶
Bound returns the geo bound for the tile. An optional tileBuffer parameter can be passes to create a buffer around the bound in tile dimension. e.g. a tileBuffer of 1 would create a bound 9x the size of the tile, centered around the provided tile.
func (Tile) Contains ¶
Contains returns if the given tile is fully contained (or equal to) the give tile.
func (Tile) SharedParent ¶
SharedParent returns the tile that contains both the tiles.
type Tiles ¶
type Tiles []Tile
Tiles is a set of tiles, later we can add methods to this.
func (Tiles) ToFeatureCollection ¶
func (ts Tiles) ToFeatureCollection() *geojson.FeatureCollection
ToFeatureCollection converts the tiles into a feature collection. This method is mostly useful for debugging output.