In my project I have a SLD style which contain Transformation function. The SLD style is looks like this:
<PointSymbolizer>
<Fill>
<CssParameter name="fill">
<ogc:Function name="Recode">
<ogc:PropertyName>nature</ogc:PropertyName>
<ogc:Literal>Commercial</ogc:Literal>
<ogc:Literal>#ba0d5a</ogc:Literal>
<ogc:Literal>Residential</ogc:Literal>
<ogc:Literal>#ba0d5a</ogc:Literal>
</ogc:Function>
</CssParameter>
</Fill>
</PointSymbolizer>
The output of the above looks like this:
So the map is showing properly, but I need to display LegendGraphic also. But requesting LegendGraphic is returning only one symbol
How to get legend based on different attribute?
EDIT :: For your reference this is my complete SLD file
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NamedLayer>
<Name>MadhyamgramGIS:apartment</Name>
<UserStyle>
<Title>Dynamic Apartment Layer</Title>
<Abstract>Dynamic style for point layer</Abstract>
<FeatureTypeStyle>
<Rule>
<Name>Rule1</Name>
<Title>Apartment Layer</Title>
<Abstract>Point Rule</Abstract>
<PointSymbolizer>
<Graphic>
<Mark>
<WellKnownName>circle</WellKnownName>
<Fill>
<CssParameter name="fill">
<ogc:Function name="Recode">
<ogc:PropertyName>nature</ogc:PropertyName>
<ogc:Literal>Commercial</ogc:Literal>
<ogc:Literal>#ba0d5a</ogc:Literal>
<ogc:Literal>Residential</ogc:Literal>
<ogc:Literal>#ba0d5a</ogc:Literal>
</ogc:Function>
</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">
<ogc:Function name="Recode">
<ogc:PropertyName>nature</ogc:PropertyName>
<ogc:Literal>Commercial</ogc:Literal>
<ogc:Literal>#B0C4DE</ogc:Literal>
<ogc:Literal>Residential</ogc:Literal>
<ogc:Literal>#16e023</ogc:Literal>
</ogc:Function>
</CssParameter>
<CssParameter name="stroke-width">
<ogc:Function name="Recode">
<ogc:PropertyName>nature</ogc:PropertyName>
<ogc:Literal>Commercial</ogc:Literal>
<ogc:Literal>1</ogc:Literal>
<ogc:Literal>Residential</ogc:Literal>
<ogc:Literal>2</ogc:Literal>
</ogc:Function>
</CssParameter>
</Stroke>
</Mark>
<Size>12</Size>
</Graphic>
</PointSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>