ilog.views.maps.projection
Class IlvProjectionUtil

java.lang.Object
  extended by ilog.views.maps.projection.IlvProjectionUtil

public class IlvProjectionUtil
extends Object

This class implements utilities that can be used with the projection package.


Method Summary
static String DegreeToDMS(double degree, boolean lat)
          Converts a double representing degrees to a string.
static double DegreeToRadian(double degree)
          Converts to radians the value of an angle given in degrees.
static double DMSToDegree(String value)
          Converts a string specifying an angle in degrees, minutes, and seconds to degrees.
static double DMSToRadian(String value)
          Converts a string specifying an angle in degrees, minutes, and seconds to radians.
static IlvCoordinateSystem GetCoordinateSystemFromProjection(IlvProjection p)
          Returns an IlvCoordinateSystem that corresponds to the projection passed as argument.
static IlvLinearUnit GetLinearUnit(IlvCoordinateSystem cs)
          Returns the linear unit of the coordinate system passed as argument.
static IlvProjection GetProjectionFromCoordinateSystem(IlvCoordinateSystem cs)
          Returns an IlvProjection that corresponds to the coordinate system passed as argument.
static void invertY(IlvCoordinate xy)
          Inverts the y coordinate of a coordinate.
static void invertY(IlvPoint xy)
          Inverts the y coordinate of a point.
static double RadianToDegree(double radian)
          Converts to degrees the value of an angle given in radians.
static String RadianToDMS(double radian, boolean lat)
          Converts a double representing radians to a string.
static String RadianToDMS(IlvCoordinate coord)
          Converts a point represented by the IlvCoordinate parameter to degrees, minutes, and seconds represented by a string.
static String RadianToDMS(IlvPoint coord)
          Converts a point represented by the IlvPoint parameter to degrees, minutes, and seconds represented by a string.
static void ToViews(IlvCoordinate source, IlvPoint result, IlvProjection sourceProjection, IlvProjection targetProjection)
          Converts an IlvCoordinate object expressed in a Cartesian coordinate system into an IlvPoint object expressed in a manager coordinate system.
static void ToViews(IlvCoordinateTransformation transform, IlvCoordinate coordinate, IlvPoint holder)
          Transforms an IlvCoordinate object expressed in a Cartesian coordinate system into an IlvPoint object expressed in a manager coordinate system by using the coordinate transformation passed as argument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

DegreeToRadian

public static double DegreeToRadian(double degree)
Converts to radians the value of an angle given in degrees.

Parameters:
degree - The value to be converted.

RadianToDegree

public static double RadianToDegree(double radian)
Converts to degrees the value of an angle given in radians.

Parameters:
radian - The value to be converted.

DegreeToDMS

public static String DegreeToDMS(double degree,
                                 boolean lat)
Converts a double representing degrees to a string. The format is xxDxx'xx"L where L is one of the following: N, S, E, W.

Parameters:
degree - The value to be converted.
lat - true, if the angle is a latitude, and false if the angle is a longitude.

RadianToDMS

public static String RadianToDMS(double radian,
                                 boolean lat)
Converts a double representing radians to a string. The format is xxDxx'xx"L where L is one of the following: N, S, E, W.

Parameters:
radian - The value to be converted.
lat - true, if the angle is a latitude, and false if the angle is a longitude.

RadianToDMS

public static String RadianToDMS(IlvCoordinate coord)
Converts a point represented by the IlvCoordinate parameter to degrees, minutes, and seconds represented by a string. The function assumes that the data is expressed in radians.

Parameters:
coord - Contains the longitude in the x field and the latitude in the y field. Both values should be in radians.

RadianToDMS

public static String RadianToDMS(IlvPoint coord)
Converts a point represented by the IlvPoint parameter to degrees, minutes, and seconds represented by a string. The function assumes that the data is expressed in radians.

Parameters:
coord - Contains the longitude in the x field and the latitude in the y field. Both values should be in radians.

DMSToDegree

public static double DMSToDegree(String value)
                          throws IlvBadProjectionParameter
Converts a string specifying an angle in degrees, minutes, and seconds to degrees. The usual format of the string is [+/-]xxDxx'xx" (for example, 25D33'25"N).

Parameters:
value - The string defining the angle in degrees.
Throws:
IlvBadProjectionParameter - If a string format error occurs.

DMSToRadian

public static double DMSToRadian(String value)
                          throws IlvBadProjectionParameter
Converts a string specifying an angle in degrees, minutes, and seconds to radians. The usual format of the string is [+/-]xxDxx'xx" (for example, 25D33'25"N).

Parameters:
value - The string defining the angle in degrees.
Returns:
The angle value in radian, or 0 if value is null or the empty string.
Throws:
IlvBadProjectionParameter - If a string format error occurs.

invertY

public static void invertY(IlvPoint xy)
Inverts the y coordinate of a point.

Parameters:
xy - The point to convert.

invertY

public static void invertY(IlvCoordinate xy)
Inverts the y coordinate of a coordinate.

Parameters:
xy - The point to convert.

ToViews

public static void ToViews(IlvCoordinate source,
                           IlvPoint result,
                           IlvProjection sourceProjection,
                           IlvProjection targetProjection)
                    throws IlvProjectionException
Converts an IlvCoordinate object expressed in a Cartesian coordinate system into an IlvPoint object expressed in a manager coordinate system. If the source and target projection parameters are passed with non-null, the method reprojects the point in the target projection.

Parameters:
source - The coordinate to convert.
result - The result of the conversion.
sourceProjection - An optional parameter specifying the source projection.
targetProjection - An optional parameter specifying the target projection.
Throws:
If - an error occurs while projecting data.
IlvProjectionException
Since:
JViews 3.0

GetLinearUnit

public static final IlvLinearUnit GetLinearUnit(IlvCoordinateSystem cs)
Returns the linear unit of the coordinate system passed as argument.

Since:
JViews 5.0

ToViews

public static final void ToViews(IlvCoordinateTransformation transform,
                                 IlvCoordinate coordinate,
                                 IlvPoint holder)
                          throws IlvCoordinateTransformationException
Transforms an IlvCoordinate object expressed in a Cartesian coordinate system into an IlvPoint object expressed in a manager coordinate system by using the coordinate transformation passed as argument.

Parameters:
transform - The coordinate transformation.
coordinate - The IlvCoordinate to be transformed.
holder - The transformed IlvPoint.
Throws:
If - an error occurs while transforming data.
IlvCoordinateTransformationException
Since:
JViews 5.0

GetProjectionFromCoordinateSystem

public static final IlvProjection GetProjectionFromCoordinateSystem(IlvCoordinateSystem cs)
Returns an IlvProjection that corresponds to the coordinate system passed as argument.

Since:
JViews 5.0

GetCoordinateSystemFromProjection

public static final IlvCoordinateSystem GetCoordinateSystemFromProjection(IlvProjection p)
Returns an IlvCoordinateSystem that corresponds to the projection passed as argument.

Since:
JViews 5.0


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.