wgs84 icon indicating copy to clipboard operation
wgs84 copied to clipboard

A zero-dependency Go package for coordinate transformations.

wgs84

Build Status go.dev reference Go Report Card golangci-lint Codecov tippin.me GitHub tag (latest SemVer)

A zero-dependency Go package for coordinate transformations.

go get github.com/wroge/wgs84

Usage

east, north, h := wgs84.LonLat().To(wgs84.ETRS89UTM(32)).Round(2)(9, 52, 0)
// 500000 5.76103821e+06 0

east, north, h := wgs84.To(wgs84.WebMercator())(9, 52, 0)
// 1.0018754171394621e+06 6.800125454397305e+06 -9.313225746154785e-10

epsg := wgs84.EPSG()

lon, lat, h := wgs84.ETRS89UTM(32).To(epsg.Code(4326)).Round(3)(500150, 5761200, 0)
// 9.002 52.001 0

// EPSG-Codes covering the coordinate {longitude: 9, latitude: 52}:
codes := epsg.CodesCover(9, 52)
// [25832 4314 32632 4978 4258 31467 4326 3857 900913]

...Calculate EPSG-Code from Unknown Coordinates ...Calculate WebMercator Tile from WGS84 Longitude Latitude ...Transformation between OSGB36 NationalGrid and WGS84 Geographic Coordinates ...Adding a CoordinateReferenceSystem (MGI AustriaLambert) to the EPSG-Repository

Features

  • Helmert Transformation
  • Web Mercator
  • Lambert Conformal Conic
  • Transverse Mercator (UTM)
  • EPSG-Code Coverage
  • ...
  • Easily expandable through simple Interfaces