首页 > 代码库 > SLD 官方实例
SLD 官方实例
1.PointSymbolizer
Example:
<PointSymbolizer> <Graphic> <Mark> <WellKnownName>circle</WellKnownName> <Fill> <CssParameter name="fill">#FF0000</CssParameter> </Fill> </Mark> <Size>6</Size> </Graphic> </PointSymbolizer>
<PointSymbolizer> <Graphic> <ExternalGraphic> <OnlineResource xlink:type="simple" xlink:href="file:///var/www/htdocs/sun.png" /> <Format>image.png</Format> </ExternalGraphic> </Graphic> </PointSymbolizer>
2.LineSymbolizer
Basic Example:
<LineSymbolizer> <Stroke> <CssParameter name="stroke">#0000FF</CssParameter> <CssParameter name="stroke-width">3</CssParameter> <CssParameter name="stroke-dasharray">5 2</CssParameter> </Stroke> </LineSymbolizer>
Offsetting lines:
<LineSymbolizer> <Stroke> <CssParameter name="stroke">#000000</CssParameter> <CssParameter name="stroke-width">2</CssParameter> </Stroke></LineSymbolizer><LineSymbolizer> <Stroke> <CssParameter name="stroke">#0000FF</CssParameter> <CssParameter name="stroke-width">3</CssParameter> <CssParameter name="stroke-dasharray">5 2</CssParameter> </Stroke> <PerpendicularOffset>3</PerpendicularOffset></LineSymbolizer>
Offsetting polygons:
<PolygonSymbolizer> <Stroke> <CssParameter name="stroke">#000000</CssParameter> <CssParameter name="stroke-width">2</CssParameter> </Stroke></PolygonSymbolizer><LineSymbolizer> <Stroke> <CssParameter name="stroke">#AAAAAA</CssParameter> <CssParameter name="stroke-width">3</CssParameter> </Stroke> <PerpendicularOffset>-2</PerpendicularOffset></LineSymbolizer>
3.PolygonSymbolizer
Example:
<PolygonSymbolizer> <Fill> <CssParameter name="fill">#000080</CssParameter> </Fill></PolygonSymbolizer>
4.TextSymbolizer
Example:
<TextSymbolizer> <Label> <ogc:PropertyName>name</ogc:PropertyName> </Label> <Font> <CssParameter name="font-family">Arial</CssParameter> <CssParameter name="font-size">12</CssParameter> <CssParameter name="font-style">normal</CssParameter> <CssParameter name="font-weight">bold</CssParameter> </Font> <LabelPlacement> <PointPlacement> <AnchorPoint> <AnchorPointX>0.5</AnchorPointX> <AnchorPointY>0.0</AnchorPointY> </AnchorPoint> <Displacement> <DisplacementX>0</DisplacementX> <DisplacementY>25</DisplacementY> </Displacement> <Rotation>-45</Rotation> </PointPlacement> </LabelPlacement> <Fill> <CssParameter name="fill">#990099</CssParameter> </Fill></TextSymbolizer>
Scalable Font Size:
<CssParameter name="font-size"> <ogc:Function name="Categorize"> <!-- Value to transform --> <ogc:Function name="env"> <ogc:Literal>wms_scale_denominator</ogc:Literal> </ogc:Function> <!-- Output values and thresholds --> <!-- Ranges: --> <!-- [scale <= 300, font 12] --> <!-- [scale 300 - 2500, font 10] --> <!-- [scale > 2500, font 8] --> <ogc:Literal>12</ogc:Literal> <ogc:Literal>300</ogc:Literal> <ogc:Literal>10</ogc:Literal> <ogc:Literal>2500</ogc:Literal> <ogc:Literal>8</ogc:Literal> </ogc:Function></CssParameter>
SLD 官方实例
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。