diff --git a/raster_api/runtime/setup.py b/raster_api/runtime/setup.py index d2860fc8..28f92b43 100644 --- a/raster_api/runtime/setup.py +++ b/raster_api/runtime/setup.py @@ -7,7 +7,7 @@ inst_reqs = [ "boto3", - "rio-tiler==6.5.0", + "rio-tiler==7.2.2", "titiler.pgstac==1.3.0", "titiler.core>=0.18.5,<0.19", "titiler.mosaic>=0.18.5,<0.19", diff --git a/raster_api/runtime/src/cmap_data/README.md b/raster_api/runtime/src/cmap_data/README.md index 1a489350..2377adca 100644 --- a/raster_api/runtime/src/cmap_data/README.md +++ b/raster_api/runtime/src/cmap_data/README.md @@ -109,4 +109,26 @@ 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 +``` + +##### Tornadoes colormap + +```python +from rio_tiler.colormap import parse_color +import json + +# Colormap for Enhanced Fujita (EF) scale ratings +tornado_ef_scale = { + "-1": "#b3bcc9", + "0": "#add8e6", + "1": "#90ee90", + "2": "#ffe71f", + "3": "#ffa500", + "4": "#ff0000", + "5": "#ff00ff" +} + +cmap = {int(i):parse_color(tornado_ef_scale[i]) for i in tornado_ef_scale} + +with open('tornado_ef_scale.json', 'w') as f: + json.dump(cmap, f) \ No newline at end of file diff --git a/raster_api/runtime/src/cmap_data/tornado_ef_scale.json b/raster_api/runtime/src/cmap_data/tornado_ef_scale.json new file mode 100644 index 00000000..f6d9c9d6 --- /dev/null +++ b/raster_api/runtime/src/cmap_data/tornado_ef_scale.json @@ -0,0 +1 @@ +{"-1": [179, 188, 201, 255], "0": [173, 216, 230, 255], "1": [144, 238, 144, 255], "2": [255, 231, 31, 255], "3": [255, 165, 0, 255], "4": [255, 0, 0, 255], "5": [255, 0, 255, 255]} \ No newline at end of file diff --git a/raster_api/runtime/src/dependencies.py b/raster_api/runtime/src/dependencies.py index cee0a08b..1e97d3cf 100644 --- a/raster_api/runtime/src/dependencies.py +++ b/raster_api/runtime/src/dependencies.py @@ -10,8 +10,9 @@ # Try backported to PY<39 `importlib_resources`. from importlib_resources import files as resources_files # type: ignore + VEDA_CMAPS_FILES = { - f.stem: str(f) for f in (resources_files(__package__) / "cmap_data").glob("*.npy") # type: ignore + f.stem: str(f) for f in (resources_files(__package__) / "cmap_data").glob("*.[npy json]*") # type: ignore } cmap = default_cmap.register(VEDA_CMAPS_FILES) ColorMapParams = create_colormap_dependency(cmap)