Skip to content

Limit in region mapping #5362

Discussion options

You must be logged in to vote

HI @josecarlosrodriguezcortes. As you've found this limit is the number of defined style colours. The region mapping style uses only blue and green pixel values.

Here is the function that does color -> region FID conversion:

/* Recolor a raster image pixel by pixel, replacing encoded identifiers with some calculated value. */
ImageryProviderHooks.recolorImage = function(image, colorFunc) {
var length = image.data.length; //pixel count * 4
for (var i = 0; i < length; i += 4) {
// Region identifiers are encoded in the blue and green channels, with R=0 and A=255
if (image.data[i + 3] < 255 ||

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@steve9164
Comment options

@josecarlosrodriguezcortes
Comment options

Answer selected by steve9164
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