• Blog posts


    By David Crowther

    GeoServer – Reverse Drawing Order - 1.png


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


    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 –


    … 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>



Please sign in to leave a comment.