tiles

package
v0.0.0-...-1f4f1c7 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: MIT Imports: 2 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 [4]float64) (*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 EncodingConfig

type EncodingConfig struct {
	Extent                uint16
	Buffer                uint16
	Precision             uint8
	Simplification        uint8
	SimplificationMaxZoom uint8
}

EncodingParams holds parameters used for encoding tiles

func NewDefaultEncodingConfig

func NewDefaultEncodingConfig() *EncodingConfig

func NewEncodingConfig

func NewEncodingConfig(extent uint16, buffer uint16, precision uint8, simplification uint8, simplificationMaxZoom uint8) *EncodingConfig

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() (float64, float64, float64, float64)

func (*TileID) MercatorBounds

func (t *TileID) MercatorBounds() (float64, float64, float64, float64)

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