[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8 bit rasters with color table can't use DATARANGE based on pixel value #6969

Open
wicksell opened this issue Nov 17, 2023 · 0 comments
Open

Comments

@wicksell
Copy link
Contributor

What I can see, it is not possible to style a 8 bit raster with color table using DATARANGE based on the pixel value. The expression can be based on pixel value, but it always use the red component of the looked up color from the color table as range item.

It is quite common for the pixel value to contain the raster's information, e.g. slope, and the color table is just a style setting.

It would be great if RANGEITEM "pixel" could be used with 8 bit rasters. An alternative solution would be a processing directive that would tell MapServer to ignore the rasters color table and instead generate a default gray scale color table as done today for 8 bit rasters without color table.

CLASS
    NAME "Slope <= 29°"
    EXPRESSION ([pixel] >= 0 AND [pixel] <= 29)
    STYLE
        RANGEITEM "pixel"
        COLORRANGE 255 255 255  55 55 55
        DATARANGE 0 29
    END # STYLE
END # CLASS

I have tested this with both MapServer 7.6.1 and 8.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant