|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.geotools.referencing.wkt.Formattable
org.geotools.referencing.operation.transform.AbstractMathTransform
org.geotools.referencing.operation.projection.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:
getParameterValues()transformNormalized(double, double, java.awt.geom.Point2D)inverseTransformNormalized(double, double, java.awt.geom.Point2D)NOTE:Serialization of this class is appropriate for short-term storage or RMI use, but will probably not be compatible with future version. For long term storage, WKT (Well Know Text) or XML (not yet implemented) are more appropriate.
| Nested Class Summary | |
static class |
MapProjection.AbstractProvider
The base provider for MapProjections. |
| Field Summary | |
protected double |
centralMeridian
Central longitude in radians. |
protected double |
excentricity
Ellipsoid excentricity, equals to sqrt(.
|
protected double |
excentricitySquared
The square of excentricity: e? = (a?-b?)/a? where e is the excentricity, a is the semi major axis length and b is the semi minor axis length. |
protected double |
falseEasting
False easting, in metres. |
protected double |
falseNorthing
False northing, in metres. |
protected double |
globalScale
Global scale factor. |
protected boolean |
isSpherical
if this projection is spherical. |
protected double |
latitudeOfOrigin
Latitude of origin in radians. |
protected double |
scaleFactor
The scale factor. |
protected double |
semiMajor
Length of semi-major axis, in metres. |
protected double |
semiMinor
Length of semi-minor axis, in metres. |
| Constructor Summary | |
protected |
MapProjection(org.opengis.parameter.ParameterValueGroup values)
Constructs a new map projection from the suplied parameters. |
| Method Summary | |
boolean |
equals(java.lang.Object object)
Compares the specified object with this map projection for equality. |
abstract org.opengis.parameter.ParameterDescriptorGroup |
getParameterDescriptors()
Returns the parameter descriptors for this map projection. |
org.opengis.parameter.ParameterValueGroup |
getParameterValues()
Returns the parameter values for this map projection. |
int |
getSourceDimensions()
Returns the dimension of input points. |
int |
getTargetDimensions()
Returns the dimension of output points. |
protected double |
getToleranceForAssertions(double longitude,
double latitude)
Maximal error (in metres) tolerated for assertion, if enabled. |
int |
hashCode()
Returns a hash value for this map projection. |
org.opengis.referencing.operation.MathTransform |
inverse()
Returns the inverse of this map projection. |
protected abstract java.awt.geom.Point2D |
inverseTransformNormalized(double x,
double y,
java.awt.geom.Point2D ptDst)
Transforms the specified coordinate and stores the result in . |
void |
transform(double[] src,
int srcOffset,
double[] dest,
int dstOffset,
int numPts)
Transforms a list of coordinate point ordinal values. |
void |
transform(float[] src,
int srcOffset,
float[] dest,
int dstOffset,
int numPts)
Transforms a list of coordinate point ordinal values. |
java.awt.geom.Point2D |
transform(java.awt.geom.Point2D ptSrc,
java.awt.geom.Point2D ptDst)
Transforms the specified and stores the result in . |
protected abstract java.awt.geom.Point2D |
transformNormalized(double x,
double y,
java.awt.geom.Point2D ptDst)
Transforms the specified coordinate and stores the result in . |
| Methods inherited from class org.geotools.referencing.operation.transform.AbstractMathTransform |
createTransformedShape, derivative, derivative, ensureNonNull, formatWKT, getDimSource, getDimTarget, isIdentity, needCopy, rollLongitude, transform |
| Methods inherited from class org.geotools.referencing.wkt.Formattable |
toString, toWKT, toWKT, toWKT |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.opengis.referencing.operation.MathTransform2D |
createTransformedShape, derivative |
| Methods inherited from interface org.opengis.referencing.operation.MathTransform |
derivative, isIdentity, toWKT, transform |
| Field Detail |
protected final double excentricity
sqrt(excentricitySquared).
Value 0 means that the ellipsoid is spherical.
excentricitySquared,
isSphericalprotected final double excentricitySquared
excentricity,
semiMajor,
semiMinor,
isSphericalprotected final boolean isSpherical
excentricity,
semiMajor,
semiMinorprotected final double semiMajor
excentricity,
semiMinorprotected final double semiMinor
excentricity,
semiMajorprotected double centralMeridian
protected double latitudeOfOrigin
protected double scaleFactor
protected final double falseEasting
protected final double falseNorthing
protected double globalScale
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(org.opengis.parameter.ParameterValueGroup values)
throws org.opengis.parameter.ParameterNotFoundException
values - The parameter values in standard units.
The following parameter are recognized:
org.opengis.parameter.ParameterNotFoundException - if a mandatory parameter is missing.| Method Detail |
public abstract org.opengis.parameter.ParameterDescriptorGroup getParameterDescriptors()
getParameterValues(), as well as arguments checking.
getParameterDescriptors in class AbstractMathTransformOperationMethod.getParameters()public org.opengis.parameter.ParameterValueGroup getParameterValues()
getParameterValues in class AbstractMathTransformOperation.getParameterValues()public final int getSourceDimensions()
getSourceDimensions in interface org.opengis.referencing.operation.MathTransformgetSourceDimensions in class AbstractMathTransformpublic final int getTargetDimensions()
getTargetDimensions in interface org.opengis.referencing.operation.MathTransformgetTargetDimensions in class AbstractMathTransform
protected abstract java.awt.geom.Point2D inverseTransformNormalized(double x,
double y,
java.awt.geom.Point2D ptDst)
throws ProjectionException
Input coordinates are also guarenteed to have the 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 results
in . This means that projections that implement this method
are performed on an ellipse (or sphere) with a semiMajor axis of 1.0.
In PROJ.4, the same
standardization, described above, is handled by .
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
, or . Ordinates will be in
radians.
ProjectionException - if the point can't be transformed.
protected abstract java.awt.geom.Point2D transformNormalized(double x,
double y,
java.awt.geom.Point2D ptDst)
throws ProjectionException
Coordinates are also guaranteed to have the centralMeridian
removed from x before this method is invoked. After this method
is invoked, the results in 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.
In PROJ.4, the same
standardization, described above, is handled by .
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
, or . Ordinates will be in a
dimensionless unit, as a linear distance on a unit sphere or ellipse.
ProjectionException - if the point can't be transformed.
public final java.awt.geom.Point2D transform(java.awt.geom.Point2D ptSrc,
java.awt.geom.Point2D ptDst)
throws ProjectionException
This method standardizes the source coordinate
by removing the centralMeridian, before invoking
.
It also multiplies by transformNormalized(x, y, ptDst)globalScale and adds the falseEasting and
falseNorthing to the point returned by the
call.
transform in interface org.opengis.referencing.operation.MathTransform2Dtransform in class AbstractMathTransformptSrc - the specified coordinate point to be transformed. Ordinates must be in degrees.ptDst - the specified coordinate point that stores the result of transforming
, or . Ordinates will be in metres.
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 org.opengis.referencing.operation.MathTransformProjectionException - 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.
public final void transform(float[] src,
int srcOffset,
float[] dest,
int dstOffset,
int numPts)
throws ProjectionException
transform in interface org.opengis.referencing.operation.MathTransformtransform in class AbstractMathTransformProjectionException - 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 org.opengis.referencing.operation.MathTransform inverse()
inverse in interface org.opengis.referencing.operation.MathTransforminverse in class AbstractMathTransform
protected double getToleranceForAssertions(double longitude,
double latitude)
AssertionError will be thrown. Subclasses should override this method if they need
to relax the tolerance level.
longitude - The longitude in degrees.latitude - The latitude in degrees.
public int hashCode()
hashCode in class AbstractMathTransformpublic boolean equals(java.lang.Object object)
equals in class AbstractMathTransform
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||