-
-
Notifications
You must be signed in to change notification settings - Fork 359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User defined order for LABEL POSITION AUTO #4242
Comments
Author: tbonfort |
Author: olt |
This is an automated commentThis issue has been closed due to lack of activity. This doesn't mean the issue is invalid, it simply got no attention within the last year. Please reopen with missing/relevant information if still valid. Typically, issues fall in this state for one of the following reasons:
|
Reporter: woodbri
Date: 2012/03/13 - 18:57
Trac URL: http://trac.osgeo.org/mapserver/ticket/4242
I mentioned in another thread the it would be nice to be able to control the order of the label attempts, maybe by listing them in order of preference. I found it very hard to get a layout of labels that I felt looked good. Using POSITION CC ended up being the best for the example of placing state abbreviations on the states. Using AUTO biases the labels to the left as we start labeling positions with UL
In most of the Automatic Label Positioning papers I have read they seem to express that the cartographically preferred order to be: CR, CL, UC, LC, UR, LR, UL, LL or in matrix form:
Where X is the label point. That said, I think the order should be
or UC, LC, CR, CL, UR, UL, LR, LL. And often I would use CC in the first position.
I bring this up because we probably need also to change the label positioning order dynamically (algorithmically) when there is a leader line and my assumption is that have some facility to do this would benefit both. The ideal order for positioning the label at the end of the leader would be to pick positions that are farthest from the object end of the leader. I think this will make for better looking labels and layout.
Above are few examples where o is the object end of the leader, X is the label end of the leader and the number are the positions to try in order.
The above forces the label to minimize intersection with its own leader and in general pushes the label away from an already crowded area.
'''tbonfort responded with:'''
For the time being this kind of adjustment isn't possible. The whole
shapeObj representing the label+markers is computed during the normal (i.e. not offsetted) phase of the labelcache rendering. If the label collides during this labelcache phase, then the offsetted position is determined by translating the computed shapeObj until it fits somewhere else. As such, it isn't possible to modify the label position once the offsetting phase has started, without having to recompute the shapeObj of the label+marker at each offsetted position.
I do agree that the final result would be better this way for certain use-cases (the use-case aimed-for for this initial implementation actually requires the label to remain fixed compared to its marker), and would apply when using label-level leader lines (instead of class-level ones, implemented now)
The text was updated successfully, but these errors were encountered: