<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Would a SORTBY clause be added as a
keyword in the DATA statement? <br>
E.g. DATA "ogr_geometry from rivers USING UNIQUE ogr_fid USING
SRID=4326 USING SORTBY my_sort_fieldname"<br>
<br>
On 07/11/2014 12:49, Tamas Szekeres wrote:<br>
</div>
<blockquote
cite="mid:CACALY+Sda4c9dfjoBPnXYBWYXUNV7q6N4+X0FUT=3BVL5p2VAA@mail.gmail.com"
type="cite">
<div dir="ltr">We could also extend the DATA section with a SORTBY
clause for the mssql driver.
<div>Adding this feature to MSSQL (as per RFC 105) would anyway
be fairly easy.</div>
<div><br>
</div>
<div>Tamas</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2014-11-07 11:24 GMT+01:00 geographika
<span dir="ltr"><<a moz-do-not-send="true"
href="mailto:geographika@gmail.com" target="_blank">geographika@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> Hi list,<br>
<br>
I have come across an issue that is critical to the
project I am working on and wondered if it applies to all
database drivers or just the SQL Server 2008 one. <br>
<br>
I have logged the issue on GitHub at: <a
moz-do-not-send="true"
href="https://github.com/mapserver/mapserver/issues/5008"
target="_blank">https://github.com/mapserver/mapserver/issues/5008</a><br>
<br>
I will try some tests over the weekend to see if the
Postgres driver works the same way, but there seems to be
no way of guaranteeing feature display order - even if all
documentation suggests it can be achieved in a database
layer using "ORDER BY"<br>
Whilst for a low number of records the order seems
ordered, with 150+ features I get different images
returned each time by my WMS service. No use of clustered
indexes, partition statements etc. can get around this as
SQL result sets can only be guaranteed with an ORDER BY in
the outermost statement. <br>
<br>
I note that in <a moz-do-not-send="true"
href="http://mapserver.org/fr/development/rfc/ms-rfc-105.html"
target="_blank">http://mapserver.org/fr/development/rfc/ms-rfc-105.html</a>
there is a new function msLayerBuildSQLOrderBy() that
allows sorting to be done outside of the layer's DATA
statement for WFS requests with a SORTBY parameter. Maybe
this could also be used by a new LAYER "SORT" config
keyword?<br>
<br>
I see the above is only implemented for a few drivers. The
client would be willing to fund adding this to the SQL
Server driver if there are any core devs interested in
doing this. <br>
<br>
Regards,<br>
<br>
Seth<br>
<br>
<div lang="x-western"> <font color="#888888">--<br>
web:</font><a moz-do-not-send="true"
href="http://geographika.co.uk" target="_blank"><font
color="#888888"> </font>http://geographika.co.uk</a><br>
<font color="#888888">twitter: @geographika<br>
</font><br>
</div>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>