Skip to content

Latest commit

 

History

History
42 lines (27 loc) · 1.13 KB

README.md

File metadata and controls

42 lines (27 loc) · 1.13 KB

coordinate

build_badge

English | 中文

A golang library for geographic coordinate conversions, supporting the following coordinate systems:

Feature

  • Convert coordinates between this coordinate systems

Install

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

Example

GCJ02 coordinate system to WGS84 coordinate system

import "github.com/Icemap/coordinate"

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

GCJ02 coordinate system to Web Mercator coordinate system

import "github.com/Icemap/coordinate"

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