org.cts.op
Class CoordinateSwitch

java.lang.Object
  extended by org.cts.IdentifiableComponent
      extended by org.cts.op.AbstractCoordinateOperation
          extended by org.cts.op.CoordinateSwitch
All Implemented Interfaces:
Identifiable, CoordinateOperation

public class CoordinateSwitch
extends AbstractCoordinateOperation

A class to switch to values in a double array.

Author:
Michaƫl Michaud

Field Summary
static CoordinateSwitch SWITCH_LAT_LON
          Switch the two first value of a coordinate.
 
Fields inherited from class org.cts.op.AbstractCoordinateOperation
precision
 
Fields inherited from interface org.cts.Identifiable
DEFAULT, LOCAL, UNKNOWN
 
Constructor Summary
CoordinateSwitch(int pos1, int pos2)
          Creates a new operation to switch coord pos1 and coord pos2.
 
Method Summary
 CoordinateOperation inverse()
          Creates the inverse CoordinateOperation.
 double[] transform(double[] coord)
          Change ordinate at pos1 with ordinate at pos2.
 
Methods inherited from class org.cts.op.AbstractCoordinateOperation
getPrecision
 
Methods inherited from class org.cts.IdentifiableComponent
addAlias, addRemark, equals, getAliases, getAuthorityKey, getAuthorityName, getCode, getComponent, getIdentifier, getName, getRemarks, getShortName, hashCode, setIdentifier, setRemarks, setShortName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.cts.Identifiable
addAlias, addRemark, getAliases, getAuthorityKey, getAuthorityName, getCode, getName, getRemarks, getShortName, setRemarks, setShortName
 

Field Detail

SWITCH_LAT_LON

public static final CoordinateSwitch SWITCH_LAT_LON
Switch the two first value of a coordinate. For instance longitude and latitude in the case of geographic coordinates.

Constructor Detail

CoordinateSwitch

public CoordinateSwitch(int pos1,
                        int pos2)
Creates a new operation to switch coord pos1 and coord pos2.

Parameters:
pos1 - position of the ordinate to switch to pos2
pos2 - position of the ordinate to switch to pos1
Method Detail

transform

public double[] transform(double[] coord)
                   throws IllegalCoordinateException
Change ordinate at pos1 with ordinate at pos2.

Specified by:
transform in interface CoordinateOperation
Specified by:
transform in class AbstractCoordinateOperation
Parameters:
coord - is an array containing one, two or three ordinates
Returns:
a double array containing the output coordinate
Throws:
IllegalCoordinateException - if coord is not compatible with this CoordinateOperation.

inverse

public CoordinateOperation inverse()
                            throws NonInvertibleOperationException
Creates the inverse CoordinateOperation.

Specified by:
inverse in interface CoordinateOperation
Overrides:
inverse in class AbstractCoordinateOperation
Throws:
NonInvertibleOperationException


Copyright © 2014 IRSTV CNRS-FR-2488. All Rights Reserved.