package maptile
import "github.com/paulmach/orb/maptile"
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 At(ll orb.Point, z Zoom) Tile
- func FromQuadkey(k uint64, z Zoom) Tile
- func New(x, y uint32, z Zoom) 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
- func ChildrenInZoomRange(tile Tile, zoomStart, zoomEnd Zoom) Tiles
- func (ts Tiles) ToFeatureCollection() *geojson.FeatureCollection
- type Zoom
Functions ¶
func Fraction ¶
Fraction returns the precise tile fraction at the given zoom. Will return 2^zoom-1 if the point is below 85.0511 S.
Types ¶
type Set ¶
Set is a map/hash of tiles.
func (Set) Merge ¶
Merge will merge the given set into the existing set.
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 New ¶
New creates a new tile with the given coordinates.
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) Center ¶
Center returns the center of the tile.
func (Tile) Children ¶
Children returns the 4 children of the tile.
func (Tile) Contains ¶
Contains returns if the given tile is fully contained (or equal to) the give tile.
func (Tile) Parent ¶
Parent returns the parent of the tile.
func (Tile) Quadkey ¶
Quadkey returns the quad key for the tile.
func (Tile) Range ¶
Range returns the min and max tile "range" to cover the tile at the given zoom.
func (Tile) SharedParent ¶
SharedParent returns the tile that contains both the tiles.
func (Tile) Siblings ¶
Siblings returns the 4 tiles that share this tile's parent.
func (Tile) Valid ¶
Valid returns if the tile's x/y are within the range for the tile's zoom.
type Tiles ¶
type Tiles []Tile
Tiles is a set of tiles, later we can add methods to this.
func ChildrenInZoomRange ¶
ChildrenInZoomRange returns all the children tiles of tile from ranges [zoomStart, zoomEnd], both ends inclusive.
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.
type Zoom ¶
type Zoom uint32
A Zoom is a strict type for a tile zoom level.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
maptile/tilecover | Package tilecover computes the covering set of tiles for an orb.Geometry. |
- Version
- v0.11.1 (latest)
- Published
- Jan 29, 2024
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 1 day ago –
Tools for package owners.