Class AbstractProj
java.lang.Object
org.openstreetmap.josm.data.projection.proj.AbstractProj
- All Implemented Interfaces:
Proj
- Direct Known Subclasses:
AlbersEqualArea,AzimuthalEquidistant,CassiniSoldner,DoubleStereographic,EquidistantCylindrical,LambertAzimuthalEqualArea,LambertConformalConic,Mercator,ObliqueMercator,PolarStereographic,Sinusoidal,SwissObliqueMercator,TransverseMercator
Abstract base class providing utilities for implementations of the Proj
interface.
This class has been derived from the implementation of the Geotools project;
git 8cbf52d, org.geotools.referencing.operation.projection.MapProjection
at the time of migration.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final doubleprivate static final doubleprivate static final doubleprivate static final doubleprivate static final doubleprivate static final doubleprivate static final doubleprivate static final doubleprivate static final doubleprivate static final doubleprivate static final doubleprivate static final doubleprotected doubleEllipsoid excentricity, equals tosqrt(.excentricity squared)protected doubleThe 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 doubleConstant needed for themlfnmethod.protected doubleConstant needed for themlfnmethod.protected doubleConstant needed for themlfnmethod.protected doubleConstant needed for themlfnmethod.protected doubleConstant needed for themlfnmethod.private static final doubleDifference allowed in iterative computations.private static final intMaximum number of iterations for iterative computations.private static final doubleRelative iteration precision used in themlfnmethodprotected booleanis ellipsoid spherical? -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final doubleaasin(double v) Tolerant asin that will just return the limits of its output range if the input is out of range(package private) final doublecphi2(double ts) voidinitialize(ProjParameters params) Initialize the projection using the provided parameters.protected final doubleinvMlfn(double arg) Calculates the latitude (phi) from a meridian distance.booleanReturn true, if a geographic coordinate reference system is represented.protected final doublemlfn(double phi, double sphi, double cphi) Calculates the meridian distance.(package private) final doublemsfn(double s, double c) Computes functionf(s,c,e²) = c/sqrt(1 - s²×e²)needed for the true scale latitude (Snyder 14-15), where s and c are the sine and cosine of the true scale latitude, and e² is the eccentricity squared.(package private) final doubletsfn(double lat, double sinlat) Computes function (15-9) and (9-13) from Snyder.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openstreetmap.josm.data.projection.proj.Proj
getAlgorithmBounds, getName, getProj4Id, invproject, lonIsLinearToEast, project
-
Field Details
-
MAXIMUM_ITERATIONS
Maximum number of iterations for iterative computations.- See Also:
-
ITERATION_TOLERANCE
Difference allowed in iterative computations.- See Also:
-
MLFN_TOL
Relative iteration precision used in themlfnmethod- See Also:
-
C00
- See Also:
-
C02
- See Also:
-
C04
- See Also:
-
C06
- See Also:
-
C08
- See Also:
-
C22
- See Also:
-
C44
- See Also:
-
C46
- See Also:
-
C48
- See Also:
-
C66
- See Also:
-
C68
- See Also:
-
C88
- See Also:
-
en0
Constant needed for themlfnmethod. Setup at construction time. -
en1
Constant needed for themlfnmethod. Setup at construction time. -
en2
Constant needed for themlfnmethod. Setup at construction time. -
en3
Constant needed for themlfnmethod. Setup at construction time. -
en4
Constant needed for themlfnmethod. Setup at construction time. -
e
Ellipsoid excentricity, equals tosqrt(. Value 0 means that the ellipsoid is spherical.excentricity squared)- See Also:
-
e2
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.- See Also:
-
spherical
is ellipsoid spherical?- See Also:
-
-
Constructor Details
-
AbstractProj
public AbstractProj()
-
-
Method Details
-
initialize
Description copied from interface:ProjInitialize the projection using the provided parameters.- Specified by:
initializein interfaceProj- Parameters:
params- The projection parameters- Throws:
ProjectionConfigurationException- in case parameters are not suitable
-
isGeographic
Description copied from interface:ProjReturn true, if a geographic coordinate reference system is represented. I.e. if it returns latitude/longitude values rather than Cartesian east/north coordinates on a flat surface.- Specified by:
isGeographicin interfaceProj- Returns:
- true, if it is geographic
-
mlfn
Calculates the meridian distance. This is the distance along the central meridian from the equator tophi. Accurate to < 1e-5 meters when used in conjunction with typical major axis values.- Parameters:
phi- latitude to calculate meridian distance for.sphi- sin(phi).cphi- cos(phi).- Returns:
- meridian distance for the given latitude.
-
invMlfn
Calculates the latitude (phi) from a meridian distance. Determines phi to TOL (1e-11) radians, about 1e-6 seconds.- Parameters:
arg- meridian distance to calculate latitude for.- Returns:
- the latitude of the meridian distance.
- Throws:
RuntimeException- if the itteration does not converge.
-
aasin
Tolerant asin that will just return the limits of its output range if the input is out of range- Parameters:
v- the value whose arc sine is to be returned.- Returns:
- the arc sine of the argument.
-
cphi2
-
msfn
Computes functionf(s,c,e²) = c/sqrt(1 - s²×e²)needed for the true scale latitude (Snyder 14-15), where s and c are the sine and cosine of the true scale latitude, and e² is the eccentricity squared.- Parameters:
s- sine of the true scale latitudec- cosine of the true scale latitude- Returns:
c/sqrt(1 - s²×e²)
-
tsfn
Computes function (15-9) and (9-13) from Snyder. Equivalent to negative of function (7-7).- Parameters:
lat- the latitudesinlat- sine of the latitude- Returns:
- auxiliary value computed from
latandsinlat
-