8000 GitHub - taruti/go-coo: Coordinate Transformations and Conversions in Pure Go.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

taruti/go-coo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-coo

Coordinate conversion and transformation package in pure Go(lang).

Usage

go get github.com/wroge/go-coo

import (
	"github.com/wroge/go-coo"
)

Features

  • Coordinate conversion between projected coordinate systems and geographical coordinates.
texasLambert := coo.ConformalConic(27.5, 35, 18, -100, 1500000, 5000000)
lon, lat := texasLambert.ToGeographic(1492401.186, 6484663.429, coo.GRS80)
east, north := texasLambert.FromGeographic(-100.080, 31.316, coo.GRS80)
  • Coordinate conversion between different projected coordinate systems.
east, north := coo.Convert(1001875.417, 6800125.454, coo.WebMercator, 
    coo.UTM(32, "N"), coo.WGS84)
east, north = coo.Convert(500000.000, 5761038.212, coo.UTM(32, "N"), 
    coo.WebMercator, coo.WGS84)
  • Coordinate transformation between different coordinate systems.
etrs89utm32N := &coo.Projected{
    Geographic: &coo.Geographic{
        Ellipsoid: coo.GRS80,
    },
    System: coo.UTM(32, "N"),
}
dhdn2001gk3 := &coo.Projected{
    Geographic: &coo.Geographic{
        Geocentric: de.DHDN2001,
        Ellipsoid:  coo.Bessel,
    },
    System: coo.GaussKrueger(3),
}
east, north, _ := coo.Transform(500000.000, 5761038.212, 0, etrs89utm32N, dhdn2001gk3)
  • Standard coordinate systems
// &coo.Geocentric{} -> WGS84, &coo.Geographic{} -> WGS84 Geographic, &coo.Projected{} -> Web Mercator WGS84
x, y, z := coo.Transform(1001875.417, 6800125.454, 0, &coo.Projected{}, &coo.Geocentric{})
lon, lat, h := coo.Transform(x, y, z, &coo.Geocentric{}, &coo.Geographic{})

EPSG

EPSG is a sub-package to which EPSG codes are added on a regular basis.

import (
	"github.com/wroge/go-coo/epsg"
)

About

Coordinate Transformations and Conversions in Pure Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0