expire

package
v0.0.0-...-54bcfed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CoverLinestring

func CoverLinestring(points geojson.LineString, zoom int) (TileHash, []TileFraction)

Calculate all tiles covered by linestring

func ExpireNodes

func ExpireNodes(expireor Expireor, nodes []element.Node)

Types

type ByID

type ByID []Tile

func (ByID) Len

func (t ByID) Len() int

func (ByID) Less

func (t ByID) Less(i, j int) bool

func (ByID) Swap

func (t ByID) Swap(i, j int)

type ByYX

type ByYX []TileFraction

func (ByYX) Len

func (t ByYX) Len() int

func (ByYX) Less

func (t ByYX) Less(i, j int) bool

func (ByYX) Swap

func (t ByYX) Swap(i, j int)

type Expireor

type Expireor interface {
	Expire(long, lat float64)
}

type NoExpireor

type NoExpireor struct{}

func (NoExpireor) Expire

func (_ NoExpireor) Expire(long, lat float64)

type Tile

type Tile struct {
	X int
	Y int
	Z int
}

func CoverPoint

func CoverPoint(p geojson.Point, zoom int) Tile

Calculate all tiles covered by the point

func NewTile

func NewTile(x, y float64, z int) Tile

func (Tile) Parent

func (t Tile) Parent() Tile

type TileExpireor

type TileExpireor struct {
	// contains filtered or unexported fields
}

func NewTileExpireor

func NewTileExpireor(maxZoom int) *TileExpireor

The tile expireor keeps a list of dirty XYZ tiles that are covered by the expired polygons, linestring and points

func (*TileExpireor) CalculateParentTiles

func (te *TileExpireor) CalculateParentTiles()

func (*TileExpireor) Expire

func (te *TileExpireor) Expire(long, lat float64)

func (*TileExpireor) ExpireLinestring

func (te *TileExpireor) ExpireLinestring(nodes []element.Node)

func (*TileExpireor) ExpirePolygon

func (te *TileExpireor) ExpirePolygon(nodes []element.Node)

func (*TileExpireor) WriteTiles

func (te *TileExpireor) WriteTiles(w io.Writer)

type TileFraction

type TileFraction struct {
	X float64
	Y float64
}

func ToTileFraction

func ToTileFraction(p geojson.Point, zoomLevel int) TileFraction

type TileHash

type TileHash map[int]struct{}

func CoverPolygon

func CoverPolygon(poly geojson.Polygon, zoom int) TileHash

Calculate all tiles covered by the linear rings of the polygon and the tiles enclosed by it

func FromTiles

func FromTiles(tiles []Tile) TileHash

func (TileHash) AddTile

func (th TileHash) AddTile(t Tile)

func (TileHash) CalculateParents

func (th TileHash) CalculateParents(minZoom int)

func (TileHash) MergeTiles

func (th TileHash) MergeTiles(other TileHash)

func (TileHash) TileExists

func (th TileHash) TileExists(t Tile) bool

func (TileHash) ToTiles

func (th TileHash) ToTiles() []Tile

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL