Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

Commit

Permalink
Merge pull request #115 from EcoJulia/tpoisot/issue112
Browse files Browse the repository at this point in the history
Add a grid method to extract the grid
  • Loading branch information
tpoisot authored Sep 2, 2021
2 parents f88bb01 + a209ce7 commit f2890eb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SimpleSDMLayers"
uuid = "2c645270-77db-11e9-22c3-0f302a89c64c"
authors = ["Timothée Poisot <[email protected]>", "Gabriel Dansereau <[email protected]>"]
version = "0.7.0"
version = "0.7.1"

[deps]
ArchGDAL = "c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3"
Expand All @@ -12,7 +12,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
ZipFile = "a5390f91-8eb1-5f08-bee0-b1d1ffed6cea"

[compat]
ArchGDAL = "0.6"
ArchGDAL = "0.6, 0.7"
Downloads = "1.4"
RecipesBase = "0.7, 0.8, 1.0"
Requires = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion src/SimpleSDMLayers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ include(joinpath("lib", "overloads.jl"))
include(joinpath("lib", "generated.jl"))

include(joinpath("lib", "basics.jl"))
export latitudes, longitudes, boundingbox
export latitudes, longitudes, boundingbox, grid

include(joinpath("lib", "iteration.jl"))

Expand Down
4 changes: 4 additions & 0 deletions src/lib/basics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ end
function _layers_are_compatible(layers::Array{T}) where {T <: SimpleSDMLayer}
all(layer -> _layers_are_compatible(layer, layers[1]), layers)
end

function grid(layer::T) where {T <: SimpleSDMLayer}
return copy(layer.grid)
end
3 changes: 3 additions & 0 deletions test/basics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ bbox = boundingbox(S)
@test bbox.bottom == S.bottom
@test bbox.top == S.top

A = grid(S)
@test M == A

end

0 comments on commit f2890eb

Please sign in to comment.