I am trying to use two TextSymbolizer tags within the same rule. However,
when I do this, only one of the text symbols is rendered. I have no issues
when I use a TextSymbolizer with a Graphic tag. My goal overall is to use a
true type font rather than an external graphic for a background for a label
(for instance, a true type highway shield rather than a graphic).
Any suggestions?
Thanks,
Todd
--
View this message in context: http://www.nabble.com/SLD%3A-two-text-symboloizers-within-same-rule-tp21210778p21210778.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
Todd Fagin ha scritto:
I am trying to use two TextSymbolizer tags within the same rule. However,
when I do this, only one of the text symbols is rendered.
Yep, of course, because the two conflict with each other (label conflict
resolution)
I have no issues when I use a TextSymbolizer with a Graphic tag. My goal overall is to use a
true type font rather than an external graphic for a background for a label
(for instance, a true type highway shield rather than a graphic).
Any suggestions?
Keep on using the Graphic, that will ensure that either both of label
and graphic will be painter, or none of them, and use the new dynamic symbolizers support to treat your font as a source of Marks, see here:
http://blog.geoserver.org/2008/12/16/dynamic-symbolizers-part-2/
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.
Andrea,
I also need to put a background on a textsymbolizer which is a ttf symbol.
Using Graphic element as suggest in dynamic-symbolizers tip works fine if
it's an PointSymbolizer. I couldn´t test on textsymbolizer because geoserver
didn't even validate the sld. I looked up on StyleLayerDescriptor schema and
TextSymbolizer element doesn't have Graphic as part of is type...
my sld:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<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>cadrede_gis:GIR_INFRA_NODES</Name>
<UserStyle>
<Name>sld_node_mh</Name>
<FeatureTypeStyle>
<Rule>
<Name>Câmara de Tampa Quadrada em Passeio</Name>
<Abstract>Styling SLD for Câmara de Tampa Quadrada em
Passeio</Abstract>
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>SUBTYPE</ogc:PropertyName>
<ogc:Literal>4</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<TextSymbolizer>
<Label>b</Label>
<CssParameter name="font-family">GIR-TelecomImg</CssParameter>
<CssParameter name="font-size">
<ogc:Mul>
<ogc:PropertyName>SCALE_FACTOR</ogc:PropertyName>
<ogc:Literal>3</ogc:Literal>
</ogc:Mul>
</CssParameter>
<LabelPlacement>
<PointPlacement>
<Rotation>
<ogc:PropertyName>ROTATION</ogc:PropertyName>
</Rotation>
</PointPlacement>
</LabelPlacement>
<Fill>
<CssParameter name="fill">
<ogc:Literal>#FFFFFF</ogc:Literal>
</CssParameter>
</Fill>
<Graphic>
<Mark>
<WellKnownName>ttf://GIR-TelecomWeb#0xF062</WellKnownName>
<Fill>
<CssParameter name="fill">#FFCC00</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">#008888</CssParameter>
</Stroke>
</Mark>
<Size>30</Size>
</Graphic>
</TextSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
Andrea Aime-4 wrote:
Todd Fagin ha scritto:
I am trying to use two TextSymbolizer tags within the same rule. However,
when I do this, only one of the text symbols is rendered.
Yep, of course, because the two conflict with each other (label conflict
resolution)
I have no issues when I use a TextSymbolizer with a Graphic tag. My goal
overall is to use a
true type font rather than an external graphic for a background for a
label
(for instance, a true type highway shield rather than a graphic).
Any suggestions?
Keep on using the Graphic, that will ensure that either both of label
and graphic will be painter, or none of them, and use the new dynamic
symbolizers support to treat your font as a source of Marks, see here:
http://blog.geoserver.org/2008/12/16/dynamic-symbolizers-part-2/
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.
------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
View this message in context: http://www.nabble.com/SLD%3A-two-text-symboloizers-within-same-rule-tp21210778p21379111.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
Pedro Mendes ha scritto:
Andrea,
I also need to put a background on a textsymbolizer which is a ttf symbol.
Using Graphic element as suggest in dynamic-symbolizers tip works fine if
it's an PointSymbolizer. I couldn´t test on textsymbolizer because geoserver
didn't even validate the sld. I looked up on StyleLayerDescriptor schema and
TextSymbolizer element doesn't have Graphic as part of is type...
Indeed that's our custom extension. Disable schema validation and it should work.
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.
Andrea,
I disabled the schema validation and i get the following output image
http://www.nabble.com/file/p21415937/wms_4.png
with this sld
http://www.nabble.com/file/p21415937/sld_node_mh.sld sld_node_mh.sld
where is used a TextSymbolizer with a Label for a white brackground (custom
TTF symbol) and a Graphic (custom TTF symbol) for the foreground. Seems like
the symbols rendered with the Graphic aren't beeing put over the correct
pixels, this is over the white symbols.
I get a good result when is used two rules, both with TextSymbolizers
rendering a symbol from two different custom TTFs, one to give the
background and other the foreground.
http://www.nabble.com/file/p21415937/wms_3.png
But it will be less cumbersome having just a Rule...I think.
Cumps,
Pedro Mendes
Andrea Aime-4 wrote:
Pedro Mendes ha scritto:
Andrea,
I also need to put a background on a textsymbolizer which is a ttf
symbol.
Using Graphic element as suggest in dynamic-symbolizers tip works fine if
it's an PointSymbolizer. I couldn´t test on textsymbolizer because
geoserver
didn't even validate the sld. I looked up on StyleLayerDescriptor schema
and
TextSymbolizer element doesn't have Graphic as part of is type...
Indeed that's our custom extension. Disable schema validation and it
should work.
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.
------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
--
View this message in context: http://www.nabble.com/SLD%3A-two-text-symboloizers-within-same-rule-tp21210778p21415937.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
Pedro Mendes ha scritto:
Andrea,
I disabled the schema validation and i get the following output image http://www.nabble.com/file/p21415937/wms_4.png with this sld
http://www.nabble.com/file/p21415937/sld_node_mh.sld sld_node_mh.sld where is used a TextSymbolizer with a Label for a white brackground (custom
TTF symbol) and a Graphic (custom TTF symbol) for the foreground. Seems like
the symbols rendered with the Graphic aren't beeing put over the correct
pixels, this is over the white symbols.
Ouch yeah, that does not look good. Can you send me the font as well?
It's a bug, I'd like to fix it but I need something to reproduce
it. With the standard wingdings I cannot properly specify the label
(wingdings chars being unprintable).
I get a good result when is used two rules, both with TextSymbolizers
rendering a symbol from two different custom TTFs, one to give the
background and other the foreground.
http://www.nabble.com/file/p21415937/wms_3.png
But it will be less cumbersome having just a Rule...I think.
Indeed. If that output is really what you want, and not a simplified
example, you can get the same by using a point symbolizer with a
square Mark, and specifying a colored thick stroke and a white fill
for it.
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.