Skip to content

Commit

Permalink
handle sequence cmap
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Mar 18, 2024
1 parent 90393fa commit cbd54f2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/titiler/core/titiler/core/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

1 comment on commit cbd54f2

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'TiTiler performance Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.30.

Benchmark suite Current: cbd54f2 Previous: ffd67af Ratio
WebMercator longest_transaction 0.08 s 0.06 s 1.33

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.