SLD(Style Layer Descriptor)樣式層描述符
基于XML語言
創(chuàng)建樣式,相對比較簡單。
1. SLD Hello World
1.1 Create the SLD File----OK
1.2 Load Your New SLD ----OK
1.3 Give a FeatureType Your New SLD---OK
View the Style---OK
2. SLD Text Symbolizers 文本符號----OK 存在問題:使用中國地圖顯示異常,請求樣式不適用于圖層,進一步操作??????
Modify the SLD File to Include Text Symbolizers
<Label>: What label to give each rendered object. Here we use an attribute of the object, "TYPE". The property name is case sensitive. 標簽
<Font>: The font and size the label will have. 字體
<Fill>: The color that we will fill the font with 填充
3. Outlines and Filters -----OK
<ogc:Filter>
<ogc:Not>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>TYPE</ogc:PropertyName>
<ogc:Literal>highway</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Not>
</ogc:Filter>
<ogc:PropertyIsLessThan>
<ogc:PropertyIsGreaterThan>
The halo is essentially a buffer outline of the text. halo文本的暈環(huán)
4. What SLDs are, a text approach
SLD (Styled Layer Descriptor) is a specification put out by the OGC, that defines an XML language to allow users to define symbolization of their feature data. It was written to be a complement to their Web Map Service (WMS) specification, by extending it to allow users a way to define how they want to visualize their features.
Then there are 5 types of symbolizers you can use to actually portray the features,
(1)line, 線
(2)polygon, 多邊形
A Polygon Symbolizer has a geometry and a stroke, just like a line symbolizer, but also has a 'fill', defining what color to put in the center. Can be straight color, or a graphic, of varying opacity and the like.
(3)point, 點
A point symbolizer is made up of a geometry and a Graphic. A graphic is made of either an External Graphic, or a Mark, and has an opacity, a size, and a rotation. Opacity is the same as for the other symbolizers, Size is the absolute size of the graphic in pixels (default is to be dynamic), and rotation defines the rotation of the graphic in the clockwise dimension in decimal degrees. A Mark has a well known name (like square, circle, star, ect.), and a fill and a stroke. An External Graphic uses an xlink to refer to the location of an resource on the web to use to represent the point.
(4)text, 文本
A text symbolizer is made up of a Geometry, a Label, a Font, a LabelPlacement, a Halo, and a Fill.
(5)and raster. 光柵
A raster symbolizer consists of a Geometry(幾何學), opacity(透明度), channel selection(路線選擇), overlap behavior(交疊事件), color map(顏色地圖), contrast enhancement(對照增強), shaded relief(陰影浮雕) and image outline(圖像輪廓).