|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.ct.AbstractMathTransform org.geotools.ct.proj.MapProjection
MapProjection
.
Base class for transformation services between ellipsoidal and cartographic projections. This base class provides the basic feature needed for all methods (no need to overrides methods). Subclasses must "only" implements the following methods:
getName(java.util.Locale)
transformNormalized(double, double, java.awt.geom.Point2D)
inverseTransformNormalized(double, double, java.awt.geom.Point2D)
Field Summary | |
protected double |
centralMeridian
Deprecated. Central longitude in radians. |
protected double |
e
Deprecated. Ellipsoid excentricity, equals to sqrt( .
|
protected double |
es
Deprecated. The square of excentricity: e? = (a?-b?)/a? where a is the semi major axis length and b is the semi minor axis length. |
protected double |
falseEasting
Deprecated. False easting, in metres. |
protected double |
falseNorthing
Deprecated. False northing, in metres. |
protected double |
globalScale
Deprecated. Global scale factor. |
protected boolean |
isSpherical
Deprecated. true if this projection is spherical. |
protected double |
latitudeOfOrigin
Deprecated. Latitude of origin in radians. |
protected double |
scaleFactor
Deprecated. The scale factor. |
protected double |
semiMajor
Deprecated. Length of semi-major axis, in metres. |
protected double |
semiMinor
Deprecated. Length of semi-minor axis, in metres. |
Fields inherited from interface org.geotools.ct.MathTransform2D |
IDENTITY |
Constructor Summary | |
protected |
MapProjection(Projection parameters)
Deprecated. Construct a new map projection from the suplied parameters. |
Method Summary | |
boolean |
equals(java.lang.Object object)
Deprecated. Compares the specified object with this map projection for equality. |
int |
getDimSource()
Deprecated. Gets the dimension of input points. |
int |
getDimTarget()
Deprecated. Gets the dimension of output points. |
abstract java.lang.String |
getName(java.util.Locale locale)
Deprecated. Returns a human readable name localized for the specified locale. |
int |
hashCode()
Deprecated. Returns a hash value for this map projection. |
MathTransform |
inverse()
Deprecated. Returns the inverse of this map projection. |
protected abstract java.awt.geom.Point2D |
inverseTransformNormalized(double x,
double y,
java.awt.geom.Point2D ptDst)
Deprecated. Transforms the specified coordinate and stores the result in ptDst .
|
java.lang.String |
toString()
Deprecated. Retourne une cha?ne de caract?res repr?sentant cette projection cartographique. |
void |
transform(double[] src,
int srcOffset,
double[] dest,
int dstOffset,
int numPts)
Deprecated. Transforms a list of coordinate point ordinal values. |
void |
transform(float[] src,
int srcOffset,
float[] dest,
int dstOffset,
int numPts)
Deprecated. Transforms a list of coordinate point ordinal values. |
java.awt.geom.Point2D |
transform(java.awt.geom.Point2D ptSrc,
java.awt.geom.Point2D ptDst)
Deprecated. Transforms the specified ptSrc and stores the result in ptDst .
|
protected abstract java.awt.geom.Point2D |
transformNormalized(double x,
double y,
java.awt.geom.Point2D ptDst)
Deprecated. Transforms the specified coordinate and stores the result in ptDst .
|
Methods inherited from class org.geotools.ct.AbstractMathTransform |
createTransformedShape, derivative, derivative, fromGeoAPI, isIdentity, transform |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.geotools.ct.MathTransform2D |
createTransformedShape, derivative |
Methods inherited from interface org.geotools.ct.MathTransform |
derivative, isIdentity, transform |
Field Detail |
protected final double e
sqrt(es
)
.
Value 0 means that the ellipsoid is spherical.
es
,
isSpherical
protected final double es
e
,
semiMajor
,
semiMinor
,
isSpherical
protected final boolean isSpherical
true
if this projection is spherical. Spherical model has identical
semi major and semi minor axis
length, and an excentricity zero.
e
,
semiMajor
,
semiMinor
protected final double semiMajor
e
,
semiMinor
protected final double semiMinor
e
,
semiMajor
protected final double centralMeridian
protected double latitudeOfOrigin
protected double scaleFactor
protected final double falseEasting
protected final double falseNorthing
protected double globalScale
globalScale
is equal
to semiMajor
×scaleFactor
.
Consider this field as final. It is not final only
because some classes need to modify it at construction time.
Constructor Detail |
protected MapProjection(Projection parameters) throws MissingParameterException
parameters
- The parameter values in standard units.
The following parameter are recognized:
MissingParameterException
- if a mandatory parameter is missing.Method Detail |
public abstract java.lang.String getName(java.util.Locale locale)
getName
in class AbstractMathTransform
locale
- The desired locale, or null
for a default locale.
null
if no name is available in any locale.public final int getDimSource()
getDimSource
in interface MathTransform
CT_MathTransform.getDimSource()
public final int getDimTarget()
getDimTarget
in interface MathTransform
CT_MathTransform.getDimTarget()
protected abstract java.awt.geom.Point2D inverseTransformNormalized(double x, double y, java.awt.geom.Point2D ptDst) throws ProjectionException
ptDst
.
This method returns longitude as x values in the range [-PI..PI]
and latitude as y values in the range [-PI/2..PI/2]
. It will be
checked by the caller, so this method doesn't need to performs this check.
falseEasting
and falseNorthing
removed and be divided by globalScale
before this method is invoked. After this method is invoked, the
centralMeridian
is added to the x
results
in ptDst
. This means that projections that implement this method
are performed on an ellipse (or sphere) with a semiMajor axis of 1.0.
pj_inv.c
.
Therefore when porting projections from PROJ.4, the inverse transform
equations can be used directly here with minimal change.
In the equations of Snyder, falseEasting
, falseNorthing
and scaleFactor
are usually not given.
When implementing these equations here, you will not
need to add the centralMeridian
to the output longitude or remove the
semiMajor
('a' or 'R').
x
- The easting of the coordinate, linear distance on a unit sphere or ellipse.y
- The northing of the coordinate, linear distance on a unit sphere or ellipse.ptDst
- the specified coordinate point that stores the result of transforming
ptSrc
, or null
. Ordinates will be in
radians.
x
, y
and storing the result in ptDst
.
ProjectionException
- if the point can't be transformed.ptDst
argument will be removed and the return type changed if
RFE 4222792
is implemented efficiently in a future J2SE release (maybe J2SE 1.5?).protected abstract java.awt.geom.Point2D transformNormalized(double x, double y, java.awt.geom.Point2D ptDst) throws ProjectionException
ptDst
.
This method is guaranteed to be invoked with values of x in the range
[-PI..PI]
and values of y in the range [-PI/2..PI/2]
.
centralMeridian
removed from x before this method is invoked. After this method
is invoked, the results in ptDst
are multiplied by globalScale
,
and the falseEasting
and falseNorthing
are added.
This means that projections that implement this method are performed on an
ellipse (or sphere) with a semiMajor axis of 1.0.
pj_fwd.c
.
Therefore when porting projections from PROJ.4, the forward transform equations can
be used directly here with minimal change. In the equations of Snyder,
falseEasting
, falseNorthing
and scaleFactor
are usually not given. When implementing these equations here, you will not
need to remove the centralMeridian
from x or apply the
semiMajor
('a' or 'R').
x
- The longitude of the coordinate, in radians.y
- The latitude of the coordinate, in radians.ptDst
- the specified coordinate point that stores the result of transforming
ptSrc
, or null
. Ordinates will be in a
dimensionless unit, as a linear distance on a unit sphere or ellipse.
x
, y
and storing the result in ptDst
.
ProjectionException
- if the point can't be transformed.ptDst
argument will be removed and the return type changed if
RFE 4222792
is implemented efficiently in a future J2SE release (maybe J2SE 1.5?).public final java.awt.geom.Point2D transform(java.awt.geom.Point2D ptSrc, java.awt.geom.Point2D ptDst) throws ProjectionException
ptSrc
and stores the result in ptDst
.
x
coordinate
by removing the centralMeridian
, before invoking
transformNormalized
(x, y, ptDst)
.
It also multiplies by globalScale
and adds the falseEasting
and
falseNorthing
to the point returned by the transformNormalized(...)
call.
transform
in interface MathTransform2D
transform
in class AbstractMathTransform
ptSrc
- the specified coordinate point to be transformed. Ordinates must be in degrees.ptDst
- the specified coordinate point that stores the result of transforming
ptSrc
, or null
. Ordinates will be in metres.
ptSrc
and storing
the result in ptDst
.
ProjectionException
- if the point can't be transformed.MathTransform2D.transform(Point2D,Point2D)
public final void transform(double[] src, int srcOffset, double[] dest, int dstOffset, int numPts) throws ProjectionException
transform
in interface MathTransform
src
- the array containing the source point coordinates.srcOffset
- the offset to the first point to be transformed
in the source array.dest
- the array into which the transformed point
coordinates are returned. May be the same
than srcPts
.dstOffset
- the offset to the location of the first
transformed point that is stored in the
destination array.numPts
- the number of point objects to be transformed.
ProjectionException
- if a point can't be transformed. This method try
to transform every points even if some of them can't be transformed.
Non-transformable points will have value Double.NaN
. If more
than one point can't be transformed, then this exception may be about
an arbitrary point.CT_MathTransform.transformList(double[])
public final void transform(float[] src, int srcOffset, float[] dest, int dstOffset, int numPts) throws ProjectionException
transform
in interface MathTransform
transform
in class AbstractMathTransform
ProjectionException
- if a point can't be transformed. This method try
to transform every points even if some of them can't be transformed.
Non-transformable points will have value Float.NaN
. If more
than one point can't be transformed, then this exception may be about
an arbitrary point.public final MathTransform inverse()
inverse
in interface MathTransform
inverse
in class AbstractMathTransform
public int hashCode()
hashCode
in class AbstractMathTransform
public boolean equals(java.lang.Object object)
equals
in class AbstractMathTransform
public final java.lang.String toString()
toString
in class AbstractMathTransform
AbstractMathTransform.paramMT(String)
. We should consider moving
it in a formatter class, probably close to WKTParser.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |