Q:

Label Rotation in GeoServer SLD based on CRS

I'm styling a series of vector data in Polar Stereographic Projection (specifically EPSG 3031) using GeoServer and SLDs.  These maps can be rotated E/W, so if the labels are fixed they appear upside-down in places. (Example here: SCAR ADD (hold shift and drag to rotate)).
Is there a function that I could apply to the Rotation feature in SLDs to calculate the rotation of the labels based on the CRS rotation/meridian of the map?

A:

That rotation is being handled by the client so the server has no idea of the rotation angle.
For example - https://www.add.scar.org/ogc/60/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=add%3Aantarctic_facilities&STYLES=add%3Aantarctic_comnap_facilities_2018&CRS=EPSG%3A3031&SRS=EPSG%3A3031&TILED=true&WIDTH=256&HEIGHT=256&BBOX=-1057600%2C-699200%2C-699200%2C-340800
is a tile after I have applied rotation to the map. 
Your only hope it to modify the client to pass a rotation environment parameter into the server and use that in the label SLD:
<ogc:Function name="env">
   <ogc:Literal>rotation</ogc:Literal>
   <ogc:Literal>0</ogc:Literal>
</ogc:Function>

