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

Loop.Area() unit #74

Closed
topac opened this issue Jan 25, 2021 · 1 comment
Closed

Loop.Area() unit #74

topac opened this issue Jan 25, 2021 · 1 comment

Comments

@topac
Copy link

topac commented Jan 25, 2021

What is the unit of measure of the values calculated by Loop.Area()?
I'm referring to this one: https://godoc.org/github.com/golang/geo/s2#Loop.Area

What is the best way to (approximately) convert those number to square meters?

@rsned
Copy link
Collaborator

rsned commented Jan 25, 2021

The value is in square units on a unit sphere of radius 1. So to get to km^2, scale it by the Earth's radius squared.

In the s2 tests, we use 6371.01 km as the approximate value.

https://github.com/golang/geo/blob/master/s2/s2_test.go#L46

@rsned rsned closed this as completed Jan 25, 2021
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

2 participants