Opened 2 years ago

Closed 2 years ago

#2612 closed enhancement (fixed)

WCPS - NEW - support sort() operator

Reported by: Bang Pham Huu Owned by: Bang Pham Huu
Priority: major Milestone: 10.1
Component: petascope Version: 10.0
Keywords: Cc:
Complexity: Medium

Description

petascope needs to support sort() operator in WCPS. The doc for sort() operator in rasql is at file:///home/rasdaman/rasdaman_community/rasdaman/doc/main/_build/html/04_ql-guide.html#sort-operator

  • The sort operator enables the user to sort an array along an axis of that array.
  • The sorting is done by:
    • Slicing the array along that axis
    • Calculating a slice rank for each of the slices
    • Then rearranging the slices according to their ranks, in an ascending or descending order.

Proposed syntax in WCPS (based on rasql syntax):

SORT generalExp ALONG sortAxis [listingOrder] BY cellExp

where:

  • generalExp is an MDD expression, for example: $c + 50
  • sortAxis is an axis belonging to the coverage in generalExp, for example: Lat orLong or ansi
  • listingOrder is ASC or DESC (default: ASC)
  • cellExp is the ranking function, for example: $c[Long(30)] or $c[Lat:"CRS:1"(0)] or min($c[ansi("2015-05-01":"2016-07-02")])

NOTE: The sortAxis and other unspecified axes are translated to a rasql cellExp implicitly.

  • For example: WCPS expression: SORT $c ALONG ansi BY min($c[Long(30:30)]) is translated to rasql expression: SORT c ALONG 0 AS i BY min_cells(c[i[0], 0:0, *:*]) (geo coordinate 30 of Long axis is translated to grid index 0).

Change History (1)

comment:1 by Bang Pham Huu, 2 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.