geo

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Distance

func Distance(p []*Point) float64

Distance 点之间的距离

Types

type Point

type Point struct {
	// contains filtered or unexported fields
}

Point 点

func NewPoint

func NewPoint(lng float64, lat float64) *Point

NewPoint returns a new Point populated by the passed in latitude (lat) and longitude (lng) values. 从原参考函数而来,调整了经纬度的顺序,符合mysql ST_Distance_Sphere 顺序。

func NewTextPoint

func NewTextPoint(point string) *Point

NewTextPoint NewTextPoint 从逗号分割的点中创建point

func (*Point) Lat

func (p *Point) Lat() float64

Lat returns Point p's latitude.

func (*Point) Lng

func (p *Point) Lng() float64

Lng returns Point p's longitude.

Jump to

Keyboard shortcuts

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