textlabels

View: New views
5 Messages — Rating Filter:   Alert me  

textlabels

by Eija :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm trying to print textlabels. I get the points (lines or polygons) but not the text that goes with them. I've got the original SLD from an example which works, but after changing it to fit my data it fails. I've tried even getting the text from 'DETALJTYP' and I don't get any text then either.

<!-- Rule 1 -->
<Rule>
        <Name>Rule 1</Name>
        <Title>Höjdtext</Title>
        <Abstract>Text för höjdkurvor</Abstract>
        <ogc:Filter>
                <ogc:PropertyIsEqualTo>
                        <ogc:PropertyName>DETALJTYP</ogc:PropertyName>
                        <ogc:Literal>Hojdsiffra_10</ogc:Literal>
                </ogc:PropertyIsEqualTo>
        </ogc:Filter>
        <PointSymbolizer>
            <Graphic>
              <Mark>
                <WellKnownName>square</WellKnownName>
                <Fill>
                  <CssParameter name="fill">#FF0000</CssParameter>
                </Fill>
              </Mark>
              <Size>2</Size>
            </Graphic>
        </PointSymbolizer>
        <TextSymbolizer>
                <Label>
                        <ogc:PropertyName>TEXT</ogc:PropertyName>
                </Label>
               
                        <CssParameter name="font-family">Times New Roman</CssParameter>
                        <CssParameter name="font-style">Normal</CssParameter>
                        <CssParameter name="font-size">16</CssParameter>
                        <CssParameter name="font-weight">bold</CssParameter>
               

                <Fill>
                        <CssParameter name="fill">#FF0000</CssParameter>
                </Fill>
        </TextSymbolizer>
</Rule>

Eija

Re: textlabels

by Atle Frenvik Sveen-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 2009-11-04 at 05:03 -0800, Eija wrote:
> Hi,
>
> I'm trying to print textlabels. I get the points (lines or polygons) but not
> the text that goes with them. I've got the original SLD from an example
> which works, but after changing it to fit my data it fails. I've tried even
> getting the text from 'DETALJTYP' and I don't get any text then either.
>
I guess you have checked that you are using the correct case? The
filters are case-sensitive..

and (although i'm not sure it is required) you are missing the
<font>-tag

a working example from me is this:

        <Rule>
          <Name>Terrengpunkt</Name>
          <ogc:Filter>
            <ogc:PropertyIsEqualTo>
              <ogc:PropertyName>objtype</ogc:PropertyName>
              <ogc:Literal>Terrengpunkt</ogc:Literal>
            </ogc:PropertyIsEqualTo>
          </ogc:Filter>
          <MinScaleDenominator>1.0</MinScaleDenominator>
          <MaxScaleDenominator>50000.0</MaxScaleDenominator>
          <PointSymbolizer>
            <Graphic>
              <Mark>
                <WellKnownName>x</WellKnownName>
                <Fill>
                  <CssParameter name="fill">
                    <ogc:Literal>#895A44</ogc:Literal>
                  </CssParameter>
                  <CssParameter name="fill-opacity">
                    <ogc:Literal>1.0</ogc:Literal>
                  </CssParameter>
                </Fill>
              </Mark>
              <Opacity>
                <ogc:Literal>1.0</ogc:Literal>
              </Opacity>
              <Size>
                <ogc:Literal>5.0</ogc:Literal>
              </Size>
              <Rotation>
                <ogc:Literal>0.0</ogc:Literal>
              </Rotation>
            </Graphic>
          </PointSymbolizer>
          <TextSymbolizer>
            <Label>
              <ogc:PropertyName>hoyde</ogc:PropertyName>
            </Label>
            <Font>
              <CssParameter name="font-family">
                <ogc:Literal>Arial</ogc:Literal>
              </CssParameter>
              <CssParameter name="font-size">
                <ogc:Literal>10</ogc:Literal>
              </CssParameter>
              <CssParameter name="font-style">
                <ogc:Literal>Normal</ogc:Literal>
              </CssParameter>
              <CssParameter name="font-weight">
                <ogc:Literal>Normal</ogc:Literal>
              </CssParameter>
            </Font>
            <Fill>
              <CssParameter name="fill">#895A44</CssParameter>
            </Fill>
          </TextSymbolizer>
        </Rule>

> <!-- Rule 1 -->
> <Rule>
> <Name>Rule 1</Name>
> <Title>Höjdtext</Title>
> <Abstract>Text för höjdkurvor</Abstract>
> <ogc:Filter>
> <ogc:PropertyIsEqualTo>
> <ogc:PropertyName>DETALJTYP</ogc:PropertyName>
> <ogc:Literal>Hojdsiffra_10</ogc:Literal>
> </ogc:PropertyIsEqualTo>
> </ogc:Filter>
>         <PointSymbolizer>
>             <Graphic>
>               <Mark>
>                 <WellKnownName>square</WellKnownName>
>                 <Fill>
>                   <CssParameter name="fill">#FF0000</CssParameter>
>                 </Fill>
>               </Mark>
>               <Size>2</Size>
>             </Graphic>
>         </PointSymbolizer>
> <TextSymbolizer>
> <Label>
> <ogc:PropertyName>TEXT</ogc:PropertyName>
> </Label>
>
> <CssParameter name="font-family">Times New Roman</CssParameter>
> <CssParameter name="font-style">Normal</CssParameter>
> <CssParameter name="font-size">16</CssParameter>
> <CssParameter name="font-weight">bold</CssParameter>
>
> <Fill>
> <CssParameter name="fill">#FF0000</CssParameter>
> </Fill>
> </TextSymbolizer>
> </Rule>
>
> Eija
>
--
Atle Frenvik Sveen
Geomatikk IKT AS
tel: 45 27 86 89
mail. atle.frenvik.sveen@...

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geoserver-users mailing list
Geoserver-users@...
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Re: textlabels [SEC=Unclassified]

by Miles Jordan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Atle Frenvik Sveen wrote:
>(although i'm not sure it is required) you are missing the
> <font>-tag

Yep - it is required according to the SLD spec.

<TextSymbolizer>
        <Label>
                <ogc:PropertyName>TEXT</ogc:PropertyName>
        </Label>
        <Font>
                <CssParameter name="font-family">Times New Roman</CssParameter>
                <CssParameter name="font-style">Normal</CssParameter>
                <CssParameter name="font-size">16</CssParameter>
                <CssParameter name="font-weight">bold</CssParameter>
        </Font>
        <Fill>
                <CssParameter name="fill">#FF0000</CssParameter>
        </Fill>
</TextSymbolizer>

-Miles

___________________________________________________________________________

    Australian Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are not the
intended recipient, you are notified that use or dissemination of this communication is
strictly prohibited by Commonwealth law. If you have received this transmission in error,
please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and
DELETE the message.
        Visit our web site at http://www.antarctica.gov.au/
___________________________________________________________________________
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geoserver-users mailing list
Geoserver-users@...
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Re: textlabels

by Eija :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

the case is correct, as I told you I've tested with the same column which gives the point, and I still don't get the text.

I have the  tags in my SLD, they seem to have dropped out when I edited it for the mail.

I tested the example you sent me, changing the <ogc:PropertyName> in label to DETALJTYP, and still no go:(

Eija

Atle Frenvik Sveen-2 wrote:
On Wed, 2009-11-04 at 05:03 -0800, Eija wrote:
> Hi,
>
> I'm trying to print textlabels. I get the points (lines or polygons) but not
> the text that goes with them. I've got the original SLD from an example
> which works, but after changing it to fit my data it fails. I've tried even
> getting the text from 'DETALJTYP' and I don't get any text then either.
>
I guess you have checked that you are using the correct case? The
filters are case-sensitive..

and (although i'm not sure it is required) you are missing the
-tag

a working example from me is this:

        <Rule>
          <Name>Terrengpunkt</Name>
          <ogc:Filter>
            <ogc:PropertyIsEqualTo>
              <ogc:PropertyName>objtype</ogc:PropertyName>
              <ogc:Literal>Terrengpunkt</ogc:Literal>
            </ogc:PropertyIsEqualTo>
          </ogc:Filter>
          <MinScaleDenominator>1.0</MinScaleDenominator>
          <MaxScaleDenominator>50000.0</MaxScaleDenominator>
          <PointSymbolizer>
            <Graphic>
              <Mark>
                <WellKnownName>x</WellKnownName>
                <Fill>
                  <CssParameter name="fill">
                    <ogc:Literal>#895A44</ogc:Literal>
                  </CssParameter>
                  <CssParameter name="fill-opacity">
                    <ogc:Literal>1.0</ogc:Literal>
                  </CssParameter>
                </Fill>
              </Mark>
              <Opacity>
                <ogc:Literal>1.0</ogc:Literal>
              </Opacity>
              <Size>
                <ogc:Literal>5.0</ogc:Literal>
              </Size>
              <Rotation>
                <ogc:Literal>0.0</ogc:Literal>
              </Rotation>
            </Graphic>
          </PointSymbolizer>
          <TextSymbolizer>
            <Label>
              <ogc:PropertyName>hoyde</ogc:PropertyName>
            </Label>
           
              <CssParameter name="font-family">
                <ogc:Literal>Arial</ogc:Literal>
              </CssParameter>
              <CssParameter name="font-size">
                <ogc:Literal>10</ogc:Literal>
              </CssParameter>
              <CssParameter name="font-style">
                <ogc:Literal>Normal</ogc:Literal>
              </CssParameter>
              <CssParameter name="font-weight">
                <ogc:Literal>Normal</ogc:Literal>
              </CssParameter>
           

            <Fill>
              <CssParameter name="fill">#895A44</CssParameter>
            </Fill>
          </TextSymbolizer>
        </Rule>

> <!-- Rule 1 -->
> <Rule>
> <Name>Rule 1</Name>
> <Title>Höjdtext</Title>
> <Abstract>Text för höjdkurvor</Abstract>
> <ogc:Filter>
> <ogc:PropertyIsEqualTo>
> <ogc:PropertyName>DETALJTYP</ogc:PropertyName>
> <ogc:Literal>Hojdsiffra_10</ogc:Literal>
> </ogc:PropertyIsEqualTo>
> </ogc:Filter>
>         <PointSymbolizer>
>             <Graphic>
>               <Mark>
>                 <WellKnownName>square</WellKnownName>
>                 <Fill>
>                   <CssParameter name="fill">#FF0000</CssParameter>
>                 </Fill>
>               </Mark>
>               <Size>2</Size>
>             </Graphic>
>         </PointSymbolizer>
> <TextSymbolizer>
> <Label>
> <ogc:PropertyName>TEXT</ogc:PropertyName>
> </Label>
>
> <CssParameter name="font-family">Times New Roman</CssParameter>
> <CssParameter name="font-style">Normal</CssParameter>
> <CssParameter name="font-size">16</CssParameter>
> <CssParameter name="font-weight">bold</CssParameter>
>
> <Fill>
> <CssParameter name="fill">#FF0000</CssParameter>
> </Fill>
> </TextSymbolizer>
> </Rule>
>
> Eija
>
--
Atle Frenvik Sveen
Geomatikk IKT AS
tel: 45 27 86 89
mail. atle.frenvik.sveen@geomatikk.no

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Re: textlabels

by Andrea Aime-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Eija ha scritto:

> Hi,
>
> the case is correct, as I told you I've tested with the same column which
> gives the point, and I still don't get the text.
>
> I have the  tags in my SLD, they seem to have dropped out when I edited it
> for the mail.
>
> I tested the example you sent me, changing the <ogc:PropertyName> in label
> to DETALJTYP, and still no go:(

Can you provide a data sample and your full SLD?
It might be the quickest way to figure out what the problem is

Cheers
Andrea


--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Geoserver-users mailing list
Geoserver-users@...
https://lists.sourceforge.net/lists/listinfo/geoserver-users