All,I am trying to create a label that consists of some text with a rectangular border around it. I currently have a TextSymbolizer with a Label and a Graphic using the WellKnownName "square". This gets the desired result for a single line of text but if the text contains multiple lines the square graphic is not placed correctly.
I am reading from a PostgreSQL table that contains the text with new lines. I can also get the same result by using a single line and adding a very small autoWrap to create multi-line text. Here is an example of the text I am inserting:
UDPATE my_table SET label=E'First line\nSecond line\nThird line';This thread is similar but I think was created before this was implemented at all:
http://osgeo-org.1560.x6.nabble.com/SLD-Graphic-inside-TextSymbolizer-Relative-placements-td4992671.htmlAfter playing with all the SLD options I believe this is a bug and I am beginning to look through the GS/GT code. Has anyone seen this before? If not, can someone point me to the classes I should be looking at?
I'm using PostgreSQL 9.0 with PostGIS 1.5.2 and tried both GeoServer 2.2.4 and 2.4.4. Attached is my SLD and images of a single line and multi line text. I'm using a point geometry that is located in the middle of the text in both images.
Thanks, Michael Romero Software Engineer Forward Slope, Inc. 619-780-0175
<<attachment: Multi_Line_Label.png>>
<<attachment: Single_Line_Label.png>>
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NamedLayer>
<Name>published</Name>
<UserStyle>
<Name>published</Name>
<FeatureTypeStyle>
<!-- Generic TEXT types -->
<Rule>
<Name>text</Name>
<MinScaleDenominator>0</MinScaleDenominator>
<TextSymbolizer>
<Label>
<ogc:PropertyName>label</ogc:PropertyName>
</Label>
<Font>
<CssParameter name="font-family">SansSerif</CssParameter>
</Font>
<LabelPlacement>
<PointPlacement>
<AnchorPoint>
<AnchorPointX>0.5</AnchorPointX>
<AnchorPointY>0.5</AnchorPointY>
</AnchorPoint>
<Displacement>
<DisplacementX>0</DisplacementX>
<DisplacementY>0</DisplacementY>
</Displacement>
<Rotation>0</Rotation>
</PointPlacement>
</LabelPlacement>
<Fill>
<CssParameter name="fill">#000000</CssParameter>
</Fill>
<Graphic>
<Mark>
<WellKnownName>square</WellKnownName>
<Fill>
<CssParameter name="fill">#FFFFFF</CssParameter>
<CssParameter name="fill-opacity">1.0</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">#969696</CssParameter>
<CssParameter name="stroke-width">2</CssParameter>
</Stroke>
</Mark>
<Size>24</Size>
</Graphic>
<VendorOption name="graphic-resize">stretch</VendorOption>
<VendorOption name="graphic-margin">5</VendorOption>
</TextSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech
_______________________________________________ Geoserver-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
