public class Mercator extends NormalizedProjection
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 (variant A) (EPSG code 9804), the line of contact is the equator. For Mercator (variant B) (EPSG code 9805) lines of contact are symmetrical about the equator.
TransverseMercator
,
Serialized FormDefined in the sis-referencing
module
NormalizedProjection.ParameterRole
eccentricity, eccentricitySquared
Constructor and Description |
---|
Mercator(OperationMethod method,
Parameters parameters)
Creates a Mercator projection from the given parameters.
|
Modifier and Type | Method and Description |
---|---|
MathTransform |
createMapProjection(MathTransformFactory factory)
Returns the sequence of normalization →
this → denormalization transforms
as a whole. |
protected void |
inverseTransform(double[] srcPts,
int srcOff,
double[] dstPts,
int dstOff)
Converts 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 points.
|
computeHashCode, equals, getContextualParameters, getParameterDescriptors, getParameterValues, inverse, tryConcatenate
createTransformedShape, derivative, getSourceDimensions, getTargetDimensions, transform
derivative, equals, formatTo, hashCode, isIdentity, transform, transform, transform, transform
print, toString, toString, toWKT
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
derivative, isIdentity, toWKT, transform, transform, transform, transform
public Mercator(OperationMethod method, Parameters parameters)
method
argument can be the description of one of the following:
method
- description of the projection parameters.parameters
- the parameter values of the projection to create.public MathTransform createMapProjection(MathTransformFactory factory) throws FactoryException
this
→ denormalization transforms
as a whole. The transform returned by this method expects (longitude, latitude)
coordinates in degrees and returns (x,y) coordinates in metres.
The non-linear part of the returned transform will be this
transform, except if the ellipsoid
is spherical. In the later case, this
transform will be replaced by a simplified implementation.
createMapProjection
in class NormalizedProjection
factory
- the factory to use for creating the transform.FactoryException
- if an error occurred while creating a transform.ContextualParameters.completeTransform(MathTransformFactory, MathTransform)
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 NormalizedProjection
srcPts
- the array containing the source point coordinate, as (longitude, latitude)
angles in radians.srcOff
- the offset of the single coordinate to be converted in the source array.dstPts
- the array into which the converted 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 coordinate 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 coordinate can not 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
transform(double[], int, double[], int, boolean)
method, but is overridden for efficiency.transform
in interface MathTransform
transform
in class AbstractMathTransform
srcPts
- 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 not be converted.protected void inverseTransform(double[] srcPts, int srcOff, double[] dstPts, int dstOff) throws ProjectionException
dstPts
(angles in radians).inverseTransform
in class NormalizedProjection
srcPts
- 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 not be converted.Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.