transform

package
v0.0.0-...-03ba58d Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: BSD-2-Clause-Views Imports: 1 Imported by: 1

Documentation

Overview

Package transform coordinate between earth(WGS-84) and mars in china(GCJ-02).

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

This section is empty.

Jump to

Keyboard shortcuts

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