bing

package
v0.0.0-...-0108d89 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EarthRadius is the radius of the earth
	EarthRadius = 6378137.0
	// MinLatitude is the min lat
	MinLatitude = -85.05112878
	// MaxLatitude is the max lat
	MaxLatitude = 85.05112878
	// MinLongitude is the min lon
	MinLongitude = -180.0
	// MaxLongitude is the max lon
	MaxLongitude = 180.0
	// TileSize is the size of a tile
	TileSize = 256
	// MaxLevelOfDetail is the max level of detail
	MaxLevelOfDetail = 38
)

Variables

This section is empty.

Functions

func LatLongToPixelXY

func LatLongToPixelXY(latitude, longitude float64, levelOfDetail uint64) (pixelX, pixelY int64)

LatLongToPixelXY converts a point from latitude/longitude WGS-84 coordinates (in degrees) into pixel XY coordinates at a specified level of detail. Param 'latitude' is the latitude of the point, in degrees. Param 'longitude' is the longitude of the point, in degrees. Param 'levelOfDetail' is the level of detail, from 1 (lowest detail) to N (highest detail). Return value 'pixelX' is the output parameter receiving the X coordinate in pixels. Return value 'pixelY' is the output parameter receiving the Y coordinate in pixels.

func LatLongToQuad

func LatLongToQuad(latitude, longitude float64, levelOfDetail uint64, iterator func(part int) bool)

LatLongToQuad iterates through all of the quads parts until levelOfDetail is reached.

func MapSize

func MapSize(levelOfDetail uint64) uint64

MapSize determines the map width and height (in pixels) at a specified level of detail. Param 'levelOfDetail' is the level of detail, from 1 (lowest detail) to N (highest detail). Returns the map width and height in pixels.

func PixelXYToLatLong

func PixelXYToLatLong(pixelX, pixelY int64, levelOfDetail uint64) (latitude, longitude float64)

PixelXYToLatLong converts a pixel from pixel XY coordinates at a specified level of detail into latitude/longitude WGS-84 coordinates (in degrees). Param 'pixelX' is the X coordinate of the point, in pixels. Param 'pixelY' is the Y coordinates of the point, in pixels. Param 'levelOfDetail' is the level of detail, from 1 (lowest detail) to N (highest detail). Return value 'latitude' is the output parameter receiving the latitude in degrees. Return value 'longitude' is the output parameter receiving the longitude in degrees.

func PixelXYToTileXY

func PixelXYToTileXY(pixelX, pixelY int64) (tileX, tileY int64)

PixelXYToTileXY converts pixel XY coordinates into tile XY coordinates of the tile containing the specified pixel. Param 'pixelX' is the pixel X coordinate. Param 'pixelY' is the pixel Y coordinate. Return value 'tileX' is the output parameter receiving the tile X coordinate. Return value 'tileY' is the output parameter receiving the tile Y coordinate.

func QuadKeyToBounds

func QuadKeyToBounds(quadkey string) (minLat, minLon, maxLat, maxLon float64, err error)

QuadKeyToBounds converts a quadkey to bounds

func QuadKeyToTileXY

func QuadKeyToTileXY(quadKey string) (tileX, tileY int64, levelOfDetail uint64)

/ QuadKeyToTileXY converts a QuadKey into tile XY coordinates. / Param 'quadKey' is the quadKey of the tile. / Return value 'tileX' is the output parameter receiving the tile X coordinate. / Return value 'tileY is the output parameter receiving the tile Y coordinate. / Return value 'levelOfDetail' is the output parameter receiving the level of detail.

func TileXYToBounds

func TileXYToBounds(tileX, tileY int64, levelOfDetail uint64) (minLat, minLon, maxLat, maxLon float64)

TileXYToBounds returns the bounds around a tile.

func TileXYToPixelXY

func TileXYToPixelXY(tileX, tileY int64) (pixelX, pixelY int64)

TileXYToPixelXY converts tile XY coordinates into pixel XY coordinates of the upper-left pixel of the specified tile. Param 'tileX' is the tile X coordinate. Param 'tileY' is the tile Y coordinate. Return value 'pixelX' is the output parameter receiving the pixel X coordinate. Return value 'pixelY' is the output parameter receiving the pixel Y coordinate.

func TileXYToQuadKey

func TileXYToQuadKey(tileX, tileY int64, levelOfDetail uint64) string

/ TileXYToQuadKey converts tile XY coordinates into a QuadKey at a specified level of detail. / Param 'tileX' is the tile X coordinate. / Param 'tileY' is the tile Y coordinate. / Param 'levelOfDetail' is the Level of detail, from 1 (lowest detail) to N (highest detail). / Returns a string containing the QuadKey.

Types

This section is empty.

Jump to

Keyboard shortcuts

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