[Geoserver-users] multiple textsymbolizers within the same rule

Hi,

We are trying to display a symbol for points from a truetype font through geoserver. The symbol is actually composed of three characters from the font, laid on top of each other. To do this with geoserver, we have tried creating three different rules for each character and also three different textsymbolizers for the same rule (as seen below). In both cases, the problem is that geoserver only displays the last character listed in the sld. We thought that perhaps the last character was blocking out the others but this does not seem to be the case. First, is what I’m trying to do possible with sld? Second, can anyone see what I am doing wrong?

We could create an image of the symbol and use that; However, I do not see that as the ideal solution.

Thanks in advance for any help,
Scott

sld:Rule
sld:NameL-PLNT-TXST-DECI</sld:Name>
sld:TitleL-PLNT-TXST-DECI</sld:Title>
ogc:Filter
ogc:PropertyIsEqualTo
ogc:PropertyNamelayer</ogc:PropertyName>
ogc:LiteralL-PLNT-TXST-DECI</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>

õ

ESRI US MUTCD 3
18


#969696




0.5
0.5





ô

ESRI US MUTCD 3
18


#00A639




0.5
0.5





ó

ESRI US MUTCD 3
18


#9D4F21




0.5
0.5




</sld:Rule>

I'm pretty sure you can have multiple text symbolizers in the same rule, and looking at the code it does appear to be true.
But what might be happening is that the labeling will hide colliding labels, so you don't get a cluttered map. You can make sure your text symbolizer vendor option
<VendorOption name="spaceAround">0</VendorOption>
is set to zero.
But still, looking at the code, I think that only one is rendered.
Can anyone else shed some more light on the LabelCache and StreamingRenderer?

Brent Owens
(The Open Planning Project)

Scott Pezanowski wrote:

Hi,

We are trying to display a symbol for points from a truetype font through geoserver. The symbol is actually composed of three characters from the font, laid on top of each other. To do this with geoserver, we have tried creating three different rules for each character and also three different textsymbolizers for the same rule (as seen below). In both cases, the problem is that geoserver only displays the last character listed in the sld. We thought that perhaps the last character was blocking out the others but this does not seem to be the case. First, is what I'm trying to do possible with sld? Second, can anyone see what I am doing wrong?

We could create an image of the symbol and use that; However, I do not see that as the ideal solution.

Thanks in advance for any help,
Scott

        <sld:Rule>
        <sld:Name>L-PLNT-TXST-DECI</sld:Name>
          <sld:Title>L-PLNT-TXST-DECI</sld:Title>
          <ogc:Filter>
            <ogc:PropertyIsEqualTo>
              <ogc:PropertyName>layer</ogc:PropertyName>
              <ogc:Literal>L-PLNT-TXST-DECI</ogc:Literal>
            </ogc:PropertyIsEqualTo>
          </ogc:Filter>
        <TextSymbolizer>
        <Label>&#245;</Label>
        <Font>
          <CssParameter name="font-family">ESRI US MUTCD 3</CssParameter>
          <CssParameter name="font-size">18</CssParameter>
        </Font>
        <Fill>
          <CssParameter name="fill">#969696</CssParameter>
        </Fill>
        <LabelPlacement>
          <PointPlacement>
            <AnchorPoint>
            <AnchorPointX>0.5</AnchorPointX>
            <AnchorPointY>0.5</AnchorPointY>
            </AnchorPoint>
          </PointPlacement>
        </LabelPlacement>
        </TextSymbolizer>
        <TextSymbolizer>
        <Label>&#244;</Label>
        <Font>
          <CssParameter name="font-family">ESRI US MUTCD 3</CssParameter>
          <CssParameter name="font-size">18</CssParameter>
        </Font>
        <Fill>
          <CssParameter name="fill">#00A639</CssParameter>
        </Fill>
        <LabelPlacement>
          <PointPlacement>
            <AnchorPoint>
            <AnchorPointX>0.5</AnchorPointX>
            <AnchorPointY>0.5</AnchorPointY>
            </AnchorPoint>
          </PointPlacement>
        </LabelPlacement>
        </TextSymbolizer>
        <TextSymbolizer>
        <Label>&#243;</Label>
        <Font>
          <CssParameter name="font-family">ESRI US MUTCD 3</CssParameter>
          <CssParameter name="font-size">18</CssParameter>
        </Font>
        <Fill>
          <CssParameter name="fill">#9D4F21</CssParameter>
        </Fill>
        <LabelPlacement>
          <PointPlacement>
            <AnchorPoint>
            <AnchorPointX>0.5</AnchorPointX>
            <AnchorPointY>0.5</AnchorPointY>
            </AnchorPoint>
          </PointPlacement>
        </LabelPlacement>
        </TextSymbolizer>
        </sld:Rule>
------------------------------------------------------------------------

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
  

Brent,

I tried adding the tag you suggested and this did not solve the problem. Does anyone else have any ideas?

Thanks,
Scott

From: Brent Owens

It probably involves fixing the code. Are you working with Ian Turton on this? You're at Penn State with him, yeah? He wrote a lot of the original SLD code - this may have just not made it in. I know there's another deficiency with SLD text stuff, we don't properly concat tags, we just use the first one in a label.

Chris

Scott Pezanowski wrote:

Brent,

I tried adding the tag you suggested and this did not solve the problem. Does anyone else have any ideas?

Thanks,
Scott

**

    From: Brent Owens
    To: Scott Pezanowski
    CC: geoserver-users@lists.sourceforge.net
    Subject: Re: [Geoserver-users] multiple textsymbolizers within the
    same rule
    Date: Wed, 30 Aug 2006 11:45:45 -0700

    I'm pretty sure you can have multiple text symbolizers in the same rule,
    and looking at the code it does appear to be true.
    But what might be happening is that the labeling will hide colliding
    labels, so you don't get a cluttered map. You can make sure your text
    symbolizer vendor option
    0
    is set to zero.
    But still, looking at the code, I think that only one is rendered.
    Can anyone else shed some more light on the LabelCache and
    StreamingRenderer?

    Brent Owens
    (The Open Planning Project)

    Scott Pezanowski wrote:
     > Hi,
     >
     > We are trying to display a symbol for points from a truetype font
     > through geoserver. The symbol is actually composed of three
    characters
     > from the font, laid on top of each other. To do this with geoserver,
     > we have tried creating three different rules for each character and
     > also three different textsymbolizers for the same rule (as seen
     > below). In both cases, the problem is that geoserver only
    displays the
     > last character listed in the sld. We thought that perhaps the last
     > character was blocking out the others but this does not seem to
    be the
     > case. First, is what I'm trying to do possible with sld? Second, can
     > anyone see what I am doing wrong?
     >
     > We could create an image of the symbol and use that; However, I
    do not
     > see that as the ideal solution.
     >
     > Thanks in advance for any help,
     > Scott
     >
     > L-PLNT-TXST-DECI
     >
     > layer
     > L-PLNT-TXST-DECI
     >
     > õ
     >
     > ESRI US MUTCD 3
     > 18
     >
     > #969696
     >
     > 0.5
     >
     > ô
     >
     > ESRI US MUTCD 3
     > 18
     >
     > #00A639
     >
     > 0.5
     >
     > ó
     >
     > ESRI US MUTCD 3
     > 18
     >
     > #9D4F21
     >
     > 0.5
     >
    ------------------------------------------------------------------------
     >
    -------------------------------------------------------------------------
     > Using Tomcat but need to do more? Need to support web services,
    security?
     > Get stuff done quickly with pre-integrated technology to make
    your job easier
     > Download IBM WebSphere Application Server v.1.0.1 based on Apache
    Geronimo
     >
    http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
     >
    ------------------------------------------------------------------------
     >
     > _______________________________________________
     > Geoserver-users mailing list
     > Geoserver-users@lists.sourceforge.net
     > https://lists.sourceforge.net/lists/listinfo/geoserver-users
     >

    -------------------------------------------------------------------------
    Using Tomcat but need to do more? Need to support web services,
    security?
    Get stuff done quickly with pre-integrated technology to make your
    job easier
    Download IBM WebSphere Application Server v.1.0.1 based on Apache
    Geronimo
    http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
    _______________________________________________
    Geoserver-users mailing list
    Geoserver-users@lists.sourceforge.net
    https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:1003,44f5df4e315294820651628!

------------------------------------------------------------------------

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

!DSPAM:1003,44f5df4e315294820651628!

------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:1003,44f5df4e315294820651628!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

On 8/30/06, Chris Holmes <cholmes@anonymised.com> wrote:

It probably involves fixing the code. Are you working with Ian Turton
on this? You're at Penn State with him, yeah? He wrote a lot of the
original SLD code - this may have just not made it in. I know there's
another deficiency with SLD text stuff, we don't properly concat tags,
we just use the first one in a label.

we do? what sort of tags do you mean?
AFAIR the text symboliser just told the renderer to draw the symbol.
So I suspect the problem is in the non-sld extensions to the text
rendering and label cache. But I would say that wouldn't I :slight_smile:

I'll try to work through the SLD text symbolizer stuff though.

Ian

Ian Turton wrote:

On 8/30/06, Chris Holmes <cholmes@anonymised.com> wrote:

It probably involves fixing the code. Are you working with Ian Turton
on this? You're at Penn State with him, yeah? He wrote a lot of the
original SLD code - this may have just not made it in. I know there's
another deficiency with SLD text stuff, we don't properly concat tags,
we just use the first one in a label.

we do? what sort of tags do you mean?

This example from the spec:

<Label>This is city"<ogc:PropertyName>NAME</ogc:PropertyName>"of state <ogc:PropertyName>STATE</ogc:PropertyName></Label>

I believe we just return the property NAME, we don't concat on the text and values. I'd love to have a fix for this, you can show off cooler labels.

Chris

AFAIR the text symboliser just told the renderer to draw the symbol.
So I suspect the problem is in the non-sld extensions to the text
rendering and label cache. But I would say that wouldn't I :slight_smile:

I'll try to work through the SLD text symbolizer stuff though.

Ian

!DSPAM:1003,44f73509128601336712104!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org