diff --git a/_SCRATCH/Project.toml b/_SCRATCH/Project.toml new file mode 100644 index 0000000..36411d2 --- /dev/null +++ b/_SCRATCH/Project.toml @@ -0,0 +1,4 @@ +[deps] +BiodiversityObservationNetworks = "a5b868d3-191d-4bba-a38a-ad28190da010" +CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" +GeoMakie = "db073c08-6b98-4ee5-b6a4-5efafb3259c6" diff --git a/_SCRATCH/scratchpad.jl b/_SCRATCH/scratchpad.jl new file mode 100644 index 0000000..f7e9b93 --- /dev/null +++ b/_SCRATCH/scratchpad.jl @@ -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 +