Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 1.11 KB

README_ch.md

File metadata and controls

42 lines (27 loc) · 1.11 KB

coordinate

build_badge

English | 中文

一个Golang的地理坐标转换库,支持坐标系:

功能

  • 在四种坐标系中互相转换

安装

$ go get -u github.com/Icemap/coordinate

示例

GCJ02坐标到WGS84坐标

import "github.com/Icemap/coordinate"

gcj02Point := Coordinate{X: 110.0, Y: 20.0}
wgs84Point, err := coordinate.Convert(coordinate.GCJ02, coordinate.WGS84, gcj02Point)

GCJ02坐标到Web墨卡托坐标

import "github.com/Icemap/coordinate"

gcj02Point := Coordinate{X: 110.0, Y: 20.0}
webMercatorPoint, err := coordinate.Convert(coordinate.GCJ02, coordinate.WebMercator, gcj02Point)