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

Which earth radius to use #221

Open
tiemvanderdeure opened this issue Oct 3, 2024 · 2 comments
Open

Which earth radius to use #221

tiemvanderdeure opened this issue Oct 3, 2024 · 2 comments

Comments

@tiemvanderdeure
Copy link
Contributor

In the new GeometryOpsCore, the radius defaults to the earth's radius at the equator:

Base.@kwdef struct Spherical{T} <: Manifold
radius::T = 6378137.0
end

I'm no expert and basically going off wikipedia here, but wouldn't it be more intuitive to use the mean radius instead? The arithmetic mean, equal area, and equal volume radius are all 6371 km.

https://en.wikipedia.org/wiki/Earth_radius#Global_radii

@asinghvi17
Copy link
Member

Thanks, just made the change.

BTW, piggybacking on this issue, we should be able to convert a Geodesic() (maybe Ellipsoidal()?) to Spherical() using the same sphericalization parameters as PROJ does for ellipsoids. Here's a link:

        The ellipsoid definition may be augmented with a spherification flag,
    turning the ellipsoid into a sphere with features defined by the ellipsoid.

        Spherification parameters supported are:
            R_A, which gives a sphere with the same surface area as the
            ellipsoid R_V, which gives a sphere with the same volume as the
    ellipsoid

            R_a, which gives a sphere with R = (a + b)/2   (arithmetic mean)
            R_g, which gives a sphere with R = sqrt(a*b)   (geometric mean)
            R_h, which gives a sphere with R = 2*a*b/(a+b) (harmonic mean)

            R_lat_a=phi, which gives a sphere with R being the arithmetic mean
            of of the corresponding ellipsoid at latitude phi.
            R_lat_g=phi, which gives
            a sphere with R being the geometric mean of of the corresponding
    ellipsoid at latitude phi.

            R_C, which gives a sphere with the radius of the conformal sphere
            at phi0.

https://github.com/OSGeo/PROJ/blob/0134c145053ffac92c42b5ab0109b41c8be417e7/src/ell_set.cpp#L51C13-L66C21

@asinghvi17
Copy link
Member

https://github.com/OSGeo/PROJ/blob/0134c145053ffac92c42b5ab0109b41c8be417e7/src/ell_set.cpp#L355-L466 is the definition of the spherification function, it doesn't seem too hard.

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