Sort Items

ERDAS IMAGINE Help

HGD_Variant
16.6
HGD_Product
ERDAS IMAGINE
HGD_Portfolio_Suite
Producer

Category: Data Generation

Default

Show All Ports

  • Description

Takes a List or Table and creates a List or Table of values and a List of indices (0-based), which are sorted via the specified Order (Ascending/Descending).

For example:

Ascending order. Given DataIn [ 15,12,17,13 ], DataOut is [ 12,13,15,17 ] and Indices is [ 1,3,0,2 ]

Descending order. Given DataIn [ 15,12,17,13 ], DataOut is [ 17,15,13,12 ] and Indices is [ 2,0,3,1 ].

The output Indices are used in conjunction with the Arrange Items operator so that a set of values can be ordered in the same manner as another set of values. For example, consider two Tables, one consisting of Class Names and another consisting of the Histogram values associated with those Class Names. If the Class Names Table is sorted alphanumerically, the Table of Histogram values could be re-organized so that the Histogram values are still ordered correctly against their corresponding Class Names by using the Indices output by this operator as the RangeList input to the Arrange Items operator.

Sortable data types include:

List of (Type)

Ascending Sort Order

Bool

False comes before True

Int

Increasing numeric order

Unsigned

Increasing numeric order

Double

NaNs followed by increasing numeric order

String

Case-insensitive increasing alphanumeric order

Color

IHS: increasing hue (starting with red and increasing in a clockwise fashion), followed by increasing intensity, followed by increasing saturation.

Scalar

Color Scalar: see Color

String Scalar: see String

Non-floating-point numeric types: see Int

Floating-point numeric types: see Double

Complex types: not currently supported

DateTime

Old to new

File

See String

Directory

See String

  • Limitations

Some data types may not be sortable. If a data type is not supportable, this operator will fail. Refer to the table above.

  • Connections

Name

Objects Supported

Description

Shown by Default

Required

Default Behavior or Behavior if not Required

DataIn

List (of Data)

Table

The input List or Table that will be sorted.

ResampleMethod

Interpolation Type

Acceptable values are: "Ascending" and "Descending".

Ascending

DataOut

List (of Data)

Table

The output values of sorted data.

Indices

List (of Unsigned)

The output indexes of sorted data.

  • Related Operators

Arrange Items

  • Syntax

Sort ( <DataIn>[, Order=<Order>] )

  • Example Model

Below is an example of using the Sort Items operator to sort the Class Names of an Raster in ascending alphanumeric order and then using the Arrange Items operator to arrange the Histogram values for that Raster in the same order.