From cbd54f2eff4400c4445b0647d0eaad2bb32cca4e Mon Sep 17 00:00:00 2001 From: vincentsarago Date: Mon, 18 Mar 2024 16:12:55 +0100 Subject: [PATCH] handle sequence cmap --- src/titiler/core/titiler/core/factory.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/titiler/core/titiler/core/factory.py b/src/titiler/core/titiler/core/factory.py index 312c26950..4763fe8e3 100644 --- a/src/titiler/core/titiler/core/factory.py +++ b/src/titiler/core/titiler/core/factory.py @@ -1868,7 +1868,13 @@ def colormap_metadata( ############################################################### # SEQUENCE CMAP if isinstance(cmap, Sequence): - raise NotImplementedError("Sequence colormap not supported") + values = [minv for ((minv, _), _) in cmap] + arr = numpy.array([values] * 20) + + if orientation == "vertical": + height = height or 256 if len(values) < 256 else len(values) + else: + width = width or 256 if len(values) < 256 else len(values) ############################################################### # DISCRETE CMAP