coord

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Distance

func Distance(latA, lngA, latB, lngB float64) float64

Distance calculate the distance between point(latA, lngA) and point(latB, lngB), unit in meter.

func GCJtoWGS

func GCJtoWGS(gcjLat, gcjLng float64) (wgsLat, wgsLng float64)

GCJtoWGS convert GCJ-02 coordinate(gcjLat, gcjLng) to WGS-84 coordinate(wgsLat, wgsLng). The output WGS-84 coordinate's accuracy is 1m to 2m. If you want more exactly result, use GCJtoWGSExact/gcj2wgs_exact.

func GCJtoWGSExact

func GCJtoWGSExact(gcjLat, gcjLng float64) (wgsLat, wgsLng float64)

GCJtoWGSExact convert GCJ-02 coordinate(gcjLat, gcjLng) to WGS-84 coordinate(wgsLat, wgsLng). The output WGS-84 coordinate's accuracy is less than 0.5m, but much slower than GCJtoWGS/gcj2wgs.

func WGStoGCJ

func WGStoGCJ(wgsLat, wgsLng float64) (gcjLat, gcjLng float64)

WGStoGCJ convert WGS-84 coordinate(wgsLat, wgsLng) to GCJ-02 coordinate(gcjLat, gcjLng).

Types

type Coord

type Coord struct {
}

func NewCoord

func NewCoord() *Coord

func (*Coord) BdToGcj02

func (c *Coord) BdToGcj02(in_lng, in_lat float64) (out_lng, out_lat float64, err error)

func (*Coord) BdToWgs84

func (c *Coord) BdToWgs84(in_lng, in_lat float64) (out_lng, out_lat float64, err error)

func (*Coord) Gcj02ToWgs84

func (c *Coord) Gcj02ToWgs84(in_lng, in_lat float64) (out_lng, out_lat float64, err error)

func (*Coord) Gcj02toBd

func (c *Coord) Gcj02toBd(in_lng, in_lat float64) (out_lng, out_lat float64, err error)

func (*Coord) Wgs84ToBd

func (c *Coord) Wgs84ToBd(in_lng, in_lat float64) (out_lng, out_lat float64, err error)

func (*Coord) Wgs84ToGcj02

func (c *Coord) Wgs84ToGcj02(in_lng, in_lat float64) (out_lng, out_lat float64, err error)

Jump to

Keyboard shortcuts

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