2

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 でログ エラーが発生しています:「Null フォント サイズが指定されました」。フォント サイズを設定するために乗算関数が機能しないのはなぜですか?

更新:乗算関数を使用して、スケールに基づいてフォント サイズを設定する必要はありません。以下の例に示すように、代わりに Categorize 関数を使用してください。

4

1 に答える 1

4

これがどのように機能したか私に尋ねないでください。しかし、それは完璧に機能します!

<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>

注: 目盛りの分母に基づいて、フォント サイズ/範囲を調整します。

于 2015-12-16T14:35:53.700 に答える