Bug report #6118

New Labeling, Rotation over Point is not enabled

Added by Gerhard Spieles over 12 years ago. Updated about 12 years ago.

Status:Closed
Priority:Normal
Assignee:Larry Shaffer
Category:Labelling
Affected QGIS version:1.8.0 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed
Crashes QGIS or corrupts data:No Copied to github as #:15457

Description

New Labeling, section advanced, Placement: "over point" let appear the label midth of the point.
Set y, y and rotation in the advanced section the over point function ist dissabled and the label begins right of the point.

The rotation over point point should be enabled.

Generaly, the rotation field in point layers should be available without the presence or setting of an x and y field in the "datadefined section".
When no field is present or the x and y field is empty, then the coordinate from point geometrie is the right value, in the other cases, the x and y values from the attribute fields.
This functionality was possible in the old labeling engine.

test1_label_offsetfrompoint.jpg (235 KB) Gerhard Spieles, 2012-09-04 03:08 PM

test2_label_offsetfrompoint_with_rotationfield.jpg (231 KB) Gerhard Spieles, 2012-09-04 03:08 PM

Associated revisions

Revision 61a50225
Added by Larry Shaffer about 12 years ago

Add quadrant, offset, rotation for points/centroids in adv labeling

- Possible fix for #4634, #5256, #6162
- Uses GEOS to convert centroids to points before PAL solution

- Implements #3492, #6285
- Convert PAL layer types 'over point/centroid' to 'offset from point/centroid'
- Add quadrant offsets (above/below/right, etc. like in old labeling)
- Add x and y offset, in mm or map unit, in addition to quadrant
- Default for offset is set to map units (mm scales oddly with zoom)

- Implements #4517, #6118; updates fix for #4317
- Rotation is independent of data defined columns
- Rotation bounding box included in offset calculation
- GUI spin box range set from -360 to +360 for initial dev testing

- Keep from scaling letter/word spacing if set to 0

History

#1 Updated by Paolo Cavallini about 12 years ago

  • Target version set to Version 2.0.0

#2 Updated by Larry Shaffer about 12 years ago

Should be implemented with commit 61a50225

Please test.

#3 Updated by Gerhard Spieles about 12 years ago

Hello,

have tested it with revision 9e9d1ce.
Offset from point functions. It is only possible to rotate all labels with the same rotation-angle. (see attached file "test1_label_offsetfrompoint.jpg"

When you want to get data-field defined rotation, you have to do this in the 'data defined settings' in the group 'position'. The field 'Rotation' is only available, when 'X' and 'Y' are as field defined (otherwise 'Rotation' ist grayed).
Setting X, Y and Rotation fields, dissables the 'Offset from point function'(see attached file "test2_label_offsetfrompoint_with_rotationfield.jpg"

It should be good to add a data defined 'Rotation' field in the 'Offset from point' group.

#4 Updated by Giovanni Manghi about 12 years ago

  • Status changed from Open to Feedback

#5 Updated by Larry Shaffer about 12 years ago

gespiel wrote (in separate posts):

It should be good to add a data defined 'Rotation' field in the 'Offset from point' group.

My apologies; commit 61a50225 only implements the rotation for the whole PAL (new labeling engine) layer, data defined rotation currently remains the same as with v. 1.8. I see now you were requesting two features.

I will be adding the ability to set the rotation independent of x/y for data defined layers as well, but that support will probably only extend to point features that have known or calculated locations prior to the PAL solution (e.g. Offset from point/centroid, as is the case here).

Offset from point functions. It is only possible to rotate all labels with the same rotation-angle.

All labels rotated the same is the intended behavior for the whole PAL layer with current 'Offset from point' functionality.

New Labeling, section advanced, Placement: "over point" let appear the label midth of the point.
Set y, y and rotation in the advanced section the over point function ist dissabled and the label >begins right of the point.

This is correct current behavior. The data defining of x/y (regardless of rotation) will currently override 'Offset from point' settings. Using 'Offset from point' for position, but overriding the rotation value with a data defined rotation field is not yet supported.

To get the label to be centered over the point when x/y are data defined, also map horizontal and vertical alignment fields in the data defined position section to your data source. Populate those mapped fields in your data source with Center for horizontal and Half for vertical.

See this description for v. 1.8: http://gis.stackexchange.com/questions/31478

This issue should remain open until data defined rotation, independent from data defined x/y, can also be used in conjunction with some PAL layer-level settings.

#6 Updated by Giovanni Manghi about 12 years ago

  • Assignee set to Larry Shaffer
  • Operating System deleted (all)

This issue should remain open until data defined rotation, independent from data defined x/y, can also be used in conjunction with some PAL layer-level settings.

This has been added 8a347ebaf7a960e4e4caf549b650865f4a3148ea

can this ticket be closed?

#7 Updated by Larry Shaffer about 12 years ago

  • Status changed from Feedback to Closed
  • Resolution set to fixed

Between the above noted commit and commit d83b618 this should now work as expected. New issues with existing functionality in master branch should probably be on a new ticket.

#8 Updated by Gerhard Spieles about 12 years ago

Hello,
perfect!
Thank you verry much.
Gerhard

Also available in: Atom PDF