org.cts.op
Class UnitConversion

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

public class UnitConversion
extends AbstractCoordinateOperation

Convert coordinates from a source unit to a target unit.

Author:
Michaƫl Michaud

Field Summary
 
Fields inherited from class org.cts.op.AbstractCoordinateOperation
precision
 
Fields inherited from interface org.cts.Identifiable
DEFAULT, LOCAL, UNKNOWN
 
Method Summary
static UnitConversion createUnitConverter(Unit sourceUnit, Unit targetUnit)
          Creates a unit converter for homogeneous units (ex.
static UnitConversion createUnitConverter(Unit planiSourceUnit, Unit planiTargetUnit, Unit altiSourceUnit, Unit altiTargetUnit)
          Create a unit converter for coordinates using different units for planimetry and altimetry.
 CoordinateOperation inverse()
          Creates the inverse CoordinateOperation.
 double[] transform(double[] coord)
          Returns a coordinate representing the same point as coord but with different units.
 
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
 

Method Detail

transform

public double[] transform(double[] coord)
                   throws IllegalCoordinateException
Returns a coordinate representing the same point as coord but with different units.

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

createUnitConverter

public static UnitConversion createUnitConverter(Unit sourceUnit,
                                                 Unit targetUnit)
Creates a unit converter for homogeneous units (ex. XYZ or LAT-LON).

Parameters:
sourceUnit - unique source units used for 1-D, 2-D or 3-D source coordinates
targetUnit - unique target units expected in the resulting 1-D, 2-D or 3-D coordinates

createUnitConverter

public static UnitConversion createUnitConverter(Unit planiSourceUnit,
                                                 Unit planiTargetUnit,
                                                 Unit altiSourceUnit,
                                                 Unit altiTargetUnit)
Create a unit converter for coordinates using different units for planimetry and altimetry.

Parameters:
planiSourceUnit - source unit for latitude/longitude or northing/easting coordinates.
planiTargetUnit - target unit for latitude/longitude or northing/easting coordinates.
altiSourceUnit - source unit for height or altitude coordinate.
altiTargetUnit - target unit for height or altitude coordinate.


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