Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP v2 #7

Open
wroge opened this issue Nov 6, 2023 · 1 comment
Open

WIP v2 #7

wroge opened this issue Nov 6, 2023 · 1 comment

Comments

@wroge
Copy link
Owner

wroge commented Nov 6, 2023

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.

go get github.com/wroge/wgs84/v2
@wroge
Copy link
Owner Author

wroge commented Nov 19, 2023

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

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
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant