This projection is rewritten from scratch using the formulas published in EPSG guidance notes.
Command line:
svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r9355:10796 https://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/AlbersEqualArea.java
Revision 9355 | Revision 10796 |
---|---|
package org.geotools.referencing.operation.projection; // J2SE dependencies and extensions import java.util.Collection; import java.awt.geom.Point2D; import javax.units.NonSI; // OpenGIS dependencies import org.opengis.parameter.ParameterDescriptor; import org.opengis.parameter.ParameterValueGroup; import org.opengis.parameter.ParameterDescriptorGroup; import org.opengis.parameter.ParameterNotFoundException; import org.opengis.referencing.operation.MathTransform; // Geotools dependencies import org.geotools.measure.Latitude; import org.geotools.referencing.Identifier; import org.geotools.metadata.citation.Citation; import org.geotools.resources.cts.ResourceKeys; import org.geotools.resources.cts.Resources; /** * Albers Equal Area Projection (EPSG code 9822). This is a conic projection * with parallels being unequally spaced arcs of concentric circles, more |
package org.geotools.referencing.operation.projection; // J2SE dependencies and extensions import java.awt.geom.Point2D; import java.util.Collection; import javax.units.NonSI; import org.geotools.measure.Latitude; import org.geotools.metadata.citation.Citation; import org.geotools.referencing.Identifier; import org.geotools.resources.cts.ResourceKeys; import org.geotools.resources.cts.Resources; import org.opengis.parameter.ParameterDescriptor; import org.opengis.parameter.ParameterDescriptorGroup; import org.opengis.parameter.ParameterNotFoundException; import org.opengis.parameter.ParameterValueGroup; import org.opengis.referencing.operation.MathTransform; /** * Albers Equal Area Projection (EPSG code 9822). This is a conic projection * with parallels being unequally spaced arcs of concentric circles, more |
* angles. As the name implies, this projection minimizes distortion in areas. * <br><br> * * NOTE: formulae used below are from a port, to java, of the * 'proj4' package of the USGS survey. USGS work is acknowledged here. * <br><br> |
* angles. As the name implies, this projection minimizes distortion in areas. * <br><br> * * 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). * <br><br> * * NOTE: formulae used below are from a port, to java, of the * 'proj4' package of the USGS survey. USGS work is acknowledged here. * <br><br> |
private final double ec; /** * Standards parallels in radians, for {@link #getParameterValues} implementation. */ private final double phi1, phi2; /** * The {@link org.geotools.referencing.operation.MathTransformProvider} |
private final double ec; /** * Standards parallel 1 in radians, for {@link #getParameterValues} implementation. */ private final double phi1; /** * Standards parallel 2 in radians, for {@link #getParameterValues} implementation. */ private double phi2; /** * The {@link org.geotools.referencing.operation.MathTransformProvider} |
/**
* The operation parameter descriptor for the {@link #phi1 standard parallel 1}
* parameter value. Valid values range is from -90 to 90°. Default value is 0.
*/
public static final ParameterDescriptor STANDARD_PARALLEL_1 = createDescriptor(
new Identifier[] { |
/**
* The operation parameter descriptor for the {@link #phi1 standard parallel 1}
* parameter value. Valid values range is from -90 to 90�. Default value is 0.
*/
public static final ParameterDescriptor STANDARD_PARALLEL_1 = createDescriptor(
new Identifier[] { |
/**
* The operation parameter descriptor for the {@link #phi2 standard parallel 2}
* parameter value. Valid values range is from -90 to 90°. Default value is 0.
*/
public static final ParameterDescriptor STANDARD_PARALLEL_2 = createDescriptor(
new Identifier[] { |
/**
* The operation parameter descriptor for the {@link #phi2 standard parallel 2}
* parameter value. Valid values range is from -90 to 90�. Default value is 0.
*/
public static final ParameterDescriptor STANDARD_PARALLEL_2 = createDescriptor(
new Identifier[] { |
new Identifier(Citation.EPSG, "Latitude of 2nd standard parallel"),
new Identifier(Citation.GEOTIFF, "StdParallel2")
},
0, -90, 90, NonSI.DEGREE_ANGLE);
/**
* The parameters group. |
new Identifier(Citation.EPSG, "Latitude of 2nd standard parallel"),
new Identifier(Citation.GEOTIFF, "StdParallel2")
},
Double.NaN, -90, 90, NonSI.DEGREE_ANGLE);
/**
* The parameters group. |
* @param parameters The parameter values in standard units. * @param expected The expected parameter descriptors. * @throws ParameterNotFoundException if a mandatory parameter is missing. * * @task REVISIT: set phi2 = phi1 if no SP2 param is given by user (a 1sp projection) */ public AlbersEqualArea(final ParameterValueGroup parameters, final Collection expected) { //Fetch parameters super(parameters, expected); phi1 = doubleValue(expected, Provider.STANDARD_PARALLEL_1, parameters); phi2 = doubleValue(expected, Provider.STANDARD_PARALLEL_2, parameters); //Compute Constants if (Math.abs(phi1 + phi2) < EPS) |
* @param parameters The parameter values in standard units. * @param expected The expected parameter descriptors. * @throws ParameterNotFoundException if a mandatory parameter is missing. */ AlbersEqualArea(final ParameterValueGroup parameters, final Collection expected) throws ParameterNotFoundException { //Fetch parameters super(parameters, expected); phi1 = doubleValue(expected, Provider.STANDARD_PARALLEL_1, parameters); ensureLatitudeInRange(Provider.STANDARD_PARALLEL_1, phi1, true); phi2 = doubleValue(expected, Provider.STANDARD_PARALLEL_2, parameters); if (Double.isNaN(phi2)) { phi2 = phi1; } ensureLatitudeInRange(Provider.STANDARD_PARALLEL_2, phi2, true); //Compute Constants if (Math.abs(phi1 + phi2) < EPS) |