Skip to content

Commit

Permalink
Fix dispatch and propagate kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
asinghvi17 committed Oct 5, 2024
1 parent 4e86b0a commit 0709a39
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/extensions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -199,15 +199,15 @@ $EXPERIMENTAL
cellarea(x; kw...) = cellarea(Spherical(), x; kw...)
cellarea(method::GeometryOpsCore.Manifold, x; kw...) = cellarea(method, dims(x, (XDim, YDim)); kw...)

function cellarea(method::GeometryOpsCore.Linear, dims::Tuple{<:XDim, <:YDim})
function cellarea(method::GeometryOpsCore.Linear, dims::Tuple{<:XDim, <:YDim}; kw...)
isintervals(dims) || throw(ArgumentError("Cannot calculate cell size for a `Raster` with `Points` sampling."))
_planar_cellarea(dims)
areas = _planar_cellarea(dims; kw...)
return Raster(areas; dims)
end

function cellarea(method::GeometryOpsCore.Spherical, dims::Tuple{<:XDim, <:YDim})
function cellarea(method::GeometryOpsCore.Spherical, dims::Tuple{<:XDim, <:YDim}; kw...)
isintervals(dims) || throw(ArgumentError("Cannot calculate cell size for a `Raster` with `Points` sampling."))
_spherical_cellarea(dims; radius = method.radius)
areas = _spherical_cellarea(dims; radius = method.radius, kw...)
return Raster(areas; dims)
end

Expand Down

0 comments on commit 0709a39

Please sign in to comment.