Class AlbersEqualArea
- java.lang.Object
-
- org.openstreetmap.josm.data.projection.proj.AbstractProj
-
- org.openstreetmap.josm.data.projection.proj.AlbersEqualArea
-
- All Implemented Interfaces:
Proj
public class AlbersEqualArea extends AbstractProj
Albers Equal Area Projection (EPSG code 9822). This is a conic projection with parallels being unequally spaced arcs of concentric circles, more closely spaced at north and south edges of the map. Meridians are equally spaced radii of the same circles and intersect parallels at right angles. As the name implies, this projection minimizes distortion in areas.The
"standard_parallel_2"
parameter is optional and will be given the same value as"standard_parallel_1"
if not set (creating a 1 standard parallel projection).NOTE: formulae used below are from a port, to Java, of the
proj4
package of the USGS survey. USGS work is acknowledged here.This class has been derived from the implementation of the Geotools project; git 8cbf52d, org.geotools.referencing.operation.projection.AlbersEqualArea at the time of migration.
References:
- Proj-4.4.7 available at www.remotesensing.org/proj
Relevant files are: PJ_aea.c, pj_fwd.c and pj_inv.c - John P. Snyder (Map Projections - A Working Manual, U.S. Geological Survey Professional Paper 1395, 1987)
- "Coordinate Conversions and Transformations including Formulas", EPSG Guidance Note Number 7, Version 19.
-
-
Field Summary
Fields Modifier and Type Field Description private double
c
Constants used by the spherical and elliptical Albers projection.private double
ec
An error condition indicating iteration will not converge for the inverse ellipse.private static double
EPSILON
Maximum difference allowed when comparing real numbers.private static double
ITERATION_TOLERANCE
Difference allowed in iterative computations.private static int
MAXIMUM_ITERATIONS
Maximum number of iterations for iterative computations.private double
n
Constants used by the spherical and elliptical Albers projection.private double
n2
Constants used by the spherical and elliptical Albers projection.private double
rho0
Constants used by the spherical and elliptical Albers projection.
-
Constructor Summary
Constructors Constructor Description AlbersEqualArea()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bounds
getAlgorithmBounds()
Return the bounds where this projection is applicable.String
getName()
Replies a human readable name of this projection.String
getProj4Id()
Replies the Proj.4 identifier.void
initialize(ProjParameters params)
Initialize the projection using the provided parameters.double[]
invproject(double x, double y)
Convert east/north to lat/lon.double
phi1(double qs)
Iteratively solves equation (3-16) from Snyder.double[]
project(double y, double x)
Convert lat/lon to east/north.private double
qsfn(double sinphi)
Calculates q, Snyder equation (3-12)-
Methods inherited from class org.openstreetmap.josm.data.projection.proj.AbstractProj
aasin, cphi2, invMlfn, isGeographic, mlfn, msfn, tsfn
-
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
lonIsLinearToEast
-
-
-
-
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
-
EPSILON
private static final double EPSILON
Maximum difference allowed when comparing real numbers.- See Also:
- Constant Field Values
-
n
private double n
Constants used by the spherical and elliptical Albers projection.
-
n2
private double n2
Constants used by the spherical and elliptical Albers projection.
-
c
private double c
Constants used by the spherical and elliptical Albers projection.
-
rho0
private double rho0
Constants used by the spherical and elliptical Albers projection.
-
ec
private double ec
An error condition indicating iteration will not converge for the inverse ellipse. See Snyder (14-20)
-
-
Constructor Detail
-
AlbersEqualArea
public AlbersEqualArea()
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:Proj
Replies a human readable name of this projection.- Returns:
- The projection name. must not be null.
-
getProj4Id
public String getProj4Id()
Description copied from interface:Proj
Replies the Proj.4 identifier.- Returns:
- The Proj.4 identifier (as reported by cs2cs -lp).
If no id exists, return
null
.
-
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
- Overrides:
initialize
in classAbstractProj
- Parameters:
params
- The projection parameters- Throws:
ProjectionConfigurationException
- in case parameters are not suitable
-
project
public double[] project(double y, double x)
Description copied from interface:Proj
Convert lat/lon to east/north.- Parameters:
y
- the latitude in radiansx
- the longitude in radians- Returns:
- array of length 2, containing east and north value in meters, divided by the semi major axis of the ellipsoid.
-
invproject
public double[] invproject(double x, double y)
Description copied from interface:Proj
Convert east/north to lat/lon.- Parameters:
x
- east value in meters, divided by the semi major axis of the ellipsoidy
- north value in meters, divided by the semi major axis of the ellipsoid- Returns:
- array of length 2, containing lat and lon in radians.
-
phi1
public double phi1(double qs)
Iteratively solves equation (3-16) from Snyder.- Parameters:
qs
- arcsin(q/2), used in the first step of iteration- Returns:
- the latitude
-
qsfn
private double qsfn(double sinphi)
Calculates q, Snyder equation (3-12)- Parameters:
sinphi
- sin of the latitude q is calculated for- Returns:
- q from Snyder equation (3-12)
-
getAlgorithmBounds
public Bounds getAlgorithmBounds()
Description copied from interface:Proj
Return the bounds where this projection is applicable. This is a fallback for when the projection bounds are not specified explicitly. In this area, the round trip lat/lon -> east/north -> lat/lon should return the starting value with small error. In addition, regions with extreme distortions should be excluded, if possible. It need not be the absolute maximum, but rather an area that is safe to display in JOSM and contain everything that one would expect to use.- Returns:
- the bounds where this projection is applicable, null if unknown
-
-