From c84d1d03ee9865cb50c191fa802469f22dc4111e Mon Sep 17 00:00:00 2001 From: Alexandra Kirk Date: Thu, 17 Oct 2024 16:19:08 -0600 Subject: [PATCH] feat(raster): added new soil texture colormap --- raster_api/runtime/src/cmap_data/README.md | 30 ++++++++++++++++++ .../runtime/src/cmap_data/soil_texture.npy | Bin 0 -> 1152 bytes 2 files changed, 30 insertions(+) create mode 100644 raster_api/runtime/src/cmap_data/soil_texture.npy diff --git a/raster_api/runtime/src/cmap_data/README.md b/raster_api/runtime/src/cmap_data/README.md index 91c39ecc..1a489350 100644 --- a/raster_api/runtime/src/cmap_data/README.md +++ b/raster_api/runtime/src/cmap_data/README.md @@ -80,3 +80,33 @@ for c, v in internal_colormap.items(): np.save("nlcd.npy", cmap) ``` + +##### Soil texture colormap + +```python +from rio_tiler.colormap import parse_color +import numpy as np + +# These categories are based on a USGS soil texture chart, not an official set of color mappings for soil texture categories +texture_categories = { + "1": "#F89E61", + "2": "#BA8560", + "3": "#D8D2B4", + "4": "#AE734C", + "5": "#9E8478", + "6": "#C6A365", + "7": "#B4A67D", + "8": "#E1D4C4", + "9": "#BEB56D", + "10": "#777C7A", + "11": "#A89B6F", + "12": "#E9E2AF" +} + +cmap = np.zeros((256, 4), dtype=np.uint8) +cmap[:] = np.array([0, 0, 0, 255]) +for k in texture_categories.keys(): + cmap[int(k)] = np.array(parse_color(texture_categories[k])) + +np.save("soil_texture.npy", cmap) +``` \ No newline at end of file diff --git a/raster_api/runtime/src/cmap_data/soil_texture.npy b/raster_api/runtime/src/cmap_data/soil_texture.npy new file mode 100644 index 0000000000000000000000000000000000000000..1a1a65183d712a40615a863144b182cedd809d0d GIT binary patch literal 1152 zcmbR27wQ`j$;eQ~P_3SlTAW;@Zl$1JQ);NLqoAIaUsO_*m=~X4l#&V(cT3DEP6dh= zXCxM+0{I$7re-<{CYm}5wF+bcE(QjM|3Bs>{@>M_@c+i8E&taQ`~08RQt|)T;?)0J qmeu}$c;(3deOq(?m)BJNUokuX|I0_~|AX|5;?Xb|O#?$e4FCWeOfiK3 literal 0 HcmV?d00001