|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectFormattableObject
AbstractMathTransform
AbstractMathTransform2D
UnitaryProjection
Mercator
@Immutable public class Mercator
Mercator Cylindrical projection (EPSG codes 9804, 9805, 1026, 1024, 9841). See the
Mercator projection on MathWorld
for an overview. See any of the following providers for a list of programmatic parameters:
Description
The parallels and the meridians are straight lines and cross at right angles; this projection
thus produces rectangular charts. The scale is true along the equator (by default) or along two
parallels equidistant of the equator (if a scale factor other than 1 is used).
This projection is used to represent areas close to the equator. It is also often used for maritime navigation because all the straight lines on the chart are loxodrome lines, i.e. a ship following this line would keep a constant azimuth on its compass.
This implementation handles both the 1 and 2 standard parallel cases.
For Mercator_1SP (EPSG code 9804), the line of contact is the equator.
For Mercator_2SP (EPSG code 9805) lines of contact are symmetrical
about the equator.
Behavior at poles
The projection of 90°N gives positive infinity.
The projection of 90°S gives negative infinity.
Projection of a latitude outside the [-90-ε ... 90+ε]° range produces
NaN.
References
TransverseMercator,
ObliqueMercator,
Serialized Form
| referencing/geotk-referencing (download) | View source code for this class |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class UnitaryProjection |
|---|
UnitaryProjection.Parameters |
| Field Summary |
|---|
| Fields inherited from class UnitaryProjection |
|---|
excentricity, excentricitySquared |
| Fields inherited from class FormattableObject |
|---|
EPSG, GEOTIFF, INTERNAL, OGC, SINGLE_LINE |
| Constructor Summary | |
|---|---|
protected |
Mercator(UnitaryProjection.Parameters parameters)
Constructs a new map projection from the supplied parameters. |
| Method Summary | |
|---|---|
static MathTransform2D |
create(ParameterDescriptorGroup descriptor,
ParameterValueGroup values)
Creates a Mercator projection from the given parameters. |
ParameterDescriptorGroup |
getParameterDescriptors()
Returns the parameter descriptors for this unitary projection. |
protected void |
inverseTransform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff)
Transforms the specified (x,y) coordinates and stores the result in dstPts (angles in radians). |
Matrix |
transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
boolean derivate)
Converts the specified (λ,φ) coordinate (units in radians) and stores the result in dstPts (linear distance on a unit sphere). |
void |
transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
Converts a list of coordinate point ordinal values. |
| Methods inherited from class UnitaryProjection |
|---|
computeHashCode, equals, finish, getParameterValues, getUnmarshalledParameters, inverse, resetWarnings, rollLongitude, unrollLongitude |
| Methods inherited from class AbstractMathTransform2D |
|---|
getSourceDimensions, getTargetDimensions, transform |
| Methods inherited from class AbstractMathTransform |
|---|
createTransformedShape, derivative, derivative, ensureNonNull, equals, formatWKT, getName, hashCode, isIdentity, rollLongitude, transform, transform, transform, transform |
| Methods inherited from class FormattableObject |
|---|
getDefaultIndentation, print, setDefaultIndentation, toString, toWKT, toWKT, toWKT, toWKT |
| Methods inherited from class Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface MathTransform2D |
|---|
createTransformedShape, derivative |
| Methods inherited from interface MathTransform |
|---|
derivative, isIdentity, toWKT, transform, transform, transform, transform |
| Constructor Detail |
|---|
protected Mercator(UnitaryProjection.Parameters parameters)
parameters - The parameters of the projection to be created.| Method Detail |
|---|
public static MathTransform2D create(ParameterDescriptorGroup descriptor,
ParameterValueGroup values)
PARAMETERS constants defined in Mercator1SP or
Mercator2SP, but is not restricted to. If a different descriptor is supplied,
it is user's responsibility to ensure that it is suitable to a Mercator projection.
descriptor - Typically one of Mercator1SP.PARAMETERS,
Mercator2SP.PARAMETERS or MillerCylindrical.PARAMETERS.values - The parameter values of the projection to create.
public ParameterDescriptorGroup getParameterDescriptors()
Mercator1SP in all cases, because the
2SP case is implemented as 1SP with a different scale factor.
getParameterDescriptors in interface ParameterizedgetParameterDescriptors in class AbstractMathTransform2Dnull.OperationMethod.getParameters()
public Matrix transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
boolean derivate)
throws ProjectionException
dstPts (linear distance on a unit sphere). In addition,
opportunistically computes the projection derivative if derivate is true.
transform in class UnitaryProjectionsrcPts - The array containing the source point coordinate, as (longitude,
latitude) angles in radians.srcOff - The offset of the point to be converted in the source array.dstPts - The array into which the converted point coordinate is returned (may be
the same than srcPts). Ordinates will be expressed in a dimensionless
unit, as a linear distance on a unit sphere or ellipse.dstOff - The offset of the location of the converted point that is
stored in the destination array.derivate - true for computing the derivative, or false if not needed.
null
if the derivate argument is false.
ProjectionException - if the point can't be converted.AbstractMathTransform.derivative(DirectPosition),
AbstractMathTransform.transform(DirectPosition, DirectPosition),
MathTransforms.derivativeAndTransform(MathTransform, double[], int, double[], int)
public void transform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff,
int numPts)
throws TransformException
Note: We override the super-class method only as an optimization in the special case where the target coordinates are written at the same locations than the source coordinates. In such case, we can take advantage of the fact that the λ value is not modified by the unitary Mercator projection.
transform in interface MathTransformtransform in class AbstractMathTransformsrcPts - The array containing the source point coordinates.srcOff - The offset to the first point to be transformed in the source array.dstPts - The array into which the transformed point coordinates are returned.
May be the same than srcPts.dstOff - 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.
TransformException - if a point can't be transformed. Some implementations will stop
at the first failure, wile some other implementations will fill the un-transformable
points with NaN values, continue and throw the exception
only at end. Implementations that fall in the later case should set the last completed transform to this.
protected void inverseTransform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff)
throws ProjectionException
dstPts (angles in radians).
inverseTransform in class UnitaryProjectionsrcPts - The array containing the source point coordinate, as linear distance
on a unit sphere or ellipse.srcOff - The offset of the point to be converted in the source array.dstPts - the array into which the converted point coordinate is returned (may be
the same than srcPts). Ordinates will be (longitude,
latitude) angles in radians.dstOff - The offset of the location of the converted point that is
stored in the destination array.
ProjectionException - if the point can't be converted.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||