GeoServer – Reverse Drawing Order

Marketing
Marketing
  • Updated

By David Crowther

GeoServer – Reverse Drawing Order - 1.png

Question:

How can you reverse the drawing order of features in a WMS Layer?

Answer:

In this previous FAQ we explore how you can change the drawing order of your map features using a sequential value in a field in the source data –

https://www.cadlinecommunity.co.uk/hc/en-us/articles/6454191288221-QGIS-How-to-Control-the-Drawing-Order-of-Map-Features

… enabling hidden map features to be drawn last and therefore now show in the map.

GeoServer – Reverse Drawing Order - 2.png

The line item to include in your SLD to re-sort the drawing order using the sequential values in a field e.g. using the qgs_fid value is shown below –

<VendorOption name="sortBy">qgs_fid</VendorOption>

If, however, you wish to reverse the drawing order of the features using the same field, you simply need to add the sort syntax to the line. For ascending add ‘A’ and to sort in descending order add ‘D’ -

<VendorOption name="sortBy">qgs_fid D</VendorOption>

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.