Skip to content

Parameter conversion from STAC render extension to TiTiler #21

@StijnCaerts

Description

@StijnCaerts

We are trying to use a custom colormap configured in the STAC render extension, following the color map JSON definition.
https://github.com/stac-extensions/render?tab=readme-ov-file#render-object

But this is not recognized in TiTiler because the validation of the colormap parameter is expecting a str instead of a dict.

I was able to fix this locally by dumping the JSON dict back into a str when constructing the LayerDict, but I don't know if this is the best solution.

# TODO:
# special encoding for ColorMaps
render = layer["render"] or {}

# TODO:
# special encoding for ColorMaps
render = layer["render"] or {}
if "colormap" in render:
    render["colormap"] = json.dumps(render["colormap"])

Metadata

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