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
public abstract class AbstractProj extends java.lang.Object implements Proj
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
Fields Modifier and Type Field Description private static double
C00
private static double
C02
private static double
C04
private static double
C06
private static double
C08
private static double
C22
private static double
C44
private static double
C46
private static double
C48
private static double
C66
private static double
C68
private static double
C88
protected double
e
Ellipsoid excentricity, equals tosqrt(
.excentricity squared
)protected double
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.protected double
en0
Constant needed for themlfn
method.protected double
en1
Constant needed for themlfn
method.protected double
en2
Constant needed for themlfn
method.protected double
en3
Constant needed for themlfn
method.protected double
en4
Constant needed for themlfn
method.private static double
ITERATION_TOLERANCE
Difference allowed in iterative computations.private static int
MAXIMUM_ITERATIONS
Maximum number of iterations for iterative computations.private static double
MLFN_TOL
Relative iteration precision used in themlfn
methodprotected boolean
spherical
is ellipsoid spherical?
-
Constructor Summary
Constructors Constructor Description AbstractProj()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
aasin(double v)
Tolerant asin that will just return the limits of its output range if the input is out of range(package private) double
cphi2(double ts)
void
initialize(ProjParameters params)
Initialize the projection using the provided parameters.protected double
invMlfn(double arg)
Calculates the latitude (phi
) from a meridian distance.boolean
isGeographic()
Return true, if a geographic coordinate reference system is represented.protected double
mlfn(double phi, double sphi, double cphi)
Calculates the meridian distance.(package private) double
msfn(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) double
tsfn(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, wait
-
Methods inherited from interface org.openstreetmap.josm.data.projection.proj.Proj
getAlgorithmBounds, getName, getProj4Id, invproject, lonIsLinearToEast, project
-
-
-
-
Field Detail
-
MAXIMUM_ITERATIONS
private static final int MAXIMUM_ITERATIONS
Maximum number of iterations for iterative computations.- See Also:
- Constant Field Values
-
ITERATION_TOLERANCE
private static final double ITERATION_TOLERANCE
Difference allowed in iterative computations.- See Also:
- Constant Field Values
-
MLFN_TOL
private static final double MLFN_TOL
Relative iteration precision used in themlfn
method- See Also:
- Constant Field Values
-
C00
private static final double C00
- See Also:
- Constant Field Values
-
C02
private static final double C02
- See Also:
- Constant Field Values
-
C04
private static final double C04
- See Also:
- Constant Field Values
-
C06
private static final double C06
- See Also:
- Constant Field Values
-
C08
private static final double C08
- See Also:
- Constant Field Values
-
C22
private static final double C22
- See Also:
- Constant Field Values
-
C44
private static final double C44
- See Also:
- Constant Field Values
-
C46
private static final double C46
- See Also:
- Constant Field Values
-
C48
private static final double C48
- See Also:
- Constant Field Values
-
C66
private static final double C66
- See Also:
- Constant Field Values
-
C68
private static final double C68
- See Also:
- Constant Field Values
-
C88
private static final double C88
- See Also:
- Constant Field Values
-
en0
protected double en0
Constant needed for themlfn
method. Setup at construction time.
-
en1
protected double en1
Constant needed for themlfn
method. Setup at construction time.
-
en2
protected double en2
Constant needed for themlfn
method. Setup at construction time.
-
en3
protected double en3
Constant needed for themlfn
method. Setup at construction time.
-
en4
protected double en4
Constant needed for themlfn
method. Setup at construction time.
-
e
protected double e
Ellipsoid excentricity, equals tosqrt(
. Value 0 means that the ellipsoid is spherical.excentricity squared
)- See Also:
e2
-
e2
protected double 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:
e
-
spherical
protected boolean spherical
is ellipsoid spherical?- See Also:
Ellipsoid.spherical
-
-
Constructor Detail
-
AbstractProj
public AbstractProj()
-
-
Method Detail
-
initialize
public void initialize(ProjParameters params) throws ProjectionConfigurationException
Description copied from interface:Proj
Initialize the projection using the provided parameters.- Specified by:
initialize
in interfaceProj
- Parameters:
params
- The projection parameters- Throws:
ProjectionConfigurationException
- in case parameters are not suitable
-
isGeographic
public boolean isGeographic()
Description copied from interface:Proj
Return 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:
isGeographic
in interfaceProj
- Returns:
- true, if it is geographic
-
mlfn
protected final double mlfn(double phi, double sphi, double cphi)
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
protected final double invMlfn(double arg)
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:
java.lang.RuntimeException
- if the itteration does not converge.
-
aasin
protected final double aasin(double v)
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
final double cphi2(double ts)
-
msfn
final double msfn(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.- Parameters:
s
- sine of the true scale latitudec
- cosine of the true scale latitude- Returns:
c/sqrt(1 - s²×e²)
-
tsfn
final double tsfn(double lat, double sinlat)
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
lat
andsinlat
-
-