-
Notifications
You must be signed in to change notification settings - Fork 1
/
geodatascience.jl
2732 lines (2232 loc) · 91.1 KB
/
geodatascience.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
### A Pluto.jl notebook ###
# v0.19.19
using Markdown
using InteractiveUtils
# ╔═╡ 15926938-04a3-478a-b525-260b3107afbc
begin
# main package
using GeoStats
# visualization recipes
using GeoStatsViz
# auxiliary package
using CSV
using DataFrames
using Statistics
using GeoTables
using PlutoTeachingTools
import PlutoUI
# import Makie's WebGL backend
import WGLMakie as Mke
# workaround for https://github.com/fonsp/Pluto.jl/issues/2309
PlutoRunner.pluto_showable(
::MIME"application/vnd.pluto.table+object",
::Data) = true
# add table of contents to the side
PlutoUI.TableOfContents(title="Contents")
end
# ╔═╡ d812a6c8-b676-439c-90d6-c8a0b47c29d6
html"""
<div style="
position: absolute;
width: calc(100% - 30px);
border: 50vw solid #444444;
border-top: 500px solid #048282;
border-bottom: none;
box-sizing: content-box;
left: calc(-50vw + 15px);
top: -500px;
height: 500px;
pointer-events: none;
"></div>
<div style="
height: 500px;
width: 100%;
background: #444444;
color: #fff;
padding-top: 68px;
">
<span style="
font-family: Rubik, serif;
font-weight: 700;
font-feature-settings: 'lnum', 'pnum';
"> <p style="
font-size: 1.5rem;
opacity: .8;
"><em>JuliaEO 2023 Workshop:</em></p>
<p style="text-align: center; font-size: 2rem;">
<em>Geodata Science & Geostatistical Learning</em>
</p>
<p style="
font-size: 1.5rem;
text-align: center;
opacity: .8;
"><em>presented by Arpeggeo® Technologies</em></p>
<center>
<a href="https://arpeggeo.tech"><img src="https://i.imgur.com/xgq72Z7.png" height=200></a>
</center>
<style>
body {
overflow-x: hidden;
}
</style>"""
# ╔═╡ e551d2ac-60a5-44e5-b5fa-fdf96e5c9df3
md"""
# Module I: Advanced Geodata Science
**Instructor:** [Júlio Hoffimann](https://juliohm.github.io)
**E-mail:** [[email protected]](mailto:[email protected])
"""
# ╔═╡ 5e8bbb4f-bb1f-42a3-bc62-b291327c82e1
ChooseDisplayMode()
# ╔═╡ fcf7fc2b-c46c-46c4-a3f9-d9fa73d53680
html"""
<img src="https://github.com/JuliaEarth/GeoStats.jl/blob/master/docs/src/assets/logo-text.svg?raw=true">
"""
# ╔═╡ 61bcb8bf-6715-44a2-a0cb-cd48a8b64967
html"""
<head>
<style>
{
box-sizing: border-box;
}
/* Set additional styling options for the columns*/
.column {
float: left;
width: 50%;
}
.row:after {
content: "";
display: table;
clear: both;
}
</style>
</head>
<body>
<div class="row">
<div class="column";">
<h2>Objectives</h2>
<ol>
<li>Introduce important fundamental concepts</li>
<li>Learn the "right way" of doing geodata science</li>
<li>Practice concepts and tools with exercises</li>
<li>Design sophisticated geospatial pipelines</li>
</ol>
</div>
<div class="column";">
<img src="https://i.imgur.com/0Y2bG17.jpg" width=250>
</div>
</div>
</body>
"""
# ╔═╡ c67f15b9-c8b2-420b-980a-7713372a4746
md"""
## What is geospatial data?
Very generally, (discrete) **geo**spatial data is the combination of:
1. a **table** of attributes (or features) with
2. a discretization of a geospatial **domain**
The concept of **table** is widespread. We support any table implementing the [Tables.jl](https://github.com/JuliaData/Tables.jl) interface, including named tuples, dataframes, SQL databases, Excel spreadsheets, Apache Arrow, etc.
Given a **domain** (or region) in physical space, we can discretize it into *elements*. We support any domain implementing the [Meshes.jl]() interface, including Cartesian grids, point sets, collections of geometries and general unstructured meshes.
"""
# ╔═╡ e260b763-5bb3-4e8e-9e22-70761b2a39ca
md"""
## All you need is `georef` 🌎 ✅
We provide the **`georef`** function to combine tables with domains:
$$\textbf{georef}\text{(table, domain)} \mapsto \text{data}$$
And the functions **`values`** and **`domain`** to retrieve the table and domain of the data:
$$\begin{align*}\textbf{values}\text{(data)} &\mapsto \text{table}\\ \textbf{domain}\text{(data)} &\mapsto \text{domain}\end{align*}$$
"""
# ╔═╡ 380c8b96-d9d7-4ce7-bdc3-bcb2ae3fd173
md"""
### Basic example
Consider the following table with `100` measurements of variables `a` and `b`:
"""
# ╔═╡ e2bf778d-057d-4289-977c-67bbfba7013e
table = DataFrame(a = rand(100), b = rand(100))
# ╔═╡ 6c2806f4-40cf-4ceb-8f8e-343ad6a22510
md"""
Let's assume that the measurements are associated with random points in 2D space:
"""
# ╔═╡ 4f755fff-f8e6-4850-b657-32186d619084
pointdata = georef(table, rand(Point2, 100))
# ╔═╡ 13ffa2c5-a694-4dda-bddf-8dbd796af973
pointdata |> viewer
# ╔═╡ b4154684-adaf-4a3e-bc87-98e31b8492c4
md"""
Alternatively, they could be associated with quadrangle geometries in a Cartesian grid:
"""
# ╔═╡ 41180c1a-867d-4e3f-b1de-9674b7fd24d8
griddata = georef(table, CartesianGrid(10, 10))
# ╔═╡ feae2a69-5768-4036-8d75-bd95da78f759
griddata |> viewer
# ╔═╡ 3bf6d731-4fbe-4795-ab55-f00bf8058560
md"""
In all cases, we can always retrieve the underlying table of attributes and geospatial domain:
"""
# ╔═╡ 7664fd5d-44c3-4c70-9291-9ae78b1f9cee
griddata |> values
# ╔═╡ 0ddcbf23-3250-44c6-9c9e-bd5c9a7e0192
griddata |> domain
# ╔═╡ 04ffa2af-1bdc-473b-8ef4-f071225e410b
md"""
### The Bonnie data set
Let's try what we learned with a real data set...
```
The Bonnie Project Example is under copyright of Transmin Metallurgical Consultants, 2019. It is issued under the Creative Commons Attribution-ShareAlike 4.0 International Public License.
```
"""
# ╔═╡ 88d0ab55-ed76-4e63-86cf-02a0a81ccacc
csv = CSV.File("data/bonnie.csv")
# ╔═╡ 89d2f22e-e0ac-4927-ac62-064b42987905
md"""
#### Exercise
Read the [georef](https://juliaearth.github.io/GeoStats.jl/stable/data.html) documentation and find the correct method to georeference this table with coordinates `EAST`, `NORTH` and `RL`.
"""
# ╔═╡ 9d023c57-26e0-4eaa-830a-0745ea45e426
answer(csv) = missing
# ╔═╡ 08485d26-c599-4836-af95-44115c33c611
begin
scored1 = false
a = answer(csv)
if ismissing(a)
still_missing()
elseif a isa Data &&
domain(a) isa PointSet{3} &&
names(values(a) |> DataFrame) == ["Auppm","Agppm","Cuppm","Asppm","Sper","CODE","OX","ISBD"]
scored1 = true
correct()
else
keep_working()
end
end
# ╔═╡ ca1b4dbc-0b09-4d12-9973-ca2963df0a74
hint(md"Come on, it is super easy... One line of code...")
# ╔═╡ 6c2b4ecb-86f8-4b17-a1f9-7c055589ccba
md"""
The result will show below when you get the right answer.
"""
# ╔═╡ d279f14c-ab74-46f3-8ec0-42b4058fda0e
begin
bonnie = scored1 ? answer(csv) : nothing
end
# ╔═╡ a199cb3b-0b90-4b1b-b1e7-f80a7596ac42
md"""
### Like a DataFrame...
We can index rows and columns of geospatial data. These operations are optimized to avoid unncessary copies of geometries:
"""
# ╔═╡ 097a7ce4-832e-4982-b762-9903f143ffa1
griddata[1:3,:]
# ╔═╡ 3a7fc3b9-e613-469e-b806-bb739de8f3dd
griddata[1,:]
# ╔═╡ 626db287-dd44-4119-866e-1ba63f6f5b46
griddata[:,:a]
# ╔═╡ 5985148a-0801-4822-9409-bebdd4eaca70
griddata[:,:geometry]
# ╔═╡ 1961d39a-2088-4036-b969-c58b9fba7a95
md"""
## Geospatial transforms 🌎 🔁 🌍 🔁 🗾
Data sets often come with missing values, poorly formatted variable names, among other issues. We provide **geospatial transforms** that can be used to pre-process geospatial data in more sophisticated workflows.
In the following basic example, we define two such transforms that
1. drop rows with missing values and
2. rename variables to more readable names
These transforms are placed into a sequential pipeline with the `→` (`\to`) operator:
"""
# ╔═╡ e6b7fcf1-3a51-4cc2-b2af-b961f52f43d2
pipe₀ = DropMissing() → Rename(:Auppm => :Au, :Agppm => :Ag, :Cuppm => :Cu,
:Asppm => :As, :Sper => :S, :CODE => :geo,
:OX => :litho, :ISBD => :ρ)
# ╔═╡ f3f6fb26-0341-4491-8858-23002788bc13
md"""
We load the Bonnie data set again:
"""
# ╔═╡ abdecbd1-b034-49c8-9e51-6ff41da56ef2
raw = georef(csv, (:EAST,:NORTH,:RL))
# ╔═╡ 62da1d70-3ab1-4513-a1c1-cab794e3517c
md"""
and apply the pipeline to it:
"""
# ╔═╡ 95199a0a-c4c0-458e-be73-0722022d9959
data = raw |> pipe₀
# ╔═╡ b21a8e7e-2aa1-4fa6-b459-779d2795f171
md"""
### Building pipelines
"""
# ╔═╡ 770afbad-9aac-4443-a64a-f8660ec71b5b
md"""
#### Exercise
Read the [transforms](https://juliaearth.github.io/GeoStats.jl/stable/transforms.html) documentation to find all available transforms and use Pluto's live docs to learn more about their options. Create a pipeline named `pipe₁` that
- replaces all missing values by the value zero
- coerces the types of variables `geo` and `litho` to `Multiclass`
"""
# ╔═╡ 43b3a2b5-29a2-414f-bc61-505cad078ea2
pipe₁ = Identity()
# ╔═╡ 3b8fd905-000f-4b22-af1b-221fdda43fd6
hint(md"`Coalesce` and `Coerce` are your friends.")
# ╔═╡ c87eec82-0a83-48fe-819d-a7b7af15ccab
md"""
Create a pipeline named `pipe₂` that
- selects variables `Au`, `Ag`, `Cu`, `As`, `S`
- performs principal component analysis
"""
# ╔═╡ 796b0ad0-97f2-43ce-a3c8-ad3233c068c4
pipe₂ = Identity()
# ╔═╡ 0c6b352f-5d4f-4dc3-8e96-c9b1f4d758a5
hint(md"`Select` columns before the analysis.")
# ╔═╡ 6dbcc263-4d42-4ad6-b87e-953b6594f7ed
md"""
Create a pipeline named `pipe₃` that
- selects variable `ρ`
- computes the z-score
"""
# ╔═╡ b1fc7dfc-8373-4f9c-8317-68f846e089da
pipe₃ = Identity()
# ╔═╡ 3e766129-f47d-4325-a6d8-21c2969e6df1
hint(md"`Select` columns before computing z-scores.")
# ╔═╡ 64b0b863-ff35-41ee-aac5-a3c28871400d
md"""
Create a pipeline named `pipe₄` that
- standardizes the coordinates to $[-1,1]^3$
- detrends all variables with polynomial of degree `1`
"""
# ╔═╡ a4567d04-3127-4f5c-9a2a-eda343ea8f0d
pipe₄ = Identity()
# ╔═╡ f6418489-e896-42ed-b21b-54eceddc54f4
hint(md"No more hints, you can do it! 😉")
# ╔═╡ 41a0a95a-0f19-4032-b29b-2be1409a101c
md"""
We can combine these pipelines into an advanced geospatial pipeline using `→` (`\to`) and `⊔` (`\sqcup`):
"""
# ╔═╡ 5fcc9839-1071-4343-be3b-e67a6fe04634
pipe = pipe₁ → pipe₂ ⊔ pipe₃ → pipe₄
# ╔═╡ 75c7c69a-f3e7-4069-9e71-539efe570a1f
md"""
Pipelines are executed in parallel whenever possible, and the geospatial domain is just forwarded when transforms only involve attributes (or features):
"""
# ╔═╡ c1db6c8b-93f9-40e0-8ad4-23d68d0e8f8e
data |> pipe
# ╔═╡ a336fb47-d38c-4743-9603-12ff0df29349
md"""
### More examples
A few more examples to illustrate the power of geospatial transforms and some important optimizations implemented behind the scenes:
"""
# ╔═╡ 8d0c982e-852b-4d1b-8bfd-34721b5c017d
data |> Coerce(:litho => Multiclass) |> OneHot(:litho)
# ╔═╡ 878f4824-1b4e-438b-ae24-83d3e4a9dbdd
md"""
Notice how filtering and sampling geospatial data doesn't create unnecessary copies of geometries:
"""
# ╔═╡ 74f8593c-8f8a-4de8-8198-4bc91055cb85
data |> Filter(row -> row.Au > 0.5 && row.Cu > 0) |> domain
# ╔═╡ 22db0757-4015-457c-91b9-84be73f6d8ed
data |> Sample(100, replace=false) |> domain
# ╔═╡ 346ad531-e73f-455b-8ba4-4186449096b5
md"""
We can easily revert pipelines over geospatial data:
"""
# ╔═╡ d4610837-6753-4009-b9d0-da4d2bcb05f0
p = Select(1:5) → PCA()
# ╔═╡ fa2c8ca3-f087-4f68-91b5-1ad9f7368e66
newdata, cache = apply(p, data)
# ╔═╡ b3f4986d-73f4-4d1d-8a13-bd60a502b041
revert(p, newdata, cache)
# ╔═╡ 5a50e2b6-4d5b-4a8b-86e6-e125487e88f4
md"""
## Advanced geodata science 🌎 📊 📈 📉
As geodata scientists, we often need to formulate questions that involve both the attributes and the geometries of geospatial data. Answering these questions with traditional data science software can be extremely painful.
"""
# ╔═╡ 05ab16f1-f26c-459c-9eab-e5059b93b04f
md"""
### Geospatial split-apply-combine
We provide a **geospatial split-apply-combine** with the macros **`@groupby`**, **`@transform`** and **`@combine`**.
To illustrate the functionality, let's start by transforming the point geometries into boxes. We define our transformation function:
"""
# ╔═╡ 0099c2d3-68e6-4e25-a970-f987bcd21b41
box(point) = Box(point - Vec(2.,2.,2.), point + Vec(2.,2.,2.))
# ╔═╡ 3541c307-52fd-4ac5-9a26-14778c1846da
md"""
and apply it to the "`geometry`" column:
"""
# ╔═╡ 48fe8aa0-166b-4d2b-b79e-55af3d46a29e
blocks = @transform(data, :geometry = box(:geometry))
# ╔═╡ ee629463-f164-4f4d-96f5-00cb6c742b86
md"""
Notice how the new geometry column is correctly interpreted as a `GeometrySet`:
"""
# ╔═╡ b0f5d306-ed68-4027-96ca-5e3facdf5097
blocks |> domain
# ╔═╡ cef05884-1b63-4f9d-b3a5-5f18f51f52cb
md"""
Let's assume that we are interested in computing the mean and standard deviation of gold grade (`Au`) inside each geology (`geo`). We can write the following:
"""
# ╔═╡ 851edf21-a5d8-4f29-b2b2-bc5ef1289540
@chain blocks begin
@groupby(:geo)
@combine(:μ = mean(:Au), :σ = std(:Au))
end
# ╔═╡ 4ece65f2-5e99-46e5-9c5d-8881e86d1c1a
md"""
The **`@chain`** macro simply takes geospatial data as input and feeds it into the other macros in sequence. Alternatively, we could have obtained the same result into two steps.
First, compute the groups:
"""
# ╔═╡ 20603dda-e08a-4d09-bbdf-dd5b9426cb4b
groups = @groupby(blocks, :geo)
# ╔═╡ de1bd127-3984-4bd6-bf4f-879f4f3b01f3
md"""
and then, compute the statistics:
"""
# ╔═╡ 31e34bcf-e307-4349-a1bc-8382c47df190
@combine(groups, :μ = mean(:Au), :σ = std(:Au))
# ╔═╡ 1a979cb0-b58c-4bcc-82d2-3c5ef7fef844
md"""
#### Exercise
We are interested in the total mass of gold (`Au`) that will be mined from each lithology (`litho`). Implement the following split-apply-combine:
1. `@groupby`: group geospatial data into different lithologies
2. `@transform`: compute the mass of gold ($\rho\times Au \times V(block)$)
3. `@combine`: sum the mass of all samples inside each lithology
You can commute steps (1) and (2) to debug intermediate results.
"""
# ╔═╡ f19c0254-854e-4010-bceb-542c923edd78
mined = missing
# ╔═╡ f905706b-cddf-4df6-bda1-fab5d76ce22a
md"""
What is the total mass to be mined?
"""
# ╔═╡ 7a551ec9-e922-4ccb-a2e4-cb4655855a9f
mass = missing
# ╔═╡ d9130545-c499-4ab2-bae0-6c646b184256
begin
scored2 = false
if ismissing(mass)
still_missing()
elseif mass isa Number && mass ≈ 1.46547827118592e6
scored2 = true
correct()
else
keep_working()
end
end
# ╔═╡ bac17589-8f36-43f6-b950-d268f916d748
hint(md"The function `volume` can be used to compute volumes.")
# ╔═╡ 12786110-d6ff-4734-8cb5-7aefe5b7d86a
md"""
We can directly visualize these new attributes over arbitrarily complex geospatial groups:
"""
# ╔═╡ c239b627-9d8c-4228-99db-b4c38556ff68
# mined |> viewer
# ╔═╡ 7e6409b8-d1a6-44c1-9004-65da69d507d0
md"""
## Additional resources
The [GeoStats.jl](https://github.com/JuliaEarth/GeoStats.jl) framework is quite comprehensive. We won't have the time to cover it properly here, but I would like to mention a few packages that you may find useful at AIRCentre:
- [GeoTables.jl](https://github.com/JuliaEarth/GeoTables.jl): Load and save geospatial tables from known file formats (*.shp, *.gjson, etc.).
- [INMET.jl](https://github.com/JuliaClimate/INMET.jl): Download data from the Instituto Nacional de Metereologia (INMET).
- [CDSAPI.jl](https://github.com/JuliaClimate/CDSAPI.jl): Download data from the Climate Data Store (CDS).
To give an example, here is how you can load and visualize a shapefile:
"""
# ╔═╡ e7f9997a-4316-48fa-9710-482e1e906350
shp = GeoTables.load("data/ne_110m_admin_0_countries/ne_110m_admin_0_countries.shp")
# ╔═╡ b02c5a10-10d0-4e9b-86aa-503340312726
shp |> viewer
# ╔═╡ c57f4c80-b17d-4c54-b034-d0da66857bd0
md"""
### Coffee break 😉
#### Questions? Ideas? Let's chat!
![break](https://media2.giphy.com/media/Rmu0SUVH8l1du/giphy.gif?cid=ecf05e4708wn9ubdd3bw9t4ysdkdq4xx6quse2wt5r3b65yx&rid=giphy.gif&ct=g)
"""
# ╔═╡ 00000000-0000-0000-0000-000000000001
PLUTO_PROJECT_TOML_CONTENTS = """
[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
GeoStats = "dcc97b0b-8ce5-5539-9008-bb190f959ef6"
GeoStatsViz = "36492b79-4a51-4dff-89b6-31e03c9a81c2"
GeoTables = "e502b557-6362-48c1-8219-d30d308dcdb0"
PlutoTeachingTools = "661c6b06-c737-4d37-b85c-46df65de6f69"
PlutoUI = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
WGLMakie = "276b4fcb-3e11-5398-bf8b-a0c2d153d008"
[compat]
CSV = "~0.10.7"
DataFrames = "~1.4.4"
GeoStats = "~0.36.2"
GeoStatsViz = "~0.1.5"
GeoTables = "~1.2.0"
PlutoTeachingTools = "~0.2.5"
PlutoUI = "~0.7.49"
WGLMakie = "~0.8.3"
"""
# ╔═╡ 00000000-0000-0000-0000-000000000002
PLUTO_MANIFEST_TOML_CONTENTS = """
# This file is machine-generated - editing it directly is not advised
julia_version = "1.9.0-beta2"
manifest_format = "2.0"
project_hash = "68d0efd63f14f22582b66b3c4d9c85576635bd6e"
[[deps.AbstractFFTs]]
deps = ["ChainRulesCore", "LinearAlgebra"]
git-tree-sha1 = "69f7020bd72f069c219b5e8c236c1fa90d2cb409"
uuid = "621f4979-c628-5d54-868e-fcf4e3e8185c"
version = "1.2.1"
[[deps.AbstractPlutoDingetjes]]
deps = ["Pkg"]
git-tree-sha1 = "8eaf9f1b4921132a4cff3f36a1d9ba923b14a481"
uuid = "6e696c72-6542-2067-7265-42206c756150"
version = "1.1.4"
[[deps.AbstractTrees]]
git-tree-sha1 = "52b3b436f8f73133d7bc3a6c71ee7ed6ab2ab754"
uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
version = "0.4.3"
[[deps.Adapt]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "195c5505521008abea5aee4f96930717958eac6f"
uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
version = "3.4.0"
[[deps.Animations]]
deps = ["Colors"]
git-tree-sha1 = "e81c509d2c8e49592413bfb0bb3b08150056c79d"
uuid = "27a7e980-b3e6-11e9-2bcd-0b925532e340"
version = "0.4.1"
[[deps.ArchGDAL]]
deps = ["CEnum", "ColorTypes", "Dates", "DiskArrays", "Extents", "GDAL", "GeoFormatTypes", "GeoInterface", "GeoInterfaceRecipes", "ImageCore", "Tables"]
git-tree-sha1 = "70908bb727c9a0ba863c5145aa48ee838cc29b84"
uuid = "c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3"
version = "0.9.3"
[[deps.ArgCheck]]
git-tree-sha1 = "a3a402a35a2f7e0b87828ccabbd5ebfbebe356b4"
uuid = "dce04be8-c92d-5529-be00-80e4d2c0e197"
version = "2.3.0"
[[deps.ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
version = "1.1.1"
[[deps.ArnoldiMethod]]
deps = ["LinearAlgebra", "Random", "StaticArrays"]
git-tree-sha1 = "62e51b39331de8911e4a7ff6f5aaf38a5f4cc0ae"
uuid = "ec485272-7323-5ecc-a04f-4719b315124d"
version = "0.2.0"
[[deps.ArrayInterfaceCore]]
deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"]
git-tree-sha1 = "14c3f84a763848906ac681f94cf469a851601d92"
uuid = "30b0a656-2188-435a-8636-2ec0e6a096e2"
version = "0.1.28"
[[deps.Arrow_jll]]
deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Lz4_jll", "Pkg", "Thrift_jll", "Zlib_jll", "boost_jll", "snappy_jll"]
git-tree-sha1 = "d64cb60c0e6a138fbe5ea65bcbeea47813a9a700"
uuid = "8ce61222-c28f-5041-a97a-c2198fb817bf"
version = "10.0.0+1"
[[deps.Artifacts]]
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
[[deps.Automa]]
deps = ["Printf", "ScanByte", "TranscodingStreams"]
git-tree-sha1 = "d50976f217489ce799e366d9561d56a98a30d7fe"
uuid = "67c07d97-cdcb-5c2c-af73-a7f9c32a568b"
version = "0.8.2"
[[deps.AxisAlgorithms]]
deps = ["LinearAlgebra", "Random", "SparseArrays", "WoodburyMatrices"]
git-tree-sha1 = "66771c8d21c8ff5e3a93379480a2307ac36863f7"
uuid = "13072b0f-2c55-5437-9ae7-d433b7a33950"
version = "1.0.1"
[[deps.AxisArrays]]
deps = ["Dates", "IntervalSets", "IterTools", "RangeArrays"]
git-tree-sha1 = "1dd4d9f5beebac0c03446918741b1a03dc5e5788"
uuid = "39de3d68-74b9-583c-8d2d-e117c070f3a9"
version = "0.4.6"
[[deps.BangBang]]
deps = ["Compat", "ConstructionBase", "Future", "InitialValues", "LinearAlgebra", "Requires", "Setfield", "Tables", "ZygoteRules"]
git-tree-sha1 = "7fe6d92c4f281cf4ca6f2fba0ce7b299742da7ca"
uuid = "198e06fe-97b7-11e9-32a5-e1d131e6ad66"
version = "0.3.37"
[[deps.Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
[[deps.Baselet]]
git-tree-sha1 = "aebf55e6d7795e02ca500a689d326ac979aaf89e"
uuid = "9718e550-a3fa-408a-8086-8db961cd8217"
version = "0.1.1"
[[deps.Bessels]]
git-tree-sha1 = "f91c8ff27feaa4a80861d3c4629ff66f88107333"
uuid = "0e736298-9ec6-45e8-9647-e4fc86a2fe38"
version = "0.2.7"
[[deps.BitFlags]]
git-tree-sha1 = "43b1a4a8f797c1cddadf60499a8a077d4af2cd2d"
uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35"
version = "0.1.7"
[[deps.Bzip2_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "19a35467a82e236ff51bc17a3a44b69ef35185a2"
uuid = "6e34b625-4abd-537c-b88f-471c36dfa7a0"
version = "1.0.8+0"
[[deps.CEnum]]
git-tree-sha1 = "eb4cb44a499229b3b8426dcfb5dd85333951ff90"
uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82"
version = "0.4.2"
[[deps.CRC32c]]
uuid = "8bf52ea8-c179-5cab-976a-9e18b702a9bc"
[[deps.CSV]]
deps = ["CodecZlib", "Dates", "FilePathsBase", "InlineStrings", "Mmap", "Parsers", "PooledArrays", "SentinelArrays", "SnoopPrecompile", "Tables", "Unicode", "WeakRefStrings", "WorkerUtilities"]
git-tree-sha1 = "8c73e96bd6817c2597cfd5615b91fca5deccf1af"
uuid = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
version = "0.10.8"
[[deps.Cairo_jll]]
deps = ["Artifacts", "Bzip2_jll", "CompilerSupportLibraries_jll", "Fontconfig_jll", "FreeType2_jll", "Glib_jll", "JLLWrappers", "LZO_jll", "Libdl", "Pixman_jll", "Pkg", "Xorg_libXext_jll", "Xorg_libXrender_jll", "Zlib_jll", "libpng_jll"]
git-tree-sha1 = "4b859a208b2397a7a623a03449e4636bdb17bcf2"
uuid = "83423d85-b0ee-5818-9007-b63ccbeb887a"
version = "1.16.1+1"
[[deps.Calculus]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "f641eb0a4f00c343bbc32346e1217b86f3ce9dad"
uuid = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9"
version = "0.5.1"
[[deps.CategoricalArrays]]
deps = ["DataAPI", "Future", "Missings", "Printf", "Requires", "Statistics", "Unicode"]
git-tree-sha1 = "5084cc1a28976dd1642c9f337b28a3cb03e0f7d2"
uuid = "324d7699-5711-5eae-9e2f-1d82baa6b597"
version = "0.10.7"
[[deps.Chain]]
git-tree-sha1 = "8c4920235f6c561e401dfe569beb8b924adad003"
uuid = "8be319e6-bccf-4806-a6f7-6fae938471bc"
version = "0.5.0"
[[deps.ChainRulesCore]]
deps = ["Compat", "LinearAlgebra", "SparseArrays"]
git-tree-sha1 = "e7ff6cadf743c098e08fca25c91103ee4303c9bb"
uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
version = "1.15.6"
[[deps.ChangesOfVariables]]
deps = ["ChainRulesCore", "LinearAlgebra", "Test"]
git-tree-sha1 = "38f7a08f19d8810338d4f5085211c7dfa5d5bdd8"
uuid = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0"
version = "0.1.4"
[[deps.CircularArrays]]
deps = ["OffsetArrays"]
git-tree-sha1 = "3587fdbecba8c44f7e7285a1957182711b95f580"
uuid = "7a955b69-7140-5f4e-a0ed-f168c5e2e749"
version = "1.3.1"
[[deps.Clustering]]
deps = ["Distances", "LinearAlgebra", "NearestNeighbors", "Printf", "Random", "SparseArrays", "Statistics", "StatsBase"]
git-tree-sha1 = "64df3da1d2a26f4de23871cd1b6482bb68092bd5"
uuid = "aaaa29a8-35af-508c-8bc3-b662a17a0fe5"
version = "0.14.3"
[[deps.CoDa]]
deps = ["AxisArrays", "Distances", "Distributions", "FillArrays", "LinearAlgebra", "Printf", "Random", "ScientificTypes", "StaticArrays", "Statistics", "StatsBase", "TableTransforms", "Tables"]
git-tree-sha1 = "ea05d865cabea9e5a71f43d3ea38ed2b1d92c2cd"
uuid = "5900dafe-f573-5c72-b367-76665857777b"
version = "1.0.6"
[[deps.CodeTracking]]
deps = ["InteractiveUtils", "UUIDs"]
git-tree-sha1 = "0e5c14c3bb8a61b3d53b2c0620570c332c8d0663"
uuid = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2"
version = "1.2.0"
[[deps.CodecZlib]]
deps = ["TranscodingStreams", "Zlib_jll"]
git-tree-sha1 = "ded953804d019afa9a3f98981d99b33e3db7b6da"
uuid = "944b1d66-785c-5afd-91f1-9de20f533193"
version = "0.7.0"
[[deps.ColorBrewer]]
deps = ["Colors", "JSON", "Test"]
git-tree-sha1 = "61c5334f33d91e570e1d0c3eb5465835242582c4"
uuid = "a2cac450-b92f-5266-8821-25eda20663c8"
version = "0.4.0"
[[deps.ColorSchemes]]
deps = ["ColorTypes", "ColorVectorSpace", "Colors", "FixedPointNumbers", "Random", "SnoopPrecompile"]
git-tree-sha1 = "aa3edc8f8dea6cbfa176ee12f7c2fc82f0608ed3"
uuid = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
version = "3.20.0"
[[deps.ColorTypes]]
deps = ["FixedPointNumbers", "Random"]
git-tree-sha1 = "eb7f0f8307f71fac7c606984ea5fb2817275d6e4"
uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
version = "0.11.4"
[[deps.ColorVectorSpace]]
deps = ["ColorTypes", "FixedPointNumbers", "LinearAlgebra", "SpecialFunctions", "Statistics", "TensorCore"]
git-tree-sha1 = "600cc5508d66b78aae350f7accdb58763ac18589"
uuid = "c3611d14-8923-5661-9e6a-0046d554d3a4"
version = "0.9.10"
[[deps.Colors]]
deps = ["ColorTypes", "FixedPointNumbers", "Reexport"]
git-tree-sha1 = "fc08e5930ee9a4e03f84bfb5211cb54e7769758a"
uuid = "5ae59095-9a9b-59fe-a467-6f913c188581"
version = "0.12.10"
[[deps.Combinatorics]]
git-tree-sha1 = "08c8b6831dc00bfea825826be0bc8336fc369860"
uuid = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
version = "1.0.2"
[[deps.CommonSubexpressions]]
deps = ["MacroTools", "Test"]
git-tree-sha1 = "7b8a93dba8af7e3b42fecabf646260105ac373f7"
uuid = "bbf7d656-a473-5ed7-a52c-81e309532950"
version = "0.3.0"
[[deps.Compat]]
deps = ["Dates", "LinearAlgebra", "UUIDs"]
git-tree-sha1 = "00a2cccc7f098ff3b66806862d275ca3db9e6e5a"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "4.5.0"
[[deps.CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
version = "1.0.2+0"
[[deps.CompositionsBase]]
git-tree-sha1 = "455419f7e328a1a2493cabc6428d79e951349769"
uuid = "a33af91c-f02d-484b-be07-31d278c5ca2b"
version = "0.1.1"
[[deps.ConstructionBase]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "fb21ddd70a051d882a1686a5a550990bbe371a95"
uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
version = "1.4.1"
[[deps.Contour]]
git-tree-sha1 = "d05d9e7b7aedff4e5b51a029dced05cfb6125781"
uuid = "d38c429a-6771-53c6-b99e-75d170b6e991"
version = "0.6.2"
[[deps.CpuId]]
deps = ["Markdown"]
git-tree-sha1 = "fcbb72b032692610bfbdb15018ac16a36cf2e406"
uuid = "adafc99b-e345-5852-983c-f28acb93d879"
version = "0.3.1"
[[deps.Crayons]]
git-tree-sha1 = "249fe38abf76d48563e2f4556bebd215aa317e15"
uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
version = "4.1.1"
[[deps.DBFTables]]
deps = ["Printf", "Tables", "WeakRefStrings"]
git-tree-sha1 = "f5b78d021b90307fb7170c4b013f350e6abe8fed"
uuid = "75c7ada1-017a-5fb6-b8c7-2125ff2d6c93"
version = "1.0.0"
[[deps.DataAPI]]
git-tree-sha1 = "e8119c1a33d267e16108be441a287a6981ba1630"
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
version = "1.14.0"
[[deps.DataDeps]]
deps = ["HTTP", "Libdl", "Reexport", "SHA", "p7zip_jll"]
git-tree-sha1 = "bc0a264d3e7b3eeb0b6fc9f6481f970697f29805"
uuid = "124859b0-ceae-595e-8997-d05f6a7a8dfe"
version = "0.7.10"
[[deps.DataFrames]]
deps = ["Compat", "DataAPI", "Future", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Random", "Reexport", "SnoopPrecompile", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"]
git-tree-sha1 = "d4f69885afa5e6149d0cab3818491565cf41446d"
uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
version = "1.4.4"
[[deps.DataStructures]]
deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
git-tree-sha1 = "d1fff3a548102f48987a52a2e0d114fa97d730f0"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.18.13"
[[deps.DataValueInterfaces]]
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464"
version = "1.0.0"
[[deps.Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
[[deps.DefineSingletons]]
git-tree-sha1 = "0fba8b706d0178b4dc7fd44a96a92382c9065c2c"
uuid = "244e2a9f-e319-4986-a169-4d1fe445cd52"
version = "0.1.2"
[[deps.Deno_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "64cb698de672b627f887ced4b2a722d217e73c10"
uuid = "04572ae6-984a-583e-9378-9577a1c2574d"
version = "1.28.1+0"
[[deps.DensityInterface]]
deps = ["InverseFunctions", "Test"]
git-tree-sha1 = "80c3e8639e3353e5d2912fb3a1916b8455e2494b"
uuid = "b429d917-457f-4dbc-8f4c-0cc954292b1d"
version = "0.4.0"
[[deps.DensityRatioEstimation]]
deps = ["LinearAlgebra", "Parameters", "Random", "Requires", "Statistics", "StatsBase"]
git-tree-sha1 = "bf66188ffadc748d9108482108a9fc62c3eb3637"
uuid = "ab46fb84-d57c-11e9-2f65-6f72e4a7229f"
version = "1.0.0"
[[deps.Dictionaries]]
deps = ["Indexing", "Random", "Serialization"]
git-tree-sha1 = "e82c3c97b5b4ec111f3c1b55228cebc7510525a2"
uuid = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4"
version = "0.3.25"
[[deps.DiffResults]]
deps = ["StaticArraysCore"]
git-tree-sha1 = "782dd5f4561f5d267313f23853baaaa4c52ea621"
uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5"
version = "1.1.0"
[[deps.DiffRules]]
deps = ["IrrationalConstants", "LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"]
git-tree-sha1 = "c5b6685d53f933c11404a3ae9822afe30d522494"
uuid = "b552c78f-8df3-52c6-915a-8e097449b14b"
version = "1.12.2"
[[deps.DiskArrays]]
deps = ["OffsetArrays"]
git-tree-sha1 = "27ebdcf03ca847fa484f28273db57de3c8514920"
uuid = "3c3547ce-8d99-4f5e-a174-61eb10b00ae3"
version = "0.3.8"
[[deps.Distances]]
deps = ["LinearAlgebra", "SparseArrays", "Statistics", "StatsAPI"]
git-tree-sha1 = "3258d0659f812acde79e8a74b11f17ac06d0ca04"
uuid = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
version = "0.10.7"
[[deps.Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
[[deps.Distributions]]
deps = ["ChainRulesCore", "DensityInterface", "FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SparseArrays", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns", "Test"]
git-tree-sha1 = "a7756d098cbabec6b3ac44f369f74915e8cfd70a"
uuid = "31c24e10-a181-5473-b8eb-7969acd0382f"
version = "0.25.79"
[[deps.DocStringExtensions]]
deps = ["LibGit2"]
git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d"
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.9.3"
[[deps.Downloads]]
deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
version = "1.6.0"
[[deps.DualNumbers]]
deps = ["Calculus", "NaNMath", "SpecialFunctions"]
git-tree-sha1 = "5837a837389fccf076445fce071c8ddaea35a566"
uuid = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74"
version = "0.6.8"
[[deps.EarCut_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "e3290f2d49e661fbd94046d7e3726ffcb2d41053"
uuid = "5ae413db-bbd1-5e63-b57d-d24a61df00f5"
version = "2.2.4+0"
[[deps.Expat_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "bad72f730e9e91c08d9427d5e8db95478a3c323d"
uuid = "2e619515-83b5-522b-bb60-26c02a35a201"
version = "2.4.8+0"
[[deps.Extents]]
git-tree-sha1 = "5e1e4c53fa39afe63a7d356e30452249365fba99"