Hi Andrea,
You’re right, this is what I was afraid of…
At this stage I think all one could do is adding one or more white spaces as prefix to the string of the Label, in order to simulate a positive DeltaX.
Nevertheless, such a workaround wouldn’t generate fixed values for the simulated DeltaX for strings (decimal numbers) with different lengths, font size changes, etc…
Many thanks,
Victor
···
From: andrea.aime@…84… [mailto:andrea.aime@…84…] On Behalf Of Andrea Aime
Sent: Tuesday, July 26, 2016 7:56 AM
To: Victor.Sinceac <Victor.Sinceac@…5188…>
Cc: geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Geoserver-users Digest, Vol 122, Issue 68
On Tue, Jul 26, 2016 at 8:41 AM, Victor.Sinceac <Victor.Sinceac@…5188…> wrote:
Did someone already find a solution to this?
Hi Victor,
I don’t believe it’s possible, it would require some development.
I assume one could just use the displacement element in the graphic, assuming
the natural position is label center, and allowing to move the graphic somewhere else
compared to it… but there is no code evaluating it now.
This would be a new feature request, see here on how to handle it:
Cheers
Andrea
From: Victor.Sinceac
Sent: Tuesday, July 26, 2016 6:41 AM
To: geoserver-users@lists.sourceforge.net
Subject: RE: Geoserver-users Digest, Vol 122, Issue 68
Hi Peter,
Nope, separating Graphic and Label elements in 2 different rules would of course handle well the relative displacement but wouldn’t manage the labels overlapping.
The labels overlapping is the main reason of using both Graphic and Label in the same rule: it ensures that each Label is drawn over a Marker, then also avoids the overlapping of different pairs Marker+Label.
My particular requirement is to have:
-
a pair Marker+Label for each point
-
pairs Marker+Label shall not overlap when zooming the map
-
the Marker is centered on the point geom (X,Y)
-
the Label is centered on the point geom (X+DELTAX,Y)
Something similar with the well-known case of roads shields (the road number in the middle of a road marker) but where the road number is not centered on the marker but it is written on the right side of the marker.
Did someone already find a solution to this?
Thanks,
Victor
Date: Mon, 25 Jul 2016 12:51:25 +0200
From: Peter Kovac <peter.kovac@…7677…>
Subject: Re: [Geoserver-users] SLD: Is it possible to get relative displacement between and in ?
Message-ID: <90e7c4a5-488f-462b-4fa8-6bab429c78fd@…7677…>
Content-Type: text/plain; charset=windows-1252; format=flowed
Hi Victor,
just split it into 2 rules: one for the graphic and one for the text label.
Then you can use different displacement in each of them.
Cheers,
Peter
On 25. 7. 2016 12:00, Victor.Sinceac wrote:
Hi All,
In a SLD rule, I need to use a with both and
elements (something similar to Highways Shields use case):
…
…
…
………
This works well when the requirement is to get the same position X,Y for
both Graphic and Label elements.
If I had well understood, the element in such a rule
would apply to both elements Label and Graphic.
Is it possible to define in such a rule a displacement which would only apply
to the element Label?
Thanks,
Victor