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>


......
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值