/wgs84

A pure Go package for coordinate transformations.

Primary LanguageGoMIT LicenseMIT

GoDoc Go Report Card GolangCI codecov GitHub tag (latest SemVer)

WGS84

A pure Go package for coordinate transformations.

go get github.com/wroge/wgs84

Usage

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

lon, lat, h := wgs84.ETRS89{}.UTM(32).To(wgs84.EPSG().Code(4326)).Round(3)(500150, 5761200, 0)
// 9.002 52.001 0

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

...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