[Geoserver-users] Using the "Priority" GeoServer option

Hi List,
I’m trying to use the “Priority” enhanced labelling option - http://docs.geoserver.org/latest/en/user/styling/sld-reference/labeling.html#priority-labeling

However, no matter where I place it, GeoServer fails the SLD validation (Andrea’s post to - http://osgeo-org.1560.x6.nabble.com/SLD-validation-fails-on-GS-2-1-1-td3791003.html suggests it should be just about Vendor Options).
This might just be because I’m using SLD 1.1

line 96: cvc-complex-type.2.4.a: Invalid content was found starting with element ‘se:Priority’. One of ‘{“http://www.opengis.net/se”:VendorOption}’ is expected.

However, when I view the WMS output, it returns a map that doesn’t appear to have taken the Priority into account; the feature with a priority of 10,000 is unlabelled but the surrounding 2,000 priorities are labelled just fine.

se:TextSymbolizer
se:Label

<ogc:Function name=“strToUpperCase”>
ogc:PropertyNameNAME</ogc:PropertyName>
</ogc:Function>
</se:Label>

se:Font
<se:SvgParameter name=“font-family”>Tahoma</se:SvgParameter>
<se:SvgParameter name=“font-size”>12</se:SvgParameter>
<se:SvgParameter name=“font-style”>normal</se:SvgParameter>
<se:SvgParameter name=“font-weight”>bold</se:SvgParameter>
</se:Font>

se:LabelPlacement
se:PointPlacement
se:AnchorPoint
se:AnchorPointX
<ogc:Function name=“if_then_else”>
<ogc:Function name=“in3”>
ogc:PropertyNameLOCATION</ogc:PropertyName>
ogc:Literal0</ogc:Literal>
ogc:Literal1</ogc:Literal>
ogc:Literal2</ogc:Literal>
</ogc:Function>
ogc:Literal0</ogc:Literal>
<ogc:Function name=“if_then_else”>
<ogc:Function name=“in3”>
ogc:PropertyNameLOCATION</ogc:PropertyName>
ogc:Literal3</ogc:Literal>
ogc:Literal4</ogc:Literal>
ogc:Literal5</ogc:Literal>
</ogc:Function>
ogc:Literal0.5</ogc:Literal>
ogc:Literal1</ogc:Literal>
</ogc:Function>
</ogc:Function>
</se:AnchorPointX>

se:AnchorPointY
<ogc:Function name=“if_then_else”>
<ogc:Function name=“in3”>
ogc:PropertyNameLOCATION</ogc:PropertyName>
ogc:Literal0</ogc:Literal>
ogc:Literal3</ogc:Literal>
ogc:Literal6</ogc:Literal>
</ogc:Function>
ogc:Literal0</ogc:Literal>
<ogc:Function name=“if_then_else”>
<ogc:Function name=“in3”>
ogc:PropertyNameLOCATION</ogc:PropertyName>
ogc:Literal1</ogc:Literal>
ogc:Literal4</ogc:Literal>
ogc:Literal7</ogc:Literal>
</ogc:Function>
ogc:Literal0.5</ogc:Literal>
ogc:Literal1</ogc:Literal>
</ogc:Function>
</ogc:Function>
</se:AnchorPointY>
</se:AnchorPoint>
</se:PointPlacement>
</se:LabelPlacement>

se:Halo
se:Radius2</se:Radius>
se:Fill<se:SvgParameter name=“fill”>#ffffff</se:SvgParameter></se:Fill>
</se:Halo>

se:Fill
<se:SvgParameter name=“fill”>#999999</se:SvgParameter>
</se:Fill>

se:Priority10000</se:Priority>

<se:VendorOption name=“spaceAround”>50</se:VendorOption>
<se:VendorOption name=“maxDisplacement”>50</se:VendorOption>

</se:TextSymbolizer>

Is there a good way to confirm that the priority function is working? Am I right in thinking the way it works is that the label should be shown in preference for other features when doing conflict resolution?
If I turn off the 2000 priority level features entirely, the 10,000 label shows fine, so GeoServer has no problem placing it.

Cheers,
Jonathan

This transmission is intended for the named addressee(s) only and may contain confidential, sensitive or personal information and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.

On Mon, Jul 14, 2014 at 3:33 PM, Jonathan Moules <
jonathanmoules@anonymised.com> wrote:

Hi List,
   I'm trying to use the "Priority" enhanced labelling option -
http://docs.geoserver.org/latest/en/user/styling/sld-reference/labeling.html#priority-labeling

However, no matter where I place it, GeoServer fails the SLD validation
(Andrea's post to -
http://osgeo-org.1560.x6.nabble.com/SLD-validation-fails-on-GS-2-1-1-td3791003.html
suggests it should be just about Vendor Options).
This might just be because I'm using SLD 1.1

line 96: cvc-complex-type.2.4.a: Invalid content was found starting with

element 'se:Priority'. One of '{"http://www.opengis.net/se&quot;:VendorOption\}'
is expected.

However, when I view the WMS output, it returns a map that doesn't appear
to have taken the Priority into account; the feature with a priority of
10,000 is unlabelled but the surrounding 2,000 priorities are labelled just
fine.

Priority is the only labelling vendor extension that we have that is not
using the Vendor tag (it's the oldest one) .
It may well be that the SLD 1.1 parser does not know about it, so it's
getting ignored during parsing.

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

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

Hi Andrea,
Ah ok, that explains that. Figured it was a minor thing on the Validator.

Unfortunately my issue of getting the Priority working remains; how is it meant to work?
This is what I get:
Inline images 1

But I want this Label to be taking priority (this is what it looks like when I don’t have the lesser labels showing at all).
Inline images 2

As I understand it, my SLD should produce that currently, but doesn’t seem to.

Am I missing something as to its use?

Cheers,
Jonathan

This transmission is intended for the named addressee(s) only and may contain confidential, sensitive or personal information and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.

···

On 14 July 2014 15:39, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Mon, Jul 14, 2014 at 3:33 PM, Jonathan Moules <jonathanmoules@anonymised.com> wrote:

Hi List,
I’m trying to use the “Priority” enhanced labelling option - http://docs.geoserver.org/latest/en/user/styling/sld-reference/labeling.html#priority-labeling

However, no matter where I place it, GeoServer fails the SLD validation (Andrea’s post to - http://osgeo-org.1560.x6.nabble.com/SLD-validation-fails-on-GS-2-1-1-td3791003.html suggests it should be just about Vendor Options).
This might just be because I’m using SLD 1.1

line 96: cvc-complex-type.2.4.a: Invalid content was found starting with element ‘se:Priority’. One of ‘{“http://www.opengis.net/se”:VendorOption}’ is expected.

However, when I view the WMS output, it returns a map that doesn’t appear to have taken the Priority into account; the feature with a priority of 10,000 is unlabelled but the surrounding 2,000 priorities are labelled just fine.

Priority is the only labelling vendor extension that we have that is not using the Vendor tag (it’s the oldest one) .

It may well be that the SLD 1.1 parser does not know about it, so it’s getting ignored during parsing.

Cheers
Andrea

==

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

==

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


On Mon, Jul 14, 2014 at 5:08 PM, Jonathan Moules <
jonathanmoules@anonymised.com> wrote:

Hi Andrea,
Ah ok, that explains that. Figured it was a minor thing on the Validator.

Unfortunately my issue of getting the Priority working remains; how is it
meant to work?
This is what I get:
!image.png|113x80

But I want this Label to be taking priority (this is what it looks like
when I don't have the lesser labels showing at all).
!image.png|163x136

As I understand it, my SLD should produce that currently, but doesn't seem
to.

Am I missing something as to its use?

As said, the SLD 1.1 parser might simply be ignoring it (e.g., do not
actually parse it)

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

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

Hi Andrea,
Ah ok. I misunderstood and gathered it was just the validator that was ignoring it (that’s normally been the case in my experience with these issues after all).

I’ve just tested it by downgrading to SLD 1.0.0 and it works fine now, so I’ll just use that then.

Opened http://jira.codehaus.org/browse/GEOS-6573 - as per the ticket it occurs to me this may be an opportunity to deprecate “” and convert it to a VendorParameter instead.

Cheers,
Jonathan

This transmission is intended for the named addressee(s) only and may contain confidential, sensitive or personal information and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.

image.png

image.png

···

On 14 July 2014 21:54, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Mon, Jul 14, 2014 at 5:08 PM, Jonathan Moules <jonathanmoules@anonymised.com> wrote:

Hi Andrea,
Ah ok, that explains that. Figured it was a minor thing on the Validator.

Unfortunately my issue of getting the Priority working remains; how is it meant to work?
This is what I get:
Inline images 1

But I want this Label to be taking priority (this is what it looks like when I don’t have the lesser labels showing at all).
Inline images 2

As I understand it, my SLD should produce that currently, but doesn’t seem to.

Am I missing something as to its use?

As said, the SLD 1.1 parser might simply be ignoring it (e.g., do not actually parse it)

Cheers

Andrea

==

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

==

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it