Different Labels using filter SLD

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 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
Reply | Threaded
Open this post in threaded view
|

Re: Different Labels using filter SLD

ohadm
Hi,

I have the same issue, is it possible to use filters under Label tag??



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:
- Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Different Labels using filter SLD

Ian Turton
No, as Tõnis says you need to use the filter in the rule not the label. 

Ian

On 11 December 2017 at 07:06, ohadm <[hidden email]> wrote:
Hi,

I have the same issue, is it possible to use filters under Label tag??



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:
- Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users



--
Ian Turton

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this list:
- Earning your support instead of buying it, but Ian Turton: http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users