Class ObliqueMercator
- All Implemented Interfaces:
Serializable
,MathTransform
,MathTransform2D
- Direct Known Subclasses:
HotineObliqueMercator
The Oblique Mercator projection uses a (U,V) coordinate system, with the U axis along the central line. During the forward projection, coordinates from the ellipsoid are projected conformally to a sphere of constant total curvature, called the "aposphere", before being projected onto the plane. The projection coordinates are further convented to a (X,Y) coordinate system by rotating the calculated (u,v) coordinates to give output (x,y) coordinates. The rotation value is usually the same as the projection azimuth (the angle, east of north, of the central line), but some cases allow a separate rotation parameter.
There are two forms of the oblique mercator, differing in the origin of their grid coordinates. The
Hotine Oblique Mercator (EPSG code 9812) has grid coordinates start at the
intersection of the central line and the equator of the aposphere. The Oblique Mercator
(EPSG code 9815) is the same, except the grid coordinates begin at the central point (where the latitude of center
and central line intersect). ESRI separates these two case by appending "Natural_Origin"
(for the
"Hotine_Oblique_Mercator"
) and "Center"
(for the "Oblique_Mercator"
) to the projection names.
Two different methods are used to specify the central line for the oblique mercator: 1) a central point and an
azimuth, east of north, describing the central line and 2) two points on the central line. The EPSG does not use the
two point method, while ESRI separates the two cases by putting "Azimuth"
and "Two_Point"
in their
projection names. Both cases use the point where the "latitude_of_center"
parameter crosses the central line
as the projection's central point. The central meridian is not a projection parameter,
and is instead calculated as the intersection between the central line and the equator of the aposphere.
For the azimuth method, the central latitude cannot be ±90.0 degrees and the central line cannot be at a maximum or minimum latitude at the central point. In the two point method, the latitude of the first and second points cannot be equal. Also, the latitude of the first point and central point cannot be ±90.0 degrees. Furthermore, the latitude of the first point cannot be 0.0 and the latitude of the second point cannot be -90.0 degrees. A change of 10-7 radians can allow calculation at these special cases. Snyder's restriction of the central latitude being 0.0 has been removed, since the equations appear to work correctly in this case.
Azimuth values of 0.0 and ±90.0 degrees are allowed (and used in Hungary and Switzerland), though these cases would usually use a Mercator or Transverse Mercator projection instead. Azimuth values > 90 degrees cause errors in the equations.
The oblique mercator is also called the "Rectified Skew Orthomorphic" (RSO). It appears is that the only
difference from the oblique mercator is that the RSO allows the rotation from the (U,V) to
(X,Y) coordinate system to be different from the azimuth. This separate parameter is called
"rectified_grid_angle"
(or "XY_Plane_Rotation"
by ESRI) and is also included in the EPSG's parameters
for the Oblique Mercator and Hotine Oblique Mercator. The rotation parameter is optional in all the non-two point
projections and will be set to the azimuth if not specified.
Projection cases and aliases implemented by the ObliqueMercator
are:
Oblique_Mercator
(EPSG code 9815)
grid coordinates begin at the central point, has"rectified_grid_angle"
parameter.Hotine_Oblique_Mercator_Azimuth_Center
(ESRI)
grid coordinates begin at the central point.Rectified_Skew_Orthomorphic_Center
(ESRI)
grid coordinates begin at the central point, has"rectified_grid_angle"
parameter.Hotine_Oblique_Mercator
(EPSG code 9812)
grid coordinates begin at the interseciton of the central line and aposphere equator, has"rectified_grid_angle"
parameter.Hotine_Oblique_Mercator_Azimuth_Natural_Origin
(ESRI)
grid coordinates begin at the interseciton of the central line and aposphere equator.Rectified_Skew_Orthomorphic_Natural_Origin
(ESRI)
grid coordinates begin at the interseciton of the central line and aposphere equator, has"rectified_grid_angle"
parameter.Hotine_Oblique_Mercator_Two_Point_Center
(ESRI)
grid coordinates begin at the central point.Hotine_Oblique_Mercator_Two_Point_Natural_Origin
(ESRI)
grid coordinates begin at the interseciton of the central line and aposphere equator.
References:
libproj4
is available at libproj4 Miscellanea
Relevent files are:PJ_omerc.c
,pj_tsfn.c
,pj_fwd.c
,pj_inv.c
andlib_proj.h
- John P. Snyder (Map Projections - A Working Manual, U.S. Geological Survey Professional Paper 1395, 1987)
- "Coordinate Conversions and Transformations including Formulas", EPSG Guidence Note Number 7 part 2, Version 24.
- Gerald Evenden, 2004, Documentation of revised Oblique Mercator
- Since:
- 2.1
- Author:
- Gerald I. Evenden (for original code in Proj4), Rueben Schulz
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
The math transform provider for an Oblique Mercator projection (EPSG code 9815).static class
The math transform provider for a Oblique Mercator projection, specified with two points on the central line (instead of a central point and azimuth).Nested classes/interfaces inherited from class MapProjection
MapProjection.AbstractProvider
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final double
The azimuth of the central line passing throught the centre of the projection, in radians.protected final double
Latitude of the projection centre.protected final double
Longitude of the projection centre.protected final double
The rectified bearing of the central line, in radians.Fields inherited from class MapProjection
centralMeridian, en0, en1, en2, en3, en4, excentricity, excentricitySquared, falseEasting, falseNorthing, globalScale, invertible, isSpherical, latitudeOfOrigin, LOGGER, scaleFactor, semiMajor, semiMinor, SKIP_SANITY_CHECKS
Fields inherited from class Formattable
SINGLE_LINE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ObliqueMercator
(ParameterValueGroup parameters) Constructs a new map projection from the supplied parameters. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares the specified object with this map projection for equality.Returns the parameter descriptors for this map projection.Returns the parameter values for this map projection.protected double
getToleranceForAssertions
(double longitude, double latitude) Maximal error (in metres) tolerated for assertion, if enabled.int
hashCode()
Returns a hash value for this projection.protected Point2D
inverseTransformNormalized
(double x, double y, Point2D ptDst) Transforms the specified coordinate and stores the result inptDst
.protected Point2D
transformNormalized
(double x, double y, Point2D ptDst) Transforms the specified coordinate and stores the result inptDst
.Methods inherited from class MapProjection
checkReciprocal, getSourceDimensions, getTargetDimensions, inv_mlfn, inverse, mlfn, orthodromicDistance, resetWarnings, transform, transform, transform
Methods inherited from class AbstractMathTransform
createTransformedShape, derivative, derivative, ensureNonNull, formatWKT, getName, isIdentity, needCopy, normalizeAngle, rollLongitude, transform, transform, transform
Methods inherited from class Formattable
cleanupThreadLocals, toString, toWKT, toWKT, toWKT, toWKT
Methods inherited from interface MathTransform
derivative, isIdentity, toWKT, transform, transform, transform
Methods inherited from interface MathTransform2D
createTransformedShape, derivative
-
Field Details
-
latitudeOfCentre
protected final double latitudeOfCentreLatitude of the projection centre. This is similar to theMapProjection.latitudeOfOrigin
, but the latitude of origin is the Earth equator on aposphere for the oblique mercator. -
longitudeOfCentre
protected final double longitudeOfCentreLongitude of the projection centre. This is NOT equal to theMapProjection.centralMeridian
, which is the meridian where the central line intersects the Earth equator on aposphere.This parameter applies to the "azimuth" case only. It is set to
NaN
for the "two points" case. -
azimuth
protected final double azimuthThe azimuth of the central line passing throught the centre of the projection, in radians. -
rectifiedGridAngle
protected final double rectifiedGridAngleThe rectified bearing of the central line, in radians. This is equals to the azimuth if the"rectified_grid_angle"
parameter value is not set.
-
-
Constructor Details
-
ObliqueMercator
Constructs a new map projection from the supplied parameters.- Parameters:
parameters
- The parameter values in standard units.- Throws:
ParameterNotFoundException
- if a mandatory parameter is missing.- Since:
- 2.4
-
-
Method Details
-
getParameterDescriptors
Returns the parameter descriptors for this map projection. This is used for a providing a default implementation ofMapProjection.getParameterValues()
, as well as arguments checking.- Specified by:
getParameterDescriptors
in classMapProjection
- Returns:
- The parameter descriptors for this math transform, or
null
. - See Also:
-
getParameterValues
Returns the parameter values for this map projection.- Overrides:
getParameterValues
in classMapProjection
- Returns:
- A copy of the parameter values for this map projection.
- See Also:
-
transformNormalized
Transforms the specified coordinate and stores the result inptDst
. This method is usually (but not guaranteed) to be invoked with values of x in the range[-PI..PI]
and values of y in the range[-PI/2..PI/2]
. Values outside those ranges are accepted (sometime with a warning logged) on the assumption that most implementations use those values only in trigonometric functions like sin and cos.Coordinates have the
MapProjection.centralMeridian
removed from lambda before this method is invoked. After this method is invoked, the results inptDst
are multiplied byMapProjection.globalScale
, and theMapProjection.falseEasting
andMapProjection.falseNorthing
are added. This means that projections that implement this method are performed on an ellipse (or sphere) with a semi-major axis of 1.In PROJ.4, the same standardization, described above, is handled by
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,MapProjection.falseEasting
,MapProjection.falseNorthing
andMapProjection.scaleFactor
are usually not given. When implementing these equations here, you will not need to remove theMapProjection.centralMeridian
from lambda or apply theMapProjection.semiMajor
(a or R).- Specified by:
transformNormalized
in classMapProjection
- Parameters:
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 transformingptSrc
, ornull
. Ordinates will be in a dimensionless unit, as a linear distance on a unit sphere or ellipse.- Returns:
- the coordinate point after transforming (
lambda
,phi
) and storing the result inptDst
. - Throws:
ProjectionException
- if the point can't be transformed.
-
inverseTransformNormalized
protected Point2D inverseTransformNormalized(double x, double y, Point2D ptDst) throws ProjectionException Transforms the specified coordinate and stores the result inptDst
. 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.Input coordinates have the
MapProjection.falseEasting
andMapProjection.falseNorthing
removed and are divided byMapProjection.globalScale
before this method is invoked. After this method is invoked, theMapProjection.centralMeridian
is added to thex
results inptDst
. This means that projections that implement this method are performed on an ellipse (or sphere) with a semi-major axis of 1.In PROJ.4, the same standardization, described above, is handled by
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,MapProjection.falseEasting
,MapProjection.falseNorthing
andMapProjection.scaleFactor
are usually not given. When implementing these equations here, you will not need to add theMapProjection.centralMeridian
to the output longitude or remove theMapProjection.semiMajor
(a or R).- Specified by:
inverseTransformNormalized
in classMapProjection
- Parameters:
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 transformingptSrc
, ornull
. Ordinates will be in radians.- Returns:
- the coordinate point after transforming
x
,y
and storing the result inptDst
. - Throws:
ProjectionException
- if the point can't be transformed.
-
getToleranceForAssertions
protected double getToleranceForAssertions(double longitude, double latitude) Maximal error (in metres) tolerated for assertion, if enabled.- Overrides:
getToleranceForAssertions
in classMapProjection
- Parameters:
longitude
- The longitude in decimal degrees.latitude
- The latitude in decimal degrees.- Returns:
- The tolerance level for assertions, in meters.
-
hashCode
public int hashCode()Returns a hash value for this projection.- Overrides:
hashCode
in classMapProjection
-
equals
Compares the specified object with this map projection for equality.- Overrides:
equals
in classMapProjection
- Parameters:
object
- The object to compare with this transform.- Returns:
true
if the given object is a transform of the same class and if, given identical source position, the transformed position would be the equals.
-