我遇到了 GeoServer SLD XML 的问题。
我的 XML 代码如下:
<Fill>
<CssParameter name="fill">
<ogc:Function name="if_then_else">
<ogc:Function name="isNull">
<ogc:PropertyName>LTE_RSRP</ogc:PropertyName>
</ogc:Function>
<ogc:Literal>#FF0000</ogc:Literal>
<ogc:Function name="Interpolate">
<ogc:PropertyName>LTE_RSRP</ogc:PropertyName>
<ogc:Literal>-80</ogc:Literal>
<ogc:Literal>#ff0000</ogc:Literal>
<ogc:Literal>-70</ogc:Literal>
<ogc:Literal>#00ff00</ogc:Literal>
<ogc:Literal>-60</ogc:Literal>
<ogc:Literal>#0000ff</ogc:Literal>
<ogc:Literal>color</ogc:Literal>
</ogc:Function>
</ogc:Function>
</CssParameter>
<CssParameter name="fill-opacity">0.3</CssParameter>
</Fill>
我的意图如下:
- 如果 LTE_RSRP 为空,则填写#FF0000。
- 否则,插入颜色。
但是当应用上述 XML 时,会出现以下错误。
ERROR [geotools.rendering] - Filter Function problem for function if_then_else argument #2 - expected type Object
这里,参数 #2 是函数 Interpolate。(参数计数从0开始,根据geotools源代码。)看起来函数Interpolate的返回值不是一个对象。
这是故意的吗?还是我做错了什么?