`
enica
  • 浏览: 68972 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

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>


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


b.Displacement
<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>


2.Priority Labeling
根据人口来区分标签的级别 如果有冲突 高级别的会覆盖低级别的
City Name   | population
-------------+------------
Yonkers     |     197,818
Jersey City |     237,681
Newark      |     280,123
New York    |   8,107,916

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


3.Grouping Geometries(<VendorOption name="group">)分组显示
GeometryRepresentative Geometry
Point Setfirst point inside the view rectangle is used.
Line Setlines are (a) networked together (b) clipped to the view rectangle (c) middle of the longest network path is used.
Polygon Setpolygons are (a) clipped to the view rectangle (b) the centroid of the largest polygon is used.

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


4.Overlapping and Separating Labels (<VendorOption name="spaceAround">)
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>


......
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics