I am trying to create an SLD style that will allow polygons (in the same <FeatureTypeStyle>
, but as separate or the same Symbolizers) to 'patch' compose themselves, which is to say, when one polygon with say 0.5 opacity is placed over another polygon (again, in the same FeatureTypeStyle) with 0.5 opacity, it will 'replace' the part of the 'destination' polygon (the polygon that was drawn first) with the 'source' polygon (the polygon that was drawn second), maintaining the same 0.5 opacity.
There are some vendor options for composition modes here, as well as a way to specify a new 'composite-base', i.e. 'destination', here, but you can only specify a new 'composite-base' on a FeatureTypeStyle level, not on a Symbolizer based level (which may be necessary for goal (2) below). Does anyone know how to do this or if it is possible on a Rule based level, or any possible workarounds (ideally, that are entirely SLD based, even if using GeoServer extensions or vendor options)?
To further clarify, there are two goals I am trying to accomplish:
- A way to composite Symbolizers, so that both the color and opacity of the 'source' overwrite the color and opacity of the 'destination'. i.e. (The dark orange shape is a separate FeatureTypeStyle/style/layer, the yellow, green, purple, and light red shapes are all seperate Symbolizers within the same FeatureTypeStyle/style/layer)
Correct example (note how the yellow and pink shapes replace the green and purple shapes without increasing the opacity of the layer, but when they overlap the dark orange shape, the opacity increases):
Incorrect example (current behavior):
- If necessary, way to composite a Symbolizer with itself, so that if two features within the same layer/symbolizer overlap, they behave as in (1), with the subsequent feature overwriting both the color and opacity of the previous feature. (Both yellow shapes are two features in the same layer and FeatureTypeStyle Symbolizer.)
Correct example:
Incorrect example (Opacity of the overlapping features increases. This is wrong):