Uploaded image for project: 'GeoTools'
  1. GEOT-5416

SortOrder.DESCENDING doesn't sort in descending order

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Highest
    • Resolution: Fixed
    • Affects Version/s: 15-RC1
    • Fix Version/s: 14.4, 15.1, 16-M0
    • Component/s: main
    • Labels:
      None

      Description

      If you set a SortBy.DESCENDING order on a Query the returned features are sorted in ASCENDING order.

      Adding this to gt-main/src/test/java/org/geotools/data/collection/SortedFeatureCollectionTest.java demonstrates the issue.

      public void testSortAttributeDescending() throws Exception {
              SortBy sort = ff.sort("someAtt", SortOrder.DESCENDING);
              SortedSimpleFeatureCollection sorted = new SortedSimpleFeatureCollection(delegate,
                      new SortBy[] { sort });
              checkSorted(sorted, DataUtilities.sortComparator(sort));
          }
      

        Attachments

          Activity

            People

            • Assignee:
              ianturton Ian Turton
              Reporter:
              ianturton Ian Turton
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: