Documentation ¶
Index ¶
- Constants
- func AssertAreEqual(t *testing.T, expected float64, actual float64, message string)
- func BilinearInterpolation(ll *PointValue, ul *PointValue, lr *PointValue, ur *PointValue, p *Point) float64
- func DrawGrid(grid *Grid) *image.RGBA
- func DrawGridInto(grid *Grid, m *image.RGBA, offsetX int, offsetY int)
- func DrawGridTest(grid Grid) *image.RGBA
- func DrawLine(gc *draw2dimg.GraphicContext, line *PolyLine)
- func DrawX(img *image.RGBA)
- func ResampleAndDrawConcurrent(g Grid, b Bounds, width int, height int) *image.RGBA
- func SaveImage(m *image.RGBA, file string)
- func Scale(from1 float64, from2 float64, to1 float64, to2 float64) func(x float64) float64
- func Tiler(g Grid, maxZoom int, targetFolder string)
- func TimeTrack(start time.Time, name string)
- type Bounds
- type Grid
- type GridHeader
- type MercatorProjector
- type Point
- type PointValue
- type PolyLine
- type Projector
Constants ¶
View Source
const MercatorPole = 20037508.34
Variables ¶
This section is empty.
Functions ¶
func AssertAreEqual ¶
AssetAreEqual check if two float64 numbers are roughly equal, and fails the test if not.
func BilinearInterpolation ¶
func BilinearInterpolation(ll *PointValue, ul *PointValue, lr *PointValue, ur *PointValue, p *Point) float64
func DrawGridTest ¶
func DrawLine ¶
func DrawLine(gc *draw2dimg.GraphicContext, line *PolyLine)
Types ¶
type Grid ¶
type Grid struct { Data []float32 Header GridHeader }
func ToRegularProjectedGrid ¶
ToRegularProjectedGrid converts a regular geographic grid to a regular Mercator grid.
func (Grid) GetValueAt ¶
Use bilinear interpolation to get the value at a point within the grid
func (*Grid) GetValueAtIdx ¶
func (g *Grid) GetValueAtIdx(idxX int, idxY int) PointValue
Get value at a given index, assuming an y-axis pointing north-to-south
type GridHeader ¶
type MercatorProjector ¶
type MercatorProjector struct { }
func (MercatorProjector) FromProjection ¶
func (MercatorProjector) FromProjection(x, y float64) Point
FromProjection finds the geographic coordinates of a Mercator point.
func (MercatorProjector) ToProjection ¶
func (MercatorProjector) ToProjection(lon, lat float64) Point
ToProjection will project a point into the Mercator projection.
type PointValue ¶
Click to show internal directories.
Click to hide internal directories.