Hi, Java 8 GeoServer 2.8.3
Working through my issue to label my latitude lines at the "ends" of the line,
I have this section of my label rule to tell me where it "is supposed to be"
<sld:TextSymbolizer>
<sld:Label>
<ogc:Function name="strSubstring">
<ogc:PropertyName>bottom</ogc:PropertyName>
<ogc:Function name="parseInt">
<ogc:Literal>0</ogc:Literal>
</ogc:Function>
<ogc:Function name="strIndexOf">
<ogc:PropertyName>bottom</ogc:PropertyName>
<ogc:Literal>.</ogc:Literal>
</ogc:Function>
</ogc:Function>
Expected Label Location<![CDATA[
]]>
<ogc:Function name="Concatenate">
<ogc:Literal>POINT(</ogc:Literal>
<!-- <ogc:Function name="getX"><ogc:Function
name="endPoint"><ogc:PropertyName>geom</ogc:PropertyName></ogc:Function></ogc:Function>
-->
<ogc:Function name="strSubString">
<ogc:Function name="env">
<ogc:Literal>wms_bbox</ogc:Literal>
</ogc:Function>
<ogc:Add>
<ogc:Function name="strIndexOf">
<ogc:Function
name="env">
<ogc:Literal>wms_bbox</ogc:Literal>
</ogc:Function>
<ogc:Literal>:</ogc:Literal>
</ogc:Function>
<ogc:Literal>2</ogc:Literal>
</ogc:Add>
<ogc:Function name="strIndexOf">
<ogc:Function name="env">
<ogc:Literal>wms_bbox</ogc:Literal>
</ogc:Function>
<ogc:Literal>,</ogc:Literal>
</ogc:Function>
</ogc:Function>
<ogc:Literal><![CDATA[ ]]></ogc:Literal>
<ogc:Function name="getY"><ogc:Function
name="endPoint"><ogc:PropertyName>geom</ogc:PropertyName></ogc:Function></ogc:Function>
<ogc:Literal>)</ogc:Literal>
</ogc:Function>
Blah blah other labels, font etc
</sld:Label>
</sld:TextSymbolizer>
</sld:Rule>
<sld:Rule>
<sld:Name>label rule</sld:Name>
<sld:LineSymbolizer>
<sld:Stroke>
<sld:CssParameter name="stroke">#66A61E</sld:CssParameter>
</sld:Stroke>
</sld:LineSymbolizer>
<sld:TextSymbolizer>
<sld:Geometry>
<ogc:Function name="geomFromWKT">
<ogc:Function name="Concatenate">
<ogc:Literal>POINT(</ogc:Literal>
<ogc:Function name="strSubString">
<ogc:Function name="env">
<ogc:Literal>wms_bbox</ogc:Literal>
</ogc:Function>
<ogc:Add>
<ogc:Function name="strIndexOf">
<ogc:Function
name="env">
<ogc:Literal>wms_bbox</ogc:Literal>
</ogc:Function>
<ogc:Literal>:</ogc:Literal>
</ogc:Function>
<ogc:Literal>2</ogc:Literal>
</ogc:Add>
<ogc:Function name="strIndexOf">
<ogc:Function name="env">
<ogc:Literal>wms_bbox</ogc:Literal>
</ogc:Function>
<ogc:Literal>,</ogc:Literal>
</ogc:Function>
</ogc:Function>
<ogc:Literal><![CDATA[ ]]></ogc:Literal>
<ogc:Function name="getY"><ogc:Function
name="endPoint"><ogc:PropertyName>geom</ogc:PropertyName></ogc:Function></ogc:Function>
<ogc:Literal>)</ogc:Literal>
</ogc:Function>
</ogc:Function>
</sld:Geometry>
<sld:Label>
<ogc:Function
name="strSubstring">
<ogc:PropertyName>bottom</ogc:PropertyName>
<ogc:Function name="parseInt">
<ogc:Literal>0</ogc:Literal>
</ogc:Function>
<ogc:Function name="strIndexOf">
<ogc:PropertyName>bottom</ogc:PropertyName>
<ogc:Literal>.</ogc:Literal>
</ogc:Function>
</ogc:Function>°0'0"
</sld:Label>
<sld:Font>
<sld:CssParameter name="font-family">Arial</sld:CssParameter>
<sld:CssParameter name="font-size">10.0</sld:CssParameter>
<sld:CssParameter name="font-style">normal</sld:CssParameter>
<sld:CssParameter name="font-weight">normal</sld:CssParameter>
</sld:Font>
<LabelPlacement>
<PointPlacement>
<AnchorPoint>
<AnchorPointX>0.0</AnchorPointX>
<AnchorPointY>0.0</AnchorPointY>
</AnchorPoint>
<Displacement>
<DisplacementX>40</DisplacementX>
<DisplacementY>0</DisplacementY>
</Displacement>
<Rotation>0</Rotation>
</PointPlacement>
</LabelPlacement>
<sld:Fill>
<sld:CssParameter name="fill">#0000FF</sld:CssParameter>
</sld:Fill>
</sld:TextSymbolizer>
</sld:Rule>
However, I get the label ~96 pixels from the LEFT of the output image instead
of the expected 40 pixels from the RIGHT of the output (see image with ->
Expect Point)
I added another rule (first one above) to print at standard location where it
is expected to be before moving with the displacement. (Image not to full size)
[cid:[email protected]]
Is there something I am missing in my rules, or mistaking what the displacement
is supposed to do? My understanding is it should be XX pixels from the
geometry point.
Thanks,
Chris Snider
Senior Software Engineer
Intelligent Software Solutions, Inc.
[Description: Description: Description: cid:[email protected]]
------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi
_______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
