Limit in region mapping #5362
-
Hello, I'm having a problem with WMS region mapping. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
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: terriajs/lib/Map/ImageryProviderHooks.js Lines 30 to 54 in 6dc8cc3 I think you could add regions 65536 and onwards using a red value of 1, then 2 (that way it's backwards compatible with the original r = 0 scheme for the first 65535 regions). You'll need to update that function. I think you can do that without forking terriajs given how it's exported. Just write at the top of index.js: var ImageryProviderHooks = require("terriajs/lib/Map/ImageryProviderHooks.js")
ImageryProviderHooks.recolorImage = function(image, colorFunc) {
// new function that decodes 0-65535 and 65536+
} And then update the geoserver styling to match your extended scheme. |
Beta Was this translation helpful? Give feedback.
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:
terriajs/lib/Map/ImageryProviderHooks.js
Lines 30 to 54 in 6dc8cc3