Skip to content

GenericPiecewiseOpImage does not reset NODATA value #264

@aaime

Description

@aaime

When applying GenericPiecewiseOpImage, and in particular, also its subclass RasterClassifierOpImage, the output image has the same nodata as the input, because no attempt to reset it has been made (so it gets inherited).
However, the operation gets a "gap value" input that is used to fill nodata in inputs, so technically, the output image does not have a "NODATA" (or has the gap value as nodata, but this is a decision the caller should take).

This has been noticed when working on rendering with SLD raster symbolizercolormaps in GeoServer:

  • The input image is rendered via the colormap, two entries end up having "white" as the value, 0 and 255
  • The output is padded with 0 to enlarge the image, fitting the requested area (larger than the raster)
  • The encoding in PNG works fine, but with JPEG the expansion to RGB happens and the nodata becomes black instead of white, creating a rectangular black region around the output, e.g.:

image

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