Skip to content

Algorithm contours returns 500: "Source data must be 1 band" #822

Discussion options

You must be logged in to vote

it's because you're trying to apply a colormap on top of the contour, which is not possible.

The contour algorithm will create a RGB with the Terrain colormap already applied

# Apply rescaling for minz,maxz to 1->255 and apply Terrain colormap
arr = linear_rescale(data, (self.minz, self.maxz), (1, 255)).astype(
self.output_dtype
)
arr, _ = apply_cmap(arr, cmap.get("terrain"))

We could totally make this colormap an algorithm option

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@davincent-ucl
Comment options

@davincent-ucl
Comment options

@vincentsarago
Comment options

Answer selected by davincent-ucl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants