Gertjan van Oosten ha scritto: > Hello again, > > 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 > > and I was a bit disappointed. Is sorting supposed to work or is it a > future enhancement?
FeatureCollection is one of those topics where geotools developers are not agreeing with each other, as such is not evenly covered usage wise (which also mean QA wise). I personally don't like them, and don't rely on them more than as a glorified FeatureReader. Geoserver uses feature sorting, so it works, but only if you specify it in the Query apparently? Can you open a Jira issue for this? Oh, btw, you are closing each iterator you get out of the collection using collection.close(iterator), right? :) Cheers Andrea ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Geotools-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
