Not sure about which way would be best. Seems that they would both be
useful ,but you knew I would say that. 
As for Freemarker, there are a range of possibly useful functions
described here...
http://freemarker.sourceforge.net/docs/ref_builtins_sequence.html
There also seem to be some rather serious caveats as well. "This will
work only if all subvariables are strings, or if all subvariables are
numbers, or, since FreeMarker 2.3.1, if all subvariables are date
values (date, time, or date+time). If the subvariables are strings, it
uses locale (language) specific lexical sorting (which is usually not
case sensitive)." Seems pretty limiting if I read that text correctly.
The sort_by directive seems to offer better possibilities.
I think that adding a vendor option would allow possibly more data
types but would it really be used that often? Would you ever want to
sort by geometry for instance? does not seem so, but who knows but
perhaps. It feels like it would require more work however, since
Freemarker has already done this, at least for strings and some other
types. A vendor option would also not require people using Geoserver
to mess around with Freemarker templates if they are not so inclined.
For my requirements, I just need to sort by a text field or integer field.
Best regards,
Jason
On Tue, Apr 29, 2008 at 7:47 PM, Andrea Aime <aaime@anonymised.com> wrote:
Jason Pickering ha scritto:
> Hi Justin and Andrea,
>
> Well, it is easy to cap the number of features that are returned from
> the GetFeatureInfo request. Perhaps it could be implemented, with the
> caveat that not too many features could be sorted, which I guess would
> depend heavily on the information contained in the response.
>
GetFeatureInfo has a parameter, FEATURE_COUNT, that limits the number
of returned features. By default it's 1, in our preview we expand
it to 50 just to grab some more features. So the user is in control here,
and it's pretty safe to assume nobody is going to ask for one
million of them.
So sorting in memory would actually work.
I'm just wondering how:
* turning the feature collection into a plain java collection and
have freemarker do its own sorting
* add a vendor parameter that states the params you want to use
for sorting
The latter would allow other output formats to be game for sorting as well.
Preferences?
Cheers
Andrea