utils

package
v0.0.0-...-40e05f8 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildTileURL

func BuildTileURL(template string, x, y, z uint64) string

BuildTileURL will fill in a template URL of something like http://host.com/{z}/{x}/{y}.png

func FetchURL

func FetchURL(url string, retries int) (io.ReadCloser, error)

FetchURL will download the data from the URL. Make sure to close the returned io.ReadCloser

func Kernel

func Kernel(stdDev, mercatorScale float64) []float64

Kernel creates a good kernel for smoothing surfaces for the purpose of sliding. Creates a Gaussian kernel with one difference, points within on STD of the center follow f(x) = (-a / sd) * x + (a + 1/(e^0.5)). This creates a shape where we have a line from (sd, 1/e^0.5) to (0, 1/e^0.5 + addition), ie. a sharp point at the center of the Gaussian. a (the addition) is defined as sd*1.5 and can be tuned to change the sharpness of the kernel. These parameters are scaled to match the scaling caused by the mercator projection assumed by slide.

func TileRanges

func TileRanges(lnglatBound *geo.Bound, maxTileDim uint64) (xTileMin, xTileMax, yTileMin, yTileMax, zoomLevel uint64)

TileRanges returns the ranges of tiles that enclose the given latlng bound.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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