Hahesa
August 29, 2017, 12:07am
1
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!
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Different-Labels-using-filter-SLD-tp5332816.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
geosim
August 29, 2017, 7:03am
2
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
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Different-Labels-using-filter-SLD-tp5332816p5332859.html
Sent from the GeoServer - User mailing list archive at Nabble.com.
Hi
2017-08-29 3:07 GMT+03:00 Hahesa <harold.herreras@anonymised.com>:
Hello everyone
I have a question! I have a rule for different classes of roads,
ogc:Filter usually goes straight into a Rule. If you have diferent
rules for different road classes, then you can add your label
symbolizers to the respective rules instead of creating a genereal
label-rule.
All the best,
Tõnis
--
@tkardi
skype: tonis.kardi
Hahesa
August 29, 2017, 3:22pm
4
Thank you!
I try using filter in the Label Tag but the geoserver send me this
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
Hi,
An ogc:Filter goes into the Rule tag (as is partly visible on your screenshot aswell), but you can try this as your label tag:
NumRuta
10
NumRuta
This get's rendered as a lable if NumRuta >= 10
docs for filter functions: http://docs.geoserver.org/stable/en/user/filter/function_reference.html
btw a superhandy SLD cheat-sheet ftp://download.osgeo.org/osgeo/foss4g/2009/SPREP/1Wed/Parkside%20GO3/1300/SLDReferenceSheet.pdf
All the best,
Tõnis
···
2017-08-29 18:22 GMT+03:00 Hahesa <harold.herreras@anonymised.com >:
Thank you!
I try using filter in the Label Tag but the geoserver send me this
Thanks for your help!
View this message in context: Re: Different Labels using filter SLD
Sent from the GeoServer - User mailing list archive at Nabble.com .
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:
Geoserver-users@anonymised.com.382…sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
–
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
@tkardi
skype: tonis.kardi
ohadm
December 11, 2017, 7:06am
6
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
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 <ohadm@anonymised.com > 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:
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
Geoserver-users@anonymised.com.382…sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
–
Ian Turton