我有100个不同大小的多边形。我想用不同的颜色给每个多边形上色。我在polygon中有一个从1到100开始的属性'z-code‘。我能用这个吗?或者我应该使用我拥有的任何其他属性,例如,多边形的名称?
在Geo-Server的不同多边形中使用不同颜色的最好方法是什么?任何答案都是值得感谢的。
发布于 2016-09-02 16:26:42
最简单的方法是使用categorize函数将1- 100之间的值映射到颜色。所以你的SLD看起来像这样:
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">
<ogc:Function name="Categorize">
<!-- Value to transform -->
<ogc:PropertyName>z-code</ogc:PropertyName>
<!-- Output values and thresholds -->
<ogc:Literal>#87CEEB</ogc:Literal>
<ogc:Literal>0</ogc:Literal>
<ogc:Literal>#FFFACD</ogc:Literal>
<ogc:Literal>100</ogc:Literal>
<ogc:Literal>#F08080</ogc:Literal>
</ogc:Function>
</CssParameter>
</Fill>
</PolygonSymbolizer>https://stackoverflow.com/questions/39267145
复制相似问题