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

support colormap for raster layers on mapserver #58

Open
pvgenuchten opened this issue Mar 7, 2022 · 0 comments
Open

support colormap for raster layers on mapserver #58

pvgenuchten opened this issue Mar 7, 2022 · 0 comments

Comments

@pvgenuchten
Copy link
Contributor

colormaps for rasters is currently not implemented for mapfiles. would be nice to add it. the challenge is that a single rule generates multiple classes, the code seems to only able to handle a single class per rule.

clazz = processRule(rule)

not sure how to improve that, suggestion for implementation of the rastersymbolizer

def _rasterSymbolizer(sl):
    style=[]

    if "colorMap" in sl:
        colMap = sl["colorMap"]
        prvQuantity = "0"
        for entry in colMap["colorMapEntries"]:
            stClass = {
                "NAME": entry["label"],
                "COLOR": entry["color"],
                "EXPRESSION": "([PIXEL]> {0} AND [PIXEL]<= {1})".format(prvQuantity, entry["quantity"]),
                "opacity": entry["opacity"],
            }
            prvQuantity = entry["quantity"]
            style.append(stClass)
    return style
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