tiles

package
v0.0.0-...-9fcebae Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CE float64 = 2.0 * ORIGIN
View Source
var DEG2RAD float64 = math.Pi / 180.0
View Source
var ORIGIN = RE * math.Pi
View Source
var RE float64 = 6378137.0

Functions

func GeoToMercator

func GeoToMercator(lon float64, lat float64) (x float64, y float64)

func TileRange

func TileRange(zoom uint8, bounds *affine.Bounds) (*TileID, *TileID)

TileRange calculates the min tile x, min tile y, max tile x, max tile y tile range for Mercator coordinates xmin, ymin, xmax, ymax at a given zoom level. Assumes bounds have already been clipped to Mercator world bounds.

Types

type TileID

type TileID struct {
	Zoom uint8
	X    uint32
	Y    uint32
}

WebMercator tile, numbered starting from upper left

func GeoToTile

func GeoToTile(zoom uint8, x float64, y float64) *TileID

GeoToTile calculates the tile x,y at zoom that contains longitude, latitude

func NewTileID

func NewTileID(zoom uint8, x uint32, y uint32) *TileID

func (*TileID) GeoBounds

func (t *TileID) GeoBounds() *affine.Bounds

func (*TileID) MercatorBounds

func (t *TileID) MercatorBounds() *affine.Bounds

func (*TileID) String

func (t *TileID) String() string

Jump to

Keyboard shortcuts

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