Skip to content

Commit

Permalink
scratch dir for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
gottacatchenall committed Dec 20, 2024
1 parent dc2c441 commit 1ff6e76
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
4 changes: 4 additions & 0 deletions _SCRATCH/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[deps]
BiodiversityObservationNetworks = "a5b868d3-191d-4bba-a38a-ad28190da010"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
GeoMakie = "db073c08-6b98-4ee5-b6a4-5efafb3259c6"
33 changes: 33 additions & 0 deletions _SCRATCH/scratchpad.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Pkg
Pkg.activate(@__DIR__)

using BiodiversityObservationNetworks
using CairoMakie, GeoMakie

import BiodiversityObservationNetworks as BONs
import BiodiversityObservationNetworks.SpeciesDistributionToolkit as SDT
import BiodiversityObservationNetworks.GeoInterface as GI
import BiodiversityObservationNetworks.GeometryOps as GO


col = SDT.gadm("COL")
col_states = SDT.gadm("COL", 1)

bioclim = RasterStack([SDT.mask!(SDT.SDMLayer(SDT.RasterData(SDT.WorldClim2, SDT.BioClim); layer=i, SDT.boundingbox(col)...), col) for i in 1:19])

bon = sample(SimpleRandom(50), bioclim)
bon = sample(SimpleRandom(10), col_states)
bon = sample(SpatiallyStratified(100), col_states)
bon = BONs.sample(Grid(), col)
bon = BONs.sample(KMeans(75), bioclim)

begin
f = Figure(size=(900,900))
ga = GeoAxis(f[1,1])
for (i,st) in enumerate(convert(Polygon, col_states))
poly!(ga, st.geometry, strokewidth=2, color=Symbol("grey", string(20+2*i)))
scatter!(ga, [node[1] for node in bon], [node[2] for node in bon], color=(:red))
end
f
end

0 comments on commit 1ff6e76

Please sign in to comment.