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?

  • You could go for one or more custom SLD that you send with the GetMap request to the service as SLD=, or SLD_BODY= – nmtoken Jun 10 '19 at 12:50

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">
  • That's really helpful - thanks! I wondered if there was something like that I could use in the server and SLD. I'll look into it. – ElenaFF Jun 12 '19 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.