
@Draft @UML(identifier="GM_Permutation", specification=ISO_19107) public interface Permutation
Represents the rearrangement of a list, or a projection. The main usage of this interface is to determine the differences in the order in which aCoordinateSystem
axes are defined and the order in which they are used in aDirectPosition
.Note: This is helpful, because forcing the coordinate reference system to be in theCoordinateSystem
as the first coordinate offsets will often force the system to be left handed. Using a oddpermutation on the spatial offsets will flip this to a right handed system, and allow graphicsbased or engineeringbased software to deal with coordinate as stored in theDirectPosition
without the worry of mirror images, which is the result of getting the handedness of a coordinate system wrong. The usual permutation with simply flip the first and second offset. Since:
 3.1


Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int[]
getNewOrder()
describes the new ordering of offsets in terms of offset indexes of the original ordering.boolean
isEven()
Determines whether the permutation is representable as an even or odd number of transposition (2 element swaps).



Method Detail

getNewOrder
@Draft @UML(identifier="newOrder", obligation=MANDATORY, specification=ISO_19107) int[] getNewOrder()
describes the new ordering of offsets in terms of offset indexes of the original ordering. The offsets shall be represented as a 0up index; so a ndimension array in original order would be (0, 1, 2, … , n1); the index will always ranges up to one less than the cardinality of the array. If the array length is less than the dimension of the coordinate, then all offsets beyond the length of the array will be unmoved by the permutation.Note: Because of its definition, thenewOrder
array will normally be a rearrangement of the integer between 0 and n1 where n is the dimension of theCoordinateSystem
in which the permutation appears. Since the most common issue is that the use of “latlong” is left handed, the most common new order will be (1, 0) which simply flips the order of the latitude and longitude offsets of a geographic coordinate system. Returns:
 Returns a new order or the same order as in
DirectPosition
.

isEven
@Draft @UML(identifier="isEven", obligation=MANDATORY, specification=ISO_19107) boolean isEven()
Determines whether the permutation is representable as an even or odd number of transposition (2 element swaps). Even permutation preserve handedness and odd ones do not.Note: Under usual circumstances, the only reason to use a permutation is to change a spatial coordinate reference system from left handed to right handedness. Anull
permutation is even, and the usual (1, 0) swap is odd (1 transposition). Returns:
true
if permutation is even, orfalse
if odd.

