diff --git a/raster_api/runtime/setup.py b/raster_api/runtime/setup.py index 28f92b43..d2860fc8 100644 --- a/raster_api/runtime/setup.py +++ b/raster_api/runtime/setup.py @@ -7,7 +7,7 @@ inst_reqs = [ "boto3", - "rio-tiler==7.2.2", + "rio-tiler==6.5.0", "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 2377adca..b86363a6 100644 --- a/raster_api/runtime/src/cmap_data/README.md +++ b/raster_api/runtime/src/cmap_data/README.md @@ -115,7 +115,7 @@ np.save("soil_texture.npy", cmap) ```python from rio_tiler.colormap import parse_color -import json +import numpy as np # Colormap for Enhanced Fujita (EF) scale ratings tornado_ef_scale = { @@ -128,7 +128,10 @@ tornado_ef_scale = { "5": "#ff00ff" } -cmap = {int(i):parse_color(tornado_ef_scale[i]) for i in tornado_ef_scale} +cmap = np.zeros((256, 4), dtype=np.uint8) +cmap[:] = np.array([0, 0, 0, 255]) +for k in tornado_ef_scale.keys(): + cmap[int(k)] = np.array(parse_color(tornado_ef_scale[k])) -with open('tornado_ef_scale.json', 'w') as f: - json.dump(cmap, f) \ No newline at end of file +np.save("tornadoes.npy", cmap) +``` \ 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 deleted file mode 100644 index f6d9c9d6..00000000 --- a/raster_api/runtime/src/cmap_data/tornado_ef_scale.json +++ /dev/null @@ -1 +0,0 @@ -{"-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/cmap_data/tornadoes.npy b/raster_api/runtime/src/cmap_data/tornadoes.npy new file mode 100644 index 00000000..85dee39a Binary files /dev/null and b/raster_api/runtime/src/cmap_data/tornadoes.npy differ diff --git a/raster_api/runtime/src/dependencies.py b/raster_api/runtime/src/dependencies.py index 1e97d3cf..cee0a08b 100644 --- a/raster_api/runtime/src/dependencies.py +++ b/raster_api/runtime/src/dependencies.py @@ -10,9 +10,8 @@ # 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 json]*") # type: ignore + f.stem: str(f) for f in (resources_files(__package__) / "cmap_data").glob("*.npy") # type: ignore } cmap = default_cmap.register(VEDA_CMAPS_FILES) ColorMapParams = create_colormap_dependency(cmap)