Carl Boettiger commited on
Commit
9f61a2c
1 Parent(s): ace796d
Files changed (4) hide show
  1. .gitignore +8 -0
  2. color.txt +50 -0
  3. colormap.R +8 -0
  4. tileserver-creator.sh +19 -0
.gitignore ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ .Rproj.user
2
+ .Rhistory
3
+ .RData
4
+ .Ruserdata
5
+ .ipynb_checkpoints
6
+ pad-us.Rproj
7
+ *.vrt
8
+ mobi-red
color.txt ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 1 252 226 220 0
2
+ 2 251 220 214 0
3
+ 3 250 214 209 0
4
+ 4 249 209 204 0
5
+ 5 249 203 198 0
6
+ 6 248 198 193 50
7
+ 7 247 192 188 50
8
+ 8 246 187 182 50
9
+ 9 246 181 177 50
10
+ 10 245 176 172 50
11
+ 11 244 170 166 255
12
+ 12 243 164 161 255
13
+ 13 243 159 156 255
14
+ 14 242 153 151 255
15
+ 15 241 148 145 255
16
+ 16 240 142 140 255
17
+ 17 240 137 135 255
18
+ 18 239 131 129 255
19
+ 19 238 126 124 255
20
+ 20 238 120 119 255
21
+ 21 237 114 113 255
22
+ 22 236 109 108 255
23
+ 23 235 103 103 255
24
+ 24 235 98 97 255
25
+ 25 234 92 92 255
26
+ 26 231 88 89 255
27
+ 27 225 85 88 255
28
+ 28 220 82 87 255
29
+ 29 215 79 86 255
30
+ 30 209 76 85 255
31
+ 31 204 73 84 255
32
+ 32 198 70 83 255
33
+ 33 193 67 82 255
34
+ 34 188 64 81 255
35
+ 35 182 61 80 255
36
+ 36 177 58 79 255
37
+ 37 172 55 78 255
38
+ 38 166 52 77 255
39
+ 39 161 49 76 255
40
+ 40 155 46 75 255
41
+ 41 150 43 74 255
42
+ 42 145 40 73 255
43
+ 43 139 37 72 255
44
+ 44 134 34 71 255
45
+ 45 128 31 70 255
46
+ 46 123 28 69 255
47
+ 47 118 25 68 255
48
+ 48 112 22 67 255
49
+ 49 107 19 66 255
50
+ 50 102 16 66 255
colormap.R ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+
2
+ x <- grDevices::colorRampPalette(c("#fce2dc", "#ea5a5a", "#661042"), bias=1, alpha=TRUE)
3
+ y <- x(50) |> grDevices::col2rgb(alpha=TRUE) |> t() |> as.data.frame()
4
+ y$alpha[1:5] <- 0
5
+ y$alpha[6:10] <- 50
6
+
7
+ y |> write.table("color.txt", quote = FALSE, col.names = FALSE)
8
+
tileserver-creator.sh ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+
4
+ #git lfs track "*.html"
5
+ #git lfs track "*.png"
6
+
7
+
8
+ gdal_translate -of VRT -ot Byte -scale /vsicurl/https://minio.carlboettiger.info/public-biodiversity/mobi/species-richness-all/SpeciesRichness_All.tif temp.vrt
9
+
10
+ gdaldem color-relief -of GTiff temp.vrt color.txt richness.vrt -alpha
11
+ gdal2tiles.py --xyz --zoom=1-10 --processes=24 richness.vrt mobi-red
12
+
13
+ mc cp -r mobi-red/ nvme/shared-data/mobi-tiles/red
14
+ #
15
+
16
+ ogr2ogr pad-us3.pmtiles /vsicurl/https://data.source.coop/cboettig/pad-us-3/pad-us3-combined.fgb
17
+
18
+
19
+