Skip to content

support colormap for raster layers on mapserver #58

Open
@pvgenuchten

Description

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions