[Geoserver-users] Labels drawn over graphic elements

Dear GeoServer users,

I have a layer which shows data from a meteorology station network in using very specific graphics symbol.

The symbol consists of a colored square to the left and a colored rectangle to the right of feature's anchor point, with a possibility of label drawn over the rectangle.

I'm using my custom PNG icons as <ExternalGraphic> and choose the right colors according to feature data as follows:

<Rule>
     <Name>stations</Name>
     <PointSymbolizer>
         <Graphic>
             <ExternalGraphic>
                 <OnlineResource xlink:type="simple" xlink:href="file://station_${TENDENCY}_${SPA}_${PREC}_${TEMP_DRY}_${TEMP_WATER}.png"/>
                 <Format>image/png</Format>
             </ExternalGraphic>
         </Graphic>
     </PointSymbolizer>
     <TextSymbolizer>
         <Label>
             <ogc:PropertyName>TEXT</ogc:PropertyName>
         </Label>
         <Font>
             <CssParameter name="font-family">Arial</CssParameter>
             <CssParameter name="font-size">14</CssParameter>
             <CssParameter name="font-style">normal</CssParameter>
             <CssParameter name="font-weight">bold</CssParameter>
         </Font>
         <LabelPlacement>
             <PointPlacement>
                 <AnchorPoint>
                     <AnchorPointX>0</AnchorPointX>
                     <AnchorPointY>0</AnchorPointY>
                 </AnchorPoint>
                 <Displacement>
                     <DisplacementX>-2</DisplacementX>
                     <DisplacementY>4</DisplacementY>
                 </Displacement>
             </PointPlacement>
         </LabelPlacement>
         <Fill>#FFFFFF</Fill>
     </TextSymbolizer>
</Rule>

The problem is that the icons might overlap and when they do the text is drawn always on top, regardless of relative z-index of the icon it belongs to. Here's an example: http://imgur.com/YxwieHW

It seems to me all graphics are rendered first and all labels are rendered after.

What can I do about it?

I tried using shapes from SLD styles but I need to use more than one shape for every feature. GeoServer renders multiple shapes centered around anchor point and there is no possibility to use Displacement for graphic (AFAIK it's possible only with text labels). That's why I use ExternalGraphic, I need to show all shapes side by side.

Many thanks

--
Peter Kovac
IMS Programmer
MicroStep-MIS
peter.kovac@anonymised.com

On Mon, Oct 12, 2015 at 6:45 PM, Peter Kovac <peter.kovac@anonymised.com>
wrote:

It seems to me all graphics are rendered first and all labels are
rendered after.

What can I do about it?

I tried using shapes from SLD styles but I need to use more than one
shape for every feature. GeoServer renders multiple shapes centered
around anchor point and there is no possibility to use Displacement for
graphic (AFAIK it's possible only with text labels). That's why I use
ExternalGraphic, I need to show all shapes side by side.

Displacement for graphics is supported in recent versions of GeoServer
(since 2.7
I believe).

About the ability to avoid drawing all labels at the end, it has been
discussed,
in normal situation it just breaks maps big time, as the WMS user can
compose
them in any order they want and labels need to stay on top to be legible,
but we understand there are cases in which this might not be desirable (for
example when labels are not really labels, but more parts of symbols).

For this we'd need to add and code support for a new "drawImmediately"
vendor
option. So far no one has provided either their own coding time to make it
a reality,
or funding to allow core developers to add this features during working
hours.
Maybe you could be the one? :wink:

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V 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

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

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

Dear Andrea,

thank you for clearing it up for me. As you’d might guess, my company is interested in the “drawImmediately” vendor option. So we either code it ourselves or we will fund core developers, depending on time/money costs. Do you remember if this feature was discussed among developers before? Who and where should I ask about GeoServer developers’ time and money estimates?

Regards,

Peter Kovac

···

On 12. 10. 2015 19:50, Andrea Aime wrote:

On Mon, Oct 12, 2015 at 6:45 PM, Peter Kovac <peter.kovac@anonymised.com> wrote:

It seems to me all graphics are rendered first and all labels are
rendered after.

What can I do about it?

I tried using shapes from SLD styles but I need to use more than one
shape for every feature. GeoServer renders multiple shapes centered
around anchor point and there is no possibility to use Displacement for
graphic (AFAIK it’s possible only with text labels). That’s why I use
ExternalGraphic, I need to show all shapes side by side.

Displacement for graphics is supported in recent versions of GeoServer (since 2.7
I believe).

About the ability to avoid drawing all labels at the end, it has been discussed,
in normal situation it just breaks maps big time, as the WMS user can compose
them in any order they want and labels need to stay on top to be legible,
but we understand there are cases in which this might not be desirable (for
example when labels are not really labels, but more parts of symbols).

For this we’d need to add and code support for a new “drawImmediately” vendor
option. So far no one has provided either their own coding time to make it a reality,
or funding to allow core developers to add this features during working hours.
Maybe you could be the one? :wink:

Cheers
Andrea

==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V 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

AVVERTENZE AI SENSI DEL D.Lgs. 196/2003

Le informazioni contenute in questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il loro utilizzo è consentito esclusivamente al destinatario del messaggio, per le finalità indicate nel messaggio stesso. Qualora riceviate questo messaggio senza esserne il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail e di procedere alla distruzione del messaggio stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od utilizzarlo per finalità diverse, costituisce comportamento contrario ai principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for the attention and use of the named addressee(s) and may be confidential or proprietary in nature or covered by the provisions of privacy act (Legislative Decree June, 30 2003, no.196 - Italy’s New Data Protection Code).Any use not in accord with its purpose, any disclosure, reproduction, copying, distribution, or either dissemination, either whole or partial, is strictly forbidden except previous formal approval of the named addressee(s). If you are not the intended recipient, please contact immediately the sender by telephone, fax or e-mail and delete the information in this message that has been received in error. The sender does not give any warranty or accept liability as the content, accuracy or completeness of sent messages and accepts no responsibility for changes made after they were sent or for other risks which arise as a result of e-mail transmission, viruses, etc.


-- 
Peter Kovac
IMS Programmer
MicroStep-MIS
[peter.kovac@anonymised.com](mailto:peter.kovac@anonymised.com)

On Wed, Oct 14, 2015 at 7:47 AM, Peter Kovac <peter.kovac@anonymised.com>
wrote:

Dear Andrea,

thank you for clearing it up for me. As you'd might guess, my company is
interested in the "drawImmediately" vendor option. So we either code it
ourselves or we will fund core developers, depending on time/money costs.
Do you remember if this feature was discussed among developers before?

Hum... nope, I don't remember a developer discussion ever happened on this
topic.

Who and where should I ask about GeoServer developers' time and money
estimates?

The list of commercial support providers is here:
http://geoserver.org/support/

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V 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

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

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