我正在使用GeoServer环境。我试图设置字体大小使用sld的基础上的比例。到目前为止,我有以下几点:
<CssParameter name="font-size">
<ogc:Mult>
<ogc:Function name="env">
<ogc:Literal>wms_scale_denominator</ogc:Literal>
</ogc:Function>
<ogc:Literal>.001</ogc:Literal>
</ogc:Mult>
</CssParameter>但是我在GeoServer中得到了一个日志错误:“指定的无字体大小”。为什么乘法函数不能设置字体大小?
更新:不需要使用乘法函数根据比例设置字体大小。使用分类函数,如下面的示例所示。
发布于 2015-12-16 14:35:53
不要问我这是如何工作的,但它的工作完美!
<CssParameter name="font-size">
<ogc:Function name="Categorize">
<!-- Value to transform -->
<ogc:Function name="env">
<ogc:Literal>wms_scale_denominator</ogc:Literal>
</ogc:Function>
<!-- Output values and thresholds -->
<!-- Font Size Range [<= 5000]=14, [5000-10000]=10, and [>10000]=6 -->
<ogc:Literal>14</ogc:Literal>
<ogc:Literal>5000</ogc:Literal>
<ogc:Literal>10</ogc:Literal>
<ogc:Literal>10000</ogc:Literal>
<ogc:Literal>6</ogc:Literal>
</ogc:Function>
</CssParameter>注意:根据你的刻度分母调整字体大小/范围。
https://stackoverflow.com/questions/34313980
复制相似问题