/** * Creates a transform from the specified group of parameter values. * * @param parameters The group of parameter values. * @return The created math transform. * @throws ParameterNotFoundException if a required parameter was not found. */ protected MathTransform createMathTransform(final ParameterValueGroup parameters) throws ParameterNotFoundException { return new AlbersEqualArea(parameters); } }
/** Compares the specified object with this map projection for equality. */ @Override public boolean equals(final Object object) { if (object == this) { // Slight optimization return true; } if (super.equals(object)) { final AlbersEqualArea that = (AlbersEqualArea) object; return equals(this.n, that.n) && equals(this.c, that.c) && equals(this.rho0, that.rho0) && equals(this.phi1, that.phi1) && equals(this.phi2, that.phi2); } return false; }
/** {@inheritDoc} */ @Override public ParameterValueGroup getParameterValues() { final ParameterValueGroup values = super.getParameterValues(); final Collection<GeneralParameterDescriptor> expected = getParameterDescriptors().descriptors(); set(expected, Provider.STANDARD_PARALLEL_1, values, phi1); set(expected, Provider.STANDARD_PARALLEL_2, values, phi2); return values; }
getParameterDescriptors().descriptors(); 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); ec = Double.NaN; } else { double m1 = msfn(sinphi, cosphi); double q1 = qsfn(sinphi); if (secant) { // secant cone sinphi = sin(phi2); cosphi = cos(phi2); double m2 = msfn(sinphi, cosphi); double q2 = qsfn(sinphi); n = (m1 * m1 - m2 * m2) / (q2 - q1); rho0 = sqrt(c - n * qsfn(sin(latitudeOfOrigin))) / n; ec = 1.0
/** * Transforms the specified (<var>λ</var>,<var>φ</var>) coordinates (units in * radians) and stores the result in {@code ptDst} (linear distance on a unit sphere). */ protected Point2D transformNormalized(double x, double y, Point2D ptDst) throws ProjectionException { x *= n; double rho; if (isSpherical) { rho = c - n * 2 * sin(y); } else { rho = c - n * qsfn(sin(y)); } if (rho < 0.0) { if (rho > -EPSILON) { rho = 0.0; } else { throw new ProjectionException(ErrorKeys.TOLERANCE_ERROR); } } rho = sqrt(rho) / n; y = rho0 - rho * cos(x); x = rho * sin(x); if (ptDst != null) { ptDst.setLocation(x, y); return ptDst; } return new Point2D.Double(x, y); }
y = (c - y * y) / n; if (abs(ec - abs(y)) > EPSILON) { y = phi1(y); } else { y = (y < 0.0) ? -PI / 2.0 : PI / 2.0;