LabelingOptions(標籤選項)--GEOServer

來自http://geoserver.org/display/GEOSDOC/LabelingOptions
Controlling Label Placement(控制標籤位置)
1.Basic SLD Placement
1.1Point Geometries ("PointPlacement")
1.2Linear (line) geometries ("LinePlacement")

<xsd:element name="PointPlacement">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="sld:AnchorPoint" minOccurs="0"/>--(a)
<xsd:element ref="sld:Displacement" minOccurs="0"/>--(b)
<xsd:element ref="sld:Rotation" minOccurs="0"/>--(c)
</xsd:sequence>
</xsd:complexType>
</xsd:element>
...
<xsd:element name="LinePlacement">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="sld:PerpendicularOffset" minOccurs="0"/>--(d)
</xsd:sequence>
</xsd:complexType>
</xsd:element>


[b]a.AnchorPoint[/b]

<PointPlacement>
<AnchorPoint>
<AnchorPointX>
0.5
</AnchorPointX>
<AnchorPointY>
0.5
</AnchorPointY>
</AnchorPoint>
</PointPlacement>


[b]b.Displacement[/b]

<PointPlacement>
<Displacement>
<DisplacementX>
10--X的偏移值
</DisplacementX>
<DisplacementY>
0--Y的偏移值
</DisplacementY>
</Displacement>
</PointPlacement>


c.Rotation(旋轉角度)

<Rotation>
45
</Rotation>


d.LinePlacement

<LabelPlacement>
<LinePlacement>
<PerpendicularOffset>
10
</PerpendicularOffset>
</LinePlacement>
</LabelPlacement>


[b]2.Priority Labeling [/b]
根據人口來區分標籤的級別 如果有衝突 高級別的會覆蓋低級別的
City Name | population
-------------+------------
Yonkers | 197,818
Jersey City | 237,681
Newark | 280,123
New York | 8,107,916


<Priority>
<PropertyName>population</PropertyName>
</Priority>


[b]3.Grouping Geometries(<VendorOption name="group">)分組顯示[/b]
[table]
|[b]Geometry[/b]|[b]Representative Geometry[/b]
|Point Set|first point inside the view rectangle is used.
|Line Set|lines are (a) networked together (b) clipped to the view rectangle (c) middle of the longest network path is used.
|Polygon Set|polygons are (a) clipped to the view rectangle (b) the centroid of the largest polygon is used.
[/table]

<VendorOption name="group">yes</VendorOption>


[b]4.Overlapping and Separating Labels (<VendorOption name="spaceAround">)[/b]
By default geoserver will not put labels "on top of each other". By using the spaceAround option you can allow overlaps to overlap and you can also add extra space around a label.
<VendorOption name="spaceAround">10</VendorOption>


......
發佈了45 篇原創文章 · 獲贊 0 · 訪問量 2401
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章