Skip to content

Commit c84d1d0

Browse files
committed
feat(raster): added new soil texture colormap
1 parent c3919f7 commit c84d1d0

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

raster_api/runtime/src/cmap_data/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,33 @@ for c, v in internal_colormap.items():
8080

8181
np.save("nlcd.npy", cmap)
8282
```
83+
84+
##### Soil texture colormap
85+
86+
```python
87+
from rio_tiler.colormap import parse_color
88+
import numpy as np
89+
90+
# These categories are based on a USGS soil texture chart, not an official set of color mappings for soil texture categories
91+
texture_categories = {
92+
"1": "#F89E61",
93+
"2": "#BA8560",
94+
"3": "#D8D2B4",
95+
"4": "#AE734C",
96+
"5": "#9E8478",
97+
"6": "#C6A365",
98+
"7": "#B4A67D",
99+
"8": "#E1D4C4",
100+
"9": "#BEB56D",
101+
"10": "#777C7A",
102+
"11": "#A89B6F",
103+
"12": "#E9E2AF"
104+
}
105+
106+
cmap = np.zeros((256, 4), dtype=np.uint8)
107+
cmap[:] = np.array([0, 0, 0, 255])
108+
for k in texture_categories.keys():
109+
cmap[int(k)] = np.array(parse_color(texture_categories[k]))
110+
111+
np.save("soil_texture.npy", cmap)
112+
```
1.13 KB
Binary file not shown.

0 commit comments

Comments
 (0)