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

GenericPiecewiseOpImage does not reset NODATA value #264

Open
aaime opened this issue Apr 1, 2020 · 0 comments
Open

GenericPiecewiseOpImage does not reset NODATA value #264

aaime opened this issue Apr 1, 2020 · 0 comments

Comments

@aaime
Copy link
Member

aaime commented Apr 1, 2020

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

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