Hi,
I am working through some issues with labeling my latitude lines on the extreme right side of a WMS pull. I have the labels generating where I want, but only for a couple of specific zoom levels. What I would like to do is determine how much space a given label would be in degrees (since I am using 4326 for everything) and subtract that from the edge of my wms_bbox. I got the log algorithm from:
This is the SLD rule:
sld:Namedefault rule</sld:Name>
<sld:CssParameter name=“stroke”>#66A61E</sld:CssParameter>
</sld:Stroke>
</sld:LineSymbolizer>
<ogc:Function name=“geomFromWKT”>
<ogc:Function name=“Concatenate”>
ogc:LiteralPOINT(</ogc:Literal>
<ogc:Function name=“parseDouble”>
<ogc:Function name=“strSubstring”>
<ogc:Function name=“strSubString”>
<ogc:Function name=“env”>
ogc:Literalwms_bbox</ogc:Literal>
</ogc:Function>
<ogc:Function name=“strIndexOf”>
<ogc:Function name=“env”>
ogc:Literalwms_bbox</ogc:Literal>
</ogc:Function>
ogc:Literal:</ogc:Literal>
</ogc:Function>
ogc:Literal2</ogc:Literal>
</ogc:Add>
<ogc:Function name=“strIndexOf”>
<ogc:Function name=“env”>
ogc:Literalwms_bbox</ogc:Literal>
</ogc:Function>
ogc:Literal,</ogc:Literal>
</ogc:Function>
</ogc:Function>
<!—This section is attempting to move the Y coordinate left a little bit to display the text portion →
ogc:Literal1</ogc:Literal>
<ogc:Function name=“log”>
<ogc:Function name=“env”>
ogc:Literalwms_scale_denominator</ogc:Literal>
</ogc:Function>
</ogc:Function>
</ogc:Div>
ogc:Literal0.0513</ogc:Literal>
</ogc:Sub>
ogc:Literal0.08</ogc:Literal>
</ogc:Div>
ogc:Literal.13</ogc:Literal>
</ogc:Mul>
ogc:Literal1</ogc:Literal>
</ogc:Add>
</ogc:Sub>
ogc:Literal0</ogc:Literal>
ogc:Literal8</ogc:Literal>
</ogc:Function>
</ogc:Function>
ogc:Literal</ogc:Literal>
<ogc:Function name=“getY”><ogc:Function name=“endPoint”>ogc:PropertyNamegeom</ogc:PropertyName></ogc:Function></ogc:Function>
ogc:Literal)</ogc:Literal>
</ogc:Function>
</ogc:Function>
</sld:Geometry>
<ogc:Function name=“strSubstring”>
ogc:PropertyNamebottom</ogc:PropertyName>
<ogc:Function name=“parseInt”>
ogc:Literal0</ogc:Literal>
</ogc:Function>
<ogc:Function name=“strIndexOf”>
ogc:PropertyNamebottom</ogc:PropertyName>
ogc:Literal.</ogc:Literal>
</ogc:Function>
</ogc:Function>
</sld:Label>
<sld:CssParameter name=“font-family”>Arial</sld:CssParameter>
<sld:CssParameter name=“font-size”>15.0</sld:CssParameter>
<sld:CssParameter name=“font-style”>normal</sld:CssParameter>
<sld:CssParameter name=“font-weight”>normal</sld:CssParameter>
</sld:Font>
<sld:CssParameter name=“fill”>#FF00FF</sld:CssParameter>
</sld:Fill>
</sld:TextSymbolizer>
</sld:Rule>
Chris Snider
Senior Software Engineer
Intelligent Software Solutions, Inc.