I am pretty new to GeoServer and am having some issues with styling rasters for Google Earth using the css plugin.

I have a raster that covers a particular areas which has 1 band and 6 values in that band. I have the following css style code

/* @title raster */
* {
raster-channels: auto;
raster-opacity: 0.4;
raster-color-map-type: values;
 color-map-entry(#00FF00, 0) color-map-entry(#008000, 1) color-map-entry(#00FFFF, 2) color-map-entry(#0000FF, 3)  color-map-entry(#FF8200, 4) color-map-entry(#FF0000, 5);  

On the preview I am getting the expected results (everything the right color and opacity according to plan). When I download the KML but with Google Earth I am seeing the raster with no opacity and surrounding the raster is black which covers the whole globe.

I have also found when i leave out the 'raster-color-map-type' property, it looks like I want it to, but I need discrete vales rather that ranges

Has anyone else seen this issue before, and do you have a way to fix it?


My guess is that Google Earth has troubles with the paletted PNG GeoServer generates when using a discrete colormap (as opposed to using a color ramp, which generated 32 bit full color PNGs. However I don't think there is a way to force GeoServer to generate PNG 24 bits in that case.

Maybe you can try the interpolation approach to deliver solid colors anyways like this (ugly, but may work):

raster-color-map: color-map-entry(#00FF00, 0) color-map-entry(#00FF00, 1) color-map-entry(#008000, 1) color-map-entry(#008000, 2) color-map-entry(#00FFFF, 2) color-map-entry(#00FFFF, 3) color-map-entry(#0000FF, 3) color-map-entry(#0000FF, 4) color-map-entry(#FF8200, 4) color-map-entry(#FF8200, 5) color-map-entry(#FF0000, 5);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.