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 ingeneralExp
, for example:Lat
orLong
oransi
listingOrder
isASC
orDESC
(default:ASC
)cellExp
is the ranking function, for example:$c[Long(30)]
or$c[Lat:"CRS:1"(0)]
ormin($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
ALONGansi
BYmin($c[Long(30:30)])
is translated to rasql expression: SORTc
ALONG0
ASi
BYmin_cells(c[i[0], 0:0, *:*])
(geo coordinate30
ofLong
axis is translated to grid index0
).
Note:
See TracTickets
for help on using tickets.