[ 
http://jira.codehaus.org/browse/GEOT-1398?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jody Garnett reopened GEOT-1398:
--------------------------------


Bleck; api was not deprecated in 2.4.x, so this is still open (just as a QA 
problem).

> sort() method does not work on FeatureCollection
> ------------------------------------------------
>
>                 Key: GEOT-1398
>                 URL: http://jira.codehaus.org/browse/GEOT-1398
>             Project: GeoTools
>          Issue Type: Bug
>          Components: core filter, data
>    Affects Versions: 2.4-M4
>            Reporter: Gertjan van Oosten
>            Assignee: Jody Garnett
>            Priority: Minor
>             Fix For: 2.4.2
>
>
> If I try to sort a FeatureCollection, I get a null FeatureList.  So I do:
>   final FeatureCollection fc = source.getFeatures(filter);
> and this returns my feature collection (an instance of JDBCFeatureCollection 
> to be precise).  Good.  But:
>   final SortBy      rt = ff.sort(sortField, SortOrder.DESCENDING);
>   final FeatureList fl = fc.sort(sort);
> this returns a null FeatureList (ff is the FilterFactory).  Hmmm.  To figure 
> out why, I looked into these three classes (gt2-2.4-M4):
>   library/jdbc/src/main/java/org/geotools/data/jdbc/JDBCFeatureCollection.java
>   
> unsupported/h2/src/main/java/org/geotools/data/jdbc/collection/JDBCFeatureCollection.java
>   
> library/main/src/main/java/org/geotools/feature/DefaultFeatureCollection.java
> Apparently, sorting is not properly implemented (yet).
> As a work-around, sorting via the Query interface works:
>   final DefaultQuery   query = new DefaultQuery( typeName, filter);
>   final SortBy            rt = ff.sort(sortField, SortOrder.DESCENDING);
>   query.setSortBy(new SortBy[] { sort });
>   final FeatureCollection fc = source.getFeatures(query);

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to