[Geoserver-users] How to get SLD conflict resolution to display more point labels?

I am styling a map which displays points along roads. A label is displayed for each point. Unfortunately, when roads are near one another (such as in dual-carriageways) conflict resolution prevents some labels from displaying even though there is lots of available space nearby. (See attached image - ideally every point would be labelled).

In the case of labels along lines this kind of problem can be solved by using the SLD maxDisplacement vendor option. Is there any option or strategy which will allow point labels to be automatically displaced in the same way? (I’ve tried spaceAround, but that just results in ugly collisions).

If not, would it be possible to extend the maxDisplacement option to work with points as well? One issue might be that relocating a point label is pretty unconstrained (unlike lines). One way of dealing with this would be to allow point labels to be automatically displaced left or right and up or down from the point - this would allow 4 options to try for label position.

pt_labels.png

On Fri, Feb 8, 2013 at 9:22 PM, Martin Davis <mtnclimb@anonymised.com> wrote:

I am styling a map which displays points along roads. A label is displayed for each point. Unfortunately, when roads are near one another (such as in dual-carriageways) conflict resolution prevents some labels from displaying even though there is lots of available space nearby. (See attached image - ideally every point would be labelled).

In the case of labels along lines this kind of problem can be solved by using the SLD maxDisplacement vendor option. Is there any option or strategy which will allow point labels to be automatically displaced in the same way? (I’ve tried spaceAround, but that just results in ugly collisions).

If not, would it be possible to extend the maxDisplacement option to work with points as well? One issue might be that relocating a point label is pretty unconstrained (unlike lines). One way of dealing with this would be to allow point labels to be automatically displaced left or right and up or down from the point - this would allow 4 options to try for label position.

maxDisplacement already works for points (using concentric circles search pattern) and polygons as well (same as points).

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it 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


Oh, great. I’ll try it out, and update the docs accordingly.

On Fri, Feb 8, 2013 at 11:10 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Fri, Feb 8, 2013 at 9:22 PM, Martin Davis <mtnclimb@anonymised.com> wrote:

I am styling a map which displays points along roads. A label is displayed for each point. Unfortunately, when roads are near one another (such as in dual-carriageways) conflict resolution prevents some labels from displaying even though there is lots of available space nearby. (See attached image - ideally every point would be labelled).

In the case of labels along lines this kind of problem can be solved by using the SLD maxDisplacement vendor option. Is there any option or strategy which will allow point labels to be automatically displaced in the same way? (I’ve tried spaceAround, but that just results in ugly collisions).

If not, would it be possible to extend the maxDisplacement option to work with points as well? One issue might be that relocating a point label is pretty unconstrained (unlike lines). One way of dealing with this would be to allow point labels to be automatically displaced left or right and up or down from the point - this would allow 4 options to try for label position.

maxDisplacement already works for points (using concentric circles search pattern) and polygons as well (same as points).

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it 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