Different Labels using filter SLD

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Different Labels using filter SLD

Hahesa
This post has NOT been accepted by the mailing list yet.
Hello everyone
I have a question! I have a rule for different classes of roads, and I need labeling that classes with differents label rules. The routes under number 10 with a background shield , and routes above number 11 another shield.
I have this code:

<sld:TextSymbolizer>           
            <sld:Label>             
              <ogc:PropertyName>NumRuta</ogc:PropertyName> ## I need filter here?##              
            </sld:Label>
            <sld:Font>
              <sld:CssParameter name="font-family">News Gothic Bold</sld:CssParameter>
              <sld:CssParameter name="font-size">11</sld:CssParameter>
              <sld:CssParameter name="font-style">bold</sld:CssParameter>
              <sld:CssParameter name="font-weight">normal</sld:CssParameter>
            </sld:Font> 
            <sld:LabelPlacement>
              <sld:PointPlacement>
               <Rotation>0</Rotation> 
              </sld:PointPlacement>             
            </sld:LabelPlacement>
            <sld:Fill>
              <sld:CssParameter name="fill">#323232</sld:CssParameter>
            </sld:Fill>
                  <sld:Graphic>
                    <sld:ExternalGraphic> <sld:OnlineResource xlink:type="simple" xlink:href="background_security2.svg" /><Format>image/svg+xml</Format>                     
                  </sld:ExternalGraphic>
                    <sld:Size>20</sld:Size>
                  </sld:Graphic>
            <VendorOption name="followLine">false</VendorOption>
            <VendorOption name="graphic-resize">proportional</VendorOption>
            <VendorOption name="graphic-margin">3</VendorOption>
            <VendorOption name="repeat">100</VendorOption>
            <VendorOption name="labelAllGroup">true</VendorOption>
          </sld:TextSymbolizer>

How use the filter option with labels
Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Different Labels using filter SLD

gimse
This post has NOT been accepted by the mailing list yet.
Hi Hanesa,

Yes, you need filter:

<ogc:Filter>
         <ogc:PropertyIsEqualTo>
           <ogc:PropertyName>..</ogc:PropertyName>
           <ogc:Literal></ogc:Literal>
         </ogc:PropertyIsEqualTo>
       </ogc:Filter>

You can find some examples here:

http://docs.geoserver.org/stable/en/user/styling/sld/cookbook/lines.html#attribute-based-line
Reply | Threaded
Open this post in threaded view
|

Re: Different Labels using filter SLD

Hahesa
This post has NOT been accepted by the mailing list yet.
Thank you!
I try using  filter in the Label Tag but the geoserver send me this
Imágenes integradas 1
Thanks for your help!

2017-08-29 1:03 GMT-06:00 imse [via OSGeo.org] <[hidden email]>:
Hi Hanesa,

Yes, you need filter:

<ogc:Filter>
         <ogc:PropertyIsEqualTo>
           <ogc:PropertyName>..</ogc:PropertyName>
           <ogc:Literal></ogc:Literal>
         </ogc:PropertyIsEqualTo>
       </ogc:Filter>

You can find some examples here:

http://docs.geoserver.org/stable/en/user/styling/sld/cookbook/lines.html#attribute-based-line


If you reply to this email, your message will be added to the discussion below:
http://osgeo-org.1560.x6.nabble.com/Different-Labels-using-filter-SLD-tp5332816p5332859.html
To unsubscribe from Different Labels using filter SLD, click here.
NAML



--
Harold Herrera Sánchez
Teléfono: 2259-4242
Celular: 8831-3082