Dear GeoServer users,
I have a layer which shows data from a meteorology station network in using very specific graphics symbol.
The symbol consists of a colored square to the left and a colored rectangle to the right of feature's anchor point, with a possibility of label drawn over the rectangle.
I'm using my custom PNG icons as <ExternalGraphic> and choose the right colors according to feature data as follows:
<Rule>
<Name>stations</Name>
<PointSymbolizer>
<Graphic>
<ExternalGraphic>
<OnlineResource xlink:type="simple" xlink:href="file://station_${TENDENCY}_${SPA}_${PREC}_${TEMP_DRY}_${TEMP_WATER}.png"/>
<Format>image/png</Format>
</ExternalGraphic>
</Graphic>
</PointSymbolizer>
<TextSymbolizer>
<Label>
<ogc:PropertyName>TEXT</ogc:PropertyName>
</Label>
<Font>
<CssParameter name="font-family">Arial</CssParameter>
<CssParameter name="font-size">14</CssParameter>
<CssParameter name="font-style">normal</CssParameter>
<CssParameter name="font-weight">bold</CssParameter>
</Font>
<LabelPlacement>
<PointPlacement>
<AnchorPoint>
<AnchorPointX>0</AnchorPointX>
<AnchorPointY>0</AnchorPointY>
</AnchorPoint>
<Displacement>
<DisplacementX>-2</DisplacementX>
<DisplacementY>4</DisplacementY>
</Displacement>
</PointPlacement>
</LabelPlacement>
<Fill>#FFFFFF</Fill>
</TextSymbolizer>
</Rule>
The problem is that the icons might overlap and when they do the text is drawn always on top, regardless of relative z-index of the icon it belongs to. Here's an example: http://imgur.com/YxwieHW
It seems to me all graphics are rendered first and all labels are rendered after.
What can I do about it?
I tried using shapes from SLD styles but I need to use more than one shape for every feature. GeoServer renders multiple shapes centered around anchor point and there is no possibility to use Displacement for graphic (AFAIK it's possible only with text labels). That's why I use ExternalGraphic, I need to show all shapes side by side.
Many thanks
--
Peter Kovac
IMS Programmer
MicroStep-MIS
peter.kovac@anonymised.com