I had the same problem.
I imported a .sld file from geoserver to qgis and it seems some (or many) things are different.
The worst of all is the algorithm applied for rototranslation.
Apparently, the offset x, y and the rotation (or data defined rotation) fields, don't work together in a rototranslation function. Searching until something like the 10th page on google and merging every little piece in as many forums, I found out if you have to apply a rototranslation data-defined formula, you must set up some things manually. First of all, you have to set up the data-defined rotation field, remembering that, for some reasons, the angle is shifted by 90 degrees. Then you have to place the rotated label in a coordinate computed by theĀ  realĀ  rototranslation formula (rotation and translation combined). To do that, I find this formula to output the best results, in the Offset X, Y field:

concat (
-A * sin ((90 - "field") * pi () / 180) -B * cos ((90 - "field") * pi () / 180),
',',
A * cos ((90 - "field") * pi () / 180) -B * sin ((90 - "field") * pi () / 180)
)

where A and B are 2 constants for offset and "field" is your data-defined field

Sorry if something is unclear, this method is a quite unfriendly way to accomplish this need

Marco
_______________________________________________
Qgis-user mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to