wgs84 icon indicating copy to clipboard operation
wgs84 copied to clipboard

WIP v2

Open wroge opened this issue 1 year ago • 1 comments

I would like to change the API a little. So this is my first draft for v2: https://github.com/wroge/wgs84/tree/v2

Anyone who is interested can take a look at it. I am open to criticism.

  • no predefined CRS anymore, instead all CRS are available via EPSG code ( wgs84.EPSG(code) )
  • removed safe functions (Unknown EPSG codes return ErrCodeNotFound)
  • removed area interface (not really used by anyone!?)
  • cleaned up the projections so that the variables have the same name as in the guidance notes: https://drive.tiny.cloud/1/4m326iu12oa8re9cjiadxonharclteqb4mumfxj71zsttwkx/d6ce146d-81c5-423b-8cdb-1b66e801e167
  • added the Krovak projection and I will gradually add more projections from the guidence notes
go get github.com/wroge/wgs84/v2

wroge avatar Nov 06 '23 13:11 wroge

I've added support for NTv2. At the moment OSTN15_NTv2_OSGBtoETRS.gsb and BeTA2007.gsb are available :rocket: :rocket:

package main

import (
	"fmt"

	"github.com/wroge/wgs84/v2"
)

func main() {
	transform := wgs84.Transform(wgs84.EPSG(4326), wgs84.EPSG(27700)).Round(3)

	east, north, h := transform(-2.25, 52.25, 0)

	fmt.Println(east, north, h)
	// 383029.296 261341.615 0

	// echo -2.25 52.25 | cs2cs +init=epsg:4326 +to +init=epsg:27700 -d 3
	// 383029.296 261341.615 0.000
}

wroge avatar Nov 19 '23 13:11 wroge