You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SLD: se:Rotation is applied counterclockwise #7662
A triangle mark with <se:Rotation>90</se:Rotation> is drawn pointing left. SE 1.1.0 defines Rotation as clockwise, so it should point right..
The SLD reader copies the value into the style ANGLE, which is counterclockwise, while the SLD writer converts it since #7591 (360 - angle).
@maxcollombin to be clear, you are highlighting an existing bug in the SLD reader, which has likely always been there? #7591 should have fixed the same bug in the SLD writer - or is there an issue with the changes in this PR?
Yes, it's the reader, and it's old: 6.4 already does psStyle->angle = atof(...) with no conversion, and main still does (msSLDParseOgcExpression, MS_STYLE_BINDING_ANGLE). SE 1.1.0 §11.3.2 defines Rotation as clockwise, while STYLE ANGLE is counterclockwise.
#7591 looks right to me, 360 - angle is what the writer needs. Only its comment has the directions swapped.
Since #7591 the writer converts but the reader doesn't, so an SLD from GetStyles read back into MapServer now turns the other way. The reader probably needs the same 360 - value, including when Rotation is an ogc:PropertyName (currently bound as [attr] as is).
Labels have the same mismatch on both sides: PointPlacement/Rotation is clockwise in SE (§11.4.2) but LABEL ANGLE is counterclockwise, and neither the reader (MS_LABEL_BINDING_ANGLE) nor the writer converts it. The writer also skips negative angles (angle > 0).
I'd like to take this one, unless you're already working on it @maxcollombin. My plan is to apply the same 360 - value conversion in the SLD reader for se:Rotation on point symbols and labels in mapogcsld.cpp, so it matches the writer since #7591, and to sort out the ogc:PropertyName case, where a plain subtraction on the parsed value doesn't work. I'll update the msautotest expected output along with it.
The Rotation element gives the rotation of a graphic in the clockwise direction about its
center point in decimal degrees, encoded as a floating-point number. Negative values
mean counter-clockwise rotation. The default value is 0.0 (no rotation). Note that there is
no connection between source geometry types and rotations; the point used for plotting
has no inherent direction. Also, the point within the graphic about which it is rotated is
format dependent. If a format does not include an inherent rotation point, then the point
of rotation should be the centroid.
Activity
geographika commentedon Oct 7, 2026
@maxcollombin to be clear, you are highlighting an existing bug in the SLD reader, which has likely always been there?
#7591 should have fixed the same bug in the SLD writer - or is there an issue with the changes in this PR?
maxcollombin commentedon Oct 8, 2026
Yes, it's the reader, and it's old: 6.4 already does
psStyle->angle = atof(...)with no conversion, and main still does (msSLDParseOgcExpression,MS_STYLE_BINDING_ANGLE). SE 1.1.0 §11.3.2 defines Rotation as clockwise, while STYLE ANGLE is counterclockwise.#7591 looks right to me,
360 - angleis what the writer needs. Only its comment has the directions swapped.Since #7591 the writer converts but the reader doesn't, so an SLD from GetStyles read back into MapServer now turns the other way. The reader probably needs the same
360 - value, including when Rotation is anogc:PropertyName(currently bound as[attr]as is).Labels have the same mismatch on both sides:
PointPlacement/Rotationis clockwise in SE (§11.4.2) but LABEL ANGLE is counterclockwise, and neither the reader (MS_LABEL_BINDING_ANGLE) nor the writer converts it. The writer also skips negative angles (angle > 0).akshat-lakhera commentedon Oct 25, 2026
I'd like to take this one, unless you're already working on it @maxcollombin. My plan is to apply the same 360 - value conversion in the SLD reader for se:Rotation on point symbols and labels in mapogcsld.cpp, so it matches the writer since #7591, and to sort out the ogc:PropertyName case, where a plain subtraction on the parsed value doesn't work. I'll update the msautotest expected output along with it.
cc @geographika @jmckenna
jratike80 commentedon Oct 25, 2026
I have nothing to add really, just telling that "SE 1.1.0" means "Symbology Encoding Implementation Specification", OGC 05-077r4 https://docs.ogc.org/is/05-077r4/05-077r4.pdf and this is what it says about "rotation":