public abstract class IlvProjection extends Object implements Serializable, IlvPersistentObject
IlvProjection
is now ignored.
Datum conversions are now done when converting from one coordinate system
from another.IlvProjectedCoordinateSystem
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
CONFORMAL
Used to designate a projection that is Conformal.
|
static int |
EQUAL_AREA
Used to designate a projection that is Equal Area.
|
static int |
NONE
Used to designate a projection that is neither Conformal nor
Equal Area.
|
Modifier | Constructor and Description |
---|---|
protected |
IlvProjection(boolean ellipsoidEnabled,
boolean inverseEnabled,
int property)
Creates a new instance of the class
IlvProjection . |
protected |
IlvProjection(IlvInputStream stream)
Reads the object from an
IlvInputStream . |
protected |
IlvProjection(IlvProjection source)
Creates a new
IlvProjection by copying an existing one. |
Modifier and Type | Method and Description |
---|---|
protected void |
addDescription(StringBuffer buffer)
Converts the projection into a String (Evenden's format).
|
protected double |
adjustLongitude(double lon)
Reduces the longitude to
-PI PI . |
abstract IlvProjection |
copy()
Copies the object.
|
protected void |
eForward(IlvCoordinate ll)
Implements the projection for an ellipsoid.
|
protected void |
eInverse(IlvCoordinate xy)
Implements the inverse projection for an ellipsoid.
|
boolean |
equals(Object obj)
Compares the string representation of projections using the toString methods.
|
void |
forward(IlvCoordinate ll)
Converts the parameter
IlvCoordinate representing a latitude and a
longitude to Cartesian coordinates (x,y). |
void |
forward(IlvPoint ll)
Converts the parameter
IlvPoint representing a latitude and a
longitude to Cartesian coordinates (x,y). |
double |
getCentralMeridian()
Returns the central meridian of the projection.
|
double |
getCentralParallel()
Returns the central parallel of the projection.
|
IlvHorizontalDatum |
getDatum()
Deprecated.
Since JViews 5.0, the datum is managed at the coordinate
system level.
|
IlvEllipsoid |
getEllipsoid()
Returns the ellipsoid used for the projection.
|
double |
getFalseEasting()
Returns the false easting of the projection.
|
double |
getFalseNorthing()
Returns the false northing of the projection.
|
static IlvProjection |
GetProjection(String description)
Returns a projection from a string in Evenden's format.
|
int |
getProperty()
Returns the property of the projection.
|
IlvLinearUnit |
getUnit()
Returns the unit used to measure lengths in this projection.
|
IlvCoordinate |
getXYOffset()
Returns the false easting and the false northing.
|
void |
inverse(IlvCoordinate xy)
Converts the parameter
IlvCoordinate representing Cartesian
coordinates to a latitude and a longitude. |
void |
inverse(IlvPoint xy)
Converts the
IlvPoint representing Cartesian
coordinates to a latitude and a longitude. |
IlvPoint |
inverse(MouseEvent e)
Converts the coordinates of the
MouseEvent to a latitude and a
longitude expressed in radians. |
boolean |
isEllipsoidEnabled()
Returns
true if non-spherical ellipsoids can be used for the projection. |
boolean |
isGeocentric()
Returns
true if the projection uses geocentric latitudes. |
boolean |
isInverseEnabled()
Returns
true if the inverse function is supported by the projection. |
boolean |
isUsingLongitudeReduction()
Returns
true if the projection uses range reduction for longitudes. |
void |
setCentralMeridian(double lon)
Sets the central meridian of the projection.
|
void |
setCentralParallel(double lat)
Sets the central parallel of the projection.
|
void |
setDatum(IlvHorizontalDatum datum)
Deprecated.
Since JViews 5.0, the datum is managed at the coordinate
system level.
|
void |
setEllipsoid(IlvEllipsoid ellipsoid)
Sets the ellipsoid used for the projection.
|
void |
setFalseEasting(double falseEasting)
Specifies the false easting of the projection.
|
void |
setFalseNorthing(double falseNorthing)
Specifies the false northing of the projection.
|
void |
setGeocentric(boolean geoc)
Specifies whether the projection uses geocentric or geodetic latitudes.
|
void |
setLLCenter(double lon,
double lat)
Specifies the central meridian and the central parallel
associated with the projection.
|
void |
setUnit(IlvLinearUnit unit)
Sets the unit of the projection.
|
void |
setUsingLongitudeReduction(boolean use)
Specifies whether the projection uses longitude reduction.
|
void |
setXYOffset(IlvCoordinate center)
Specifies the false easting and the false northing.
|
protected abstract void |
sForward(IlvCoordinate ll)
Implements the projection for a sphere.
|
protected void |
sInverse(IlvCoordinate xy)
Implements the inverse projection for a sphere.
|
void |
write(IlvOutputStream stream)
Writes the object to an
IlvOutputStream . |
public static final int NONE
getProperty()
,
Constant Field Valuespublic static final int CONFORMAL
getProperty()
,
Constant Field Valuespublic static final int EQUAL_AREA
getProperty()
,
Constant Field Valuesprotected IlvProjection(boolean ellipsoidEnabled, boolean inverseEnabled, int property)
IlvProjection
.ellipsoidEnabled
- It is true
if non-spherical ellipsoids can be
used for the projection. Projections supporting
non-spherical ellipsoids should implement the
eForward
function.inverseEnabled
- It is true
if the projection implements an
inverse function. Projections implementing an inverse
function should implement the sInverse
and the eInverse
functions, if ellipsoids are supported.property
- The property of the projection (NONE, CONFORMAL, EQUAL_AREA).protected IlvProjection(IlvProjection source)
IlvProjection
by copying an existing one.source
- The graphic object that is copied.protected IlvProjection(IlvInputStream stream) throws IlvReadFileException
IlvInputStream
.stream
- The input stream.IlvReadFileException
- If the format is not correct.public abstract IlvProjection copy()
public <CLASSNAME>(<CLASSNAME> source)
.public void forward(IlvPoint ll) throws IlvToleranceConditionException, IlvUnsupportedProjectionFeature
IlvPoint
representing a latitude and a
longitude to Cartesian coordinates (x,y).ll
- The longitude/latitude coordinates in radians
(x = longitude, y = latitude).IlvToleranceConditionException
- If the latitude or the longitude
are not within the tolerated limits.IlvUnsupportedProjectionFeature
- If the projection does
not support non-spherical ellipsoids and the ellipsoid
used for the projection is not a sphere.IlvProjectionUtil.DegreeToRadian(double)
,
IlvProjectionUtil.DMSToRadian(java.lang.String)
,
isEllipsoidEnabled()
public void forward(IlvCoordinate ll) throws IlvToleranceConditionException, IlvUnsupportedProjectionFeature
IlvCoordinate
representing a latitude and a
longitude to Cartesian coordinates (x,y). The longitude must be in
the range [-PI ; PI]. The latitude must be in the range [-PI/2;
PI/2]. If required, the function converts the latitude to a
geocentric latitude. Then it centers the longitude and adjusts it.
The forward projection is computed either by the sForward
or the
eForward
methods depending on whether the ellipsoid is a sphere
or not. The implementation of this method varies depending on
the projection. Its result is then converted to the appropriate
measurement unit.ll
- The longitude/latitude coordinates in radians
(x = longitude, y = latitude).IlvToleranceConditionException
- If the latitude or the longitude
are not within the tolerated limits.IlvUnsupportedProjectionFeature
- If the projection does
not support non-spherical ellipsoids and the ellipsoid
used for the projection is not a sphere.isEllipsoidEnabled()
,
IlvProjectionUtil.DegreeToRadian(double)
,
IlvProjectionUtil.DMSToRadian(java.lang.String)
public void inverse(IlvPoint xy) throws IlvUnsupportedProjectionFeature, IlvToleranceConditionException
IlvPoint
representing Cartesian
coordinates to a latitude and a longitude.xy
- The Cartesian coordinates in the measurement unit of the
projection.IlvUnsupportedProjectionFeature
- If the inverse function is not
supported
by the projection.IlvToleranceConditionException
- If the values are not within the
tolerated limits.IlvProjectionUtil.RadianToDegree(double)
,
setUnit(ilog.views.maps.IlvLinearUnit)
public IlvPoint inverse(MouseEvent e) throws IlvToleranceConditionException, IlvUnsupportedProjectionFeature
MouseEvent
to a latitude and a
longitude expressed in radians.
If the component of the MouseEvent
is an IlvManagerView
,
the method will apply the inverse transformer to the MouseEvent
coordinates to get the manager coordinates.
e
- The MouseEvent
.IlvUnsupportedProjectionFeature
- If the inverse function is
not supported
by the projection.IlvToleranceConditionException
- If the values are not within the
tolerated limits.IlvProjectionUtil.RadianToDegree(double)
,
setUnit(ilog.views.maps.IlvLinearUnit)
public void inverse(IlvCoordinate xy) throws IlvUnsupportedProjectionFeature, IlvToleranceConditionException
IlvCoordinate
representing Cartesian
coordinates to a latitude and a longitude. The x and y values are
expressed in the measurement unit set for the projection
(generally meters) unless another unit converter was set using the
setUnit
method. The longitude/latitude coordinates
are in radians.xy
- The Cartesian coordinates in the measurement unit of the
projection.IlvUnsupportedProjectionFeature
- If the inverse function
is not supported
by the projection.IlvToleranceConditionException
- If the values are not within the
tolerated limits.IlvProjectionUtil.RadianToDegree(double)
,
setUnit(ilog.views.maps.IlvLinearUnit)
protected abstract void sForward(IlvCoordinate ll) throws IlvToleranceConditionException
This protected method should be implemented by the classes that
extend the class IlvProjection
. It is not called directly by the
user, but by the IlvProjection.forward
method if the ellipsoid
associated with the projection is a sphere.
The method should convert the ll
parameter to the projected
coordinates.
The various parameters associated with a projection, such as
the measurement unit, the false easting or the central meridian,
must not be taken into account in this method because they are
processed by the calling method IlvProjection.forward
.
In this method, the sphere is assumed to be of radius 1.
ll
- Longitude/latitude coordinates in radians.IlvToleranceConditionException
- If the values are not within the
tolerated limits.protected void eForward(IlvCoordinate ll) throws IlvToleranceConditionException, IlvUnsupportedProjectionFeature
This protected method should be implemented by the classes that
extend the class IlvProjection
and that support non-spherical
ellipsoids. It is not called directly by the user, but by the
IlvProjection.forward
method if the ellipsoid
associated with the projection is not a sphere.
The method should convert the ll
parameter to the projected
coordinates.
The various parameters associated with a projection, such as
the measurement unit, the false easting or the central meridian,
must not be taken into account in this method because they are
processed by the calling method IlvProjection.forward
.
In this method, the ellipsoid is assumed to have a semi-equatorial radius of 1.
The default implementation throws an IlvUnsupportedProjectionFeature
exception.
ll
- Longitude/latitude coordinates in radians.IlvToleranceConditionException
- If the values are not within the
tolerated limits.IlvUnsupportedProjectionFeature
- If the projection does not support
non-spherical ellipsoids.protected void sInverse(IlvCoordinate xy) throws IlvUnsupportedProjectionFeature, IlvToleranceConditionException
This protected method should be implemented by the classes that
extend the class IlvProjection
and that support
an inverse projection.
It is not called directly by the user, but by the
IlvProjection.inverse
method if the ellipsoid associated with the projection is a sphere.
The method should convert the xy
parameter to the
corresponding latitude and longitude expressed in radians.
The various parameters associated with a projection, such as
the measurement unit, the false easting or the central meridian,
must not be taken into account in this method because they are
processed by the calling method IlvProjection.inverse
.
In this method, the sphere is assumed to be of radius 1.
The default implementation throws an
IlvUnsupportedProjectionFeature
exception.
xy
- Cartesian coordinates expressed in meters.IlvUnsupportedProjectionFeature
- If the inverse function
is not supported by the projection.IlvToleranceConditionException
- If the values not are within
the tolerated limits.inverse(ilog.views.IlvPoint)
,
isInverseEnabled()
protected void eInverse(IlvCoordinate xy) throws IlvUnsupportedProjectionFeature, IlvToleranceConditionException
This protected method should be implemented by the classes that
extend the class IlvProjection
and that support an
inverse projection and non-spherical ellipsoids.
It is not called directly by the user, but by the
IlvProjection.inverse
method if the ellipsoid associated with the projection is not a sphere.
The method should convert the xy
parameter into the
corresponding
latitude and longitude expressed in radians for an ellipsoid of semi-equatorial
radius of value 1.
The various parameters associated with a projection, such as
the measurement unit, the false easting or the central meridian,
must not be taken into account in this function because they are
processed by the calling method IlvProjection.inverse
.
In this method, the ellipsoid is assumed to have a semi-equatorial radius of 1.
The default implementation throws an IlvUnsupportedProjectionFeature
exception.
xy
- Cartesian coordinates expressed in meters.IlvUnsupportedProjectionFeature
- If the inverse function
or non-spherical
ellipsoids are not supported by the projection.IlvToleranceConditionException
- If the values are not within
the tolerated limits.inverse(ilog.views.IlvPoint)
,
isEllipsoidEnabled()
,
isInverseEnabled()
public void setEllipsoid(IlvEllipsoid ellipsoid)
ellipsoid
- The ellipsoid.IlvEllipsoid
public final IlvEllipsoid getEllipsoid()
public final boolean isGeocentric()
true
if the projection uses geocentric latitudes.setGeocentric(boolean)
public final void setGeocentric(boolean geoc)
geoc
- If true
, the projection uses geocentric latitudes.
Otherwise, the projection uses geodetic latitudes.isGeocentric()
public void setLLCenter(double lon, double lat)
lon
- The central meridian in radians.lat
- The central parallel in radians.IlvProjectionUtil.DegreeToRadian(double)
,
IlvProjectionUtil.DMSToRadian(java.lang.String)
public final void setCentralMeridian(double lon)
lon
- The central meridian in radian.setLLCenter(double, double)
public final double getCentralMeridian()
public final void setCentralParallel(double lat)
lat
- The central parallel in radians.setLLCenter(double, double)
public final double getCentralParallel()
public final void setXYOffset(IlvCoordinate center)
center
- x is the false easting and y is the false northing.
Both offsets should be expressed in meters.public final IlvCoordinate getXYOffset()
public final void setFalseNorthing(double falseNorthing)
falseNorthing
- The offset that will be applied to
the y-coordinate of the projected data.
falseNorthing
should be expressed in meters.setXYOffset(ilog.views.maps.IlvCoordinate)
public final double getFalseNorthing()
getXYOffset()
public final void setFalseEasting(double falseEasting)
falseEasting
- The offset that will be applied to
the x-coordinate of the projected data.
falseEasting
should be expressed in meters.setXYOffset(ilog.views.maps.IlvCoordinate)
public final double getFalseEasting()
getXYOffset()
public final boolean isUsingLongitudeReduction()
true
if the projection uses range reduction for longitudes.setUsingLongitudeReduction(boolean)
public final void setUsingLongitudeReduction(boolean use)
false
disables
internal range
reduction. However this should be used with care in applications.use
- If true
, the range reduction is enabled. Otherwise, it is disabled.protected final double adjustLongitude(double lon)
-PI PI
.lon
- The longitude in radians.public IlvLinearUnit getUnit()
public void setUnit(IlvLinearUnit unit)
unit
- The unit.IlvProjectedCoordinateSystem
public final boolean isEllipsoidEnabled()
true
if non-spherical ellipsoids can be used for the projection.public final boolean isInverseEnabled()
true
if the inverse function is supported by the projection.public int getProperty()
NONE
,
CONFORMAL
,
EQUAL_AREA
protected void addDescription(StringBuffer buffer)
public static IlvProjection GetProjection(String description) throws IlvBadProjectionParameter
description
- A string defining a projection in Evenden's format.IlvBadProjectionParameter
- If the string does not define
a correct projection, or if a projection is not supported.public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
.write
in interface IlvPersistentObject
stream
- The output stream.IOException
- thrown when an exception occurs during
the write operation for this object.@Deprecated public IlvHorizontalDatum getDatum()
@Deprecated public void setDatum(IlvHorizontalDatum datum)
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.