fr.cnes.sirius.patrius.projections
Class Mercator

java.lang.Object
  extended by fr.cnes.sirius.patrius.projections.AbstractProjection
      extended by fr.cnes.sirius.patrius.projections.Mercator
All Implemented Interfaces:
IProjection, Serializable
Direct Known Subclasses:
GeneralizedFlamsteedSamson

public class Mercator
extends AbstractProjection

The Mercator projection is a cylindrical map projection which became the standard map projection for nautical purposes because of its ability to represent lines of constant course, known loxodromes, as straight segments. While the linear scale is constant in all directions around any point, thus preserving the angles and the shapes of small objects (which makes the projection conformal), the Mercator projection distorts the size and shape of large objects, as the scale increases from the Equator to the poles, where it becomes infinite.

The mercator projection is defined by a point, called pivot. The longitude of this point is the center of X axis of projected point. The latitude of this point is used to compute the scaleFactor. The origin of Y axis is always the equator parallel. Default pivot is (lat=0,lon=0).

Is an azimuth is given to the Mercator projection, the (X,Y) frame will be rotated, as Y axis is folliwing the given cap. Default azimuth is 0.

The inverse computation can be done using series, or by an iterative way The series are two times faster, but the precision is 5e-5 meters instead of 1e-8 meters.

Since:
3.2
Version:
$Id: Mercator.java 16763 2016-10-10 09:31:17Z bignon $
Author:
Galpin Thomas
See Also:
Serialized Form
Concurrency :
not thread-safe

Field Summary
static double MAX_LATITUDE
          Maximum latitude from which a Mercator transformation can be defined.
 
Constructor Summary
Mercator(double centralMeridian, ProjectionEllipsoid ref)
          Constructor with default values : The latitude of pivot is 0 azimuth is null (no rotation) centered is false.
Mercator(GeodeticPoint pivotIn, ProjectionEllipsoid shape, double azimuthIn, boolean centeredIn, boolean seriesIn)
          Complete constructor.
 
Method Summary
 GeodeticPoint applyInverseTo(double x, double y)
          Inverse projection.
 GeodeticPoint applyInverseTo(double x, double y, double alt)
          This is the Two standard parallel Mercator Projection model.
 Vector2D applyTo(double lat, double lon)
          Returns Easting value and Northing value in meters from latitude and longitude coordinates.
 Vector2D applyTo(GeodeticPoint geodeticPoint)
          Returns Easting value and Northing value in meters from geodetic coordinates.
 boolean canMap(GeodeticPoint coordinates)
          Returns a boolean depending if the geodetic point can be map with the selected projection method.
 double getAzimuth()
          Get the azimuth of the projection (CLOCKWISE).
 double getDistortionFactor(double lat)
          Returns the scale factor at a specific latitude.
 EnumLineProperty getLineProperty()
          Getter for line property .
 double getMaximumEastingValue()
          Getter for the maximum value for X projected.
 double getMaximumLatitude()
          Getter for the maximum latitude that the projection can map.
 double getMaximumNorthingValue()
          Get the maximum northing value in meters.
 double getScaleFactor(double lat)
          Returns the scale factor at a specific latitude.
 boolean isConformal()
          Inform the user if the direct transformation is a conformal 's one (If yes, it preserves angles).
 boolean isEquivalent()
          Inform the user if the direct transformation is an equivalent 's one (If yes, it preserves surfaces).
 
Methods inherited from class fr.cnes.sirius.patrius.projections.AbstractProjection
applyInverseTo, applyInverseTo, applyTo, applyToAndDiscretize, discretize, discretizeAndApplyTo, discretizeCircleAndApplyTo, discretizeRhumbAndApplyTo, getPivotPoint, getReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_LATITUDE

public static final double MAX_LATITUDE
Maximum latitude from which a Mercator transformation can be defined.

See Also:
Constant Field Values
Constructor Detail

Mercator

public Mercator(GeodeticPoint pivotIn,
                ProjectionEllipsoid shape,
                double azimuthIn,
                boolean centeredIn,
                boolean seriesIn)
Complete constructor. This is the One standard parallel Mercator Projection with a scale factor at the natural origin. The latitude is here defined as being the Equator. The central meridian is defined as the map center longitude in radians. The scale factor is defined at the natural origin (Equator).

Parameters:
pivotIn - pivot point used for projection
shape - reference shape used for projection
azimuthIn - is angle from the north direction to the current direction in CLOCKWISE sense
centeredIn - if true, Y coordinates equal 0 in pivot point. The rotation if around pivot.
seriesIn - boolean indicating if the inverse projection uses a direct method with series, or an iterative method

Mercator

public Mercator(double centralMeridian,
                ProjectionEllipsoid ref)
Constructor with default values :

Parameters:
centralMeridian - central meridian
ref - reference shape
Method Detail

canMap

public final boolean canMap(GeodeticPoint coordinates)
Returns a boolean depending if the geodetic point can be map with the selected projection method..

Parameters:
coordinates - geodetic point to test if representable.
Returns:
True if the geodetic point can be represented on the map with the chosen projection method.

applyTo

public Vector2D applyTo(GeodeticPoint geodeticPoint)
                 throws OrekitException
Returns Easting value and Northing value in meters from geodetic coordinates.

Parameters:
geodeticPoint - the geodetic point to transform.
Returns:
Vector2D containing Easting value and Northing value in meters.
Throws:
OrekitException - thrown if projection could not be computed

applyTo

public Vector2D applyTo(double lat,
                        double lon)
                 throws OrekitException
Returns Easting value and Northing value in meters from latitude and longitude coordinates.

Parameters:
lat - latitude of the point to project.
lon - longitude of the point to project.
Returns:
Vector2D containing Easting value and Northing value in meters.
Throws:
OrekitException - thrown if projection could not be computed

applyInverseTo

public GeodeticPoint applyInverseTo(double x,
                                    double y,
                                    double alt)
                             throws OrekitException
This is the Two standard parallel Mercator Projection model. The latitude and the longitude of the given point to convert can be defined from any natural origin and the user can set the altitude.

Parameters:
x - abscissa coordinate
y - ordinate coordinate
alt - altitude coordinate
Returns:
coordinate
Throws:
OrekitException - thrown if inverse projection could not be computed

applyInverseTo

public GeodeticPoint applyInverseTo(double x,
                                    double y)
                             throws OrekitException
Inverse projection. Returns geodetic coordinates. This is the inverse transformation process to convert two dimensional map coordinates into geodetics one. The iterative method used is a Newton-Raphson iterative process. We're searching the solution of F(phi) = 0. At each iterations, we compute a new value of phi : phi' = phi - F(phi)/F'(phi) where phi is the trial value, F(phi) = y(phi) - phi, with y(phi) the direct Mercator transformation, and F'(phi) the derive function of y(phi). The stop condition is satisfied when F(phi) < epsilon (here equal at 1E-14). This method returns geodetic coordinates. The iterative process stop if the iteration's number is bigger than 100.

Parameters:
x - abscissa coordinate
y - ordinate coordinate
Returns:
geodetic coordinates.
Throws:
OrekitException - thrown if inverse projection could not be computed

isConformal

public boolean isConformal()
Inform the user if the direct transformation is a conformal 's one (If yes, it preserves angles).

Returns:
a boolean.

isEquivalent

public boolean isEquivalent()
Inform the user if the direct transformation is an equivalent 's one (If yes, it preserves surfaces).

Returns:
a boolean.

getLineProperty

public EnumLineProperty getLineProperty()
Getter for line property .

Returns:
line property.

getMaximumLatitude

public final double getMaximumLatitude()
Getter for the maximum latitude that the projection can map.

Returns:
Maximum latitude that the projection can map.

getMaximumEastingValue

public final double getMaximumEastingValue()
Getter for the maximum value for X projected.

Returns:
the Maximum value for X projected.

getAzimuth

public double getAzimuth()
Get the azimuth of the projection (CLOCKWISE).

Returns:
the azimuth (CLOCKWISE)

getMaximumNorthingValue

public final double getMaximumNorthingValue()
Get the maximum northing value in meters.

Returns:
maximum northing value in meters.

getScaleFactor

public final double getScaleFactor(double lat)
Returns the scale factor at a specific latitude. The result is the fraction Mercator distance / real distance.

Parameters:
lat - latitude
Returns:
the scale factor

getDistortionFactor

public final double getDistortionFactor(double lat)
Returns the scale factor at a specific latitude. The result is the fraction Mercator distance / real distance.

Specified by:
getDistortionFactor in class AbstractProjection
Parameters:
lat - latitude
Returns:
the distortion factor


Copyright © 2016 CNES. All Rights Reserved.