[mapserver-dev] WMS and vendor-specific sortBy parameter

Seth G sethg at geographika.co.uk
Wed Feb 19 11:01:26 PST 2020


Hi devs,

I'm wondering if anyone else sees a need for a sortBy parameter for a MapServer WMS request as a vendor-specific parameter similar to the WMS filter in RFC 118 [1]?

The use-case for me is as follows:

- a layer is used for both WMS and WFS. 
- WFS 2.0 allows user-defined sorting with the SORTBY parameter
- setting an ORDER BY in the LAYER DATA clause effectively overrides any user sorting
- without an ORDER BY any WMS requests can return a different image with each request, hence the requirement for a WMS sortBy parameter. Often data needs to be overlain in a specific order e.g. linear surveys by date. 

The only current alternatives I can think of are:

- duplicate layer details and use one for WMS with a hard-coded ORDER BY, and one for WFS without
- if a sortBy parameter is passed in to a layer (via WFS) then override any existing ORDER BY, and use the default if not 

I'm unsure how each of the various database drivers implement sorting logic. In MSSQL sortBy adds an additional ORDER BY clause to the SQL leading to a SQL syntax error (fix on its way). 
Any implementation details from other drivers appreciated. 

This was implemented in GeoServer - see mailing list post [3], check-in [4], and docs [5]
Does anyone know of any complications that could arise from implementing this?

Regards,

Seth

[1] https://mapserver.org/development/rfc/ms-rfc-118.html
[2] https://mapserver.org/ogc/wfs_server.html#support-for-sorting
[3] http://osgeo-org.1560.x6.nabble.com/New-vendor-parameter-for-WMS-WCS-sortBy-td5327210.html
[4] https://github.com/geoserver/geoserver/pull/2462/files
[5] https://docs.geoserver.org/stable/en/user/services/wms/vendor.html

--
web:http://geographika.co.uk
twitter: @geographika


More information about the mapserver-dev mailing list