Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/sphere/globeaxis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ end

_geodesy_ellipsoid_from(g::Geodesy.Ellipsoid) = g
_geodesy_ellipsoid_from(g::Geodesy.Datum) = Geodesy.ellipsoid(g)
_geodesy_ellipsoid_from(n::NamedTuple{(:a, :f), Tuple{<: Real, <: Real}}) = Geodesy.Ellipsoid(; a = string(n.a), f = string(n.f))
_geodesy_ellipsoid_from(n::NamedTuple{(:a, :b), Tuple{<: Real, <: Real}}) = Geodesy.Ellipsoid(; a = string(n.a), b = string(n.b))
_geodesy_ellipsoid_from(n::NamedTuple{(:a, :f_inv), <: Tuple{<: Real, <: Real}}) = Geodesy.Ellipsoid(; a = string(n.a), f_inv = string(n.f_inv))
_geodesy_ellipsoid_from(n::NamedTuple{(:a, :b), <: Tuple{<: Real, <: Real}}) = Geodesy.Ellipsoid(; a = string(n.a), b = string(n.b))
_geodesy_ellipsoid_from(x::T) where T = error("Unsupported ellipsoid type: $T. Must be a `Geodesy.Ellipsoid`, `Geodesy.Datum`, or a `(; a = ..., f = ...)` named tuple.")

function Makie.initialize_block!(axis::GlobeAxis; scenekw = NamedTuple())
Expand Down
7 changes: 6 additions & 1 deletion src/sphere/globetransform.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ function ProjGlobeTransform(dest::Geodesy.Datum, src, zlevel)
return ProjGlobeTransform(Geodesy.ellipsoid(dest), src, zlevel)
end
function ProjGlobeTransform(dest::Geodesy.Ellipsoid, src, zlevel)
dest_str = "+proj=cart +a=$(dest.a) +f=$(dest.f)"
# if a sphere is requested, then use the radius directly.
if iszero(dest.f) || dest.a == dest.b
dest_str = "+proj=cart +R=$(dest.a)"
else # it's an actual ellipsoid, so provide shape params.
dest_str = "+proj=cart +a=$(dest.a) +b=$(dest.b)"
end
transf = create_transform(dest_str, src)
return ProjGlobeTransform(transf, zlevel)
end
Expand Down
Loading