Added: sis/ip-review/rev/09359/PolarStereographic.xhtml URL: http://svn.apache.org/viewvc/sis/ip-review/rev/09359/PolarStereographic.xhtml?rev=1709620&view=auto ============================================================================== --- sis/ip-review/rev/09359/PolarStereographic.xhtml (added) +++ sis/ip-review/rev/09359/PolarStereographic.xhtml Tue Oct 20 15:01:18 2015 @@ -0,0 +1,504 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta charset="UTF-8"/> + <title>PolarStereographic changes for revisions 9358:9359</title> + <style type="text/css" media="all"> + @import url("../../reports.css"); + </style> + </head> + <body> + <div> + <h1>PolarStereographic changes for revisions 9358:9359</h1> + + <p>We did not used this code for the port to Apache SIS. Instead, we rewrote the projection + using the formulas given in the EPSG guide.</p> + +<p><b>Command line:</b></p> +<blockquote><code>svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r9358:9359 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/PolarStereographic.java</code></blockquote> +<table class="changes"> +<tr><th>Revision 9358</th><th>Revision 9359</th></tr> +<tr><td><pre></pre></td> +<td><pre><span class="add">/*</span> +<span class="add"> * Geotools - OpenSource mapping toolkit</span> +<span class="add"> * (C) 2003, 2004, Geotools Project Managment Committee (PMC)</span> +<span class="add"> * (C) 2001, Institut de Recherche pour le Développement</span> +<span class="add"> * (C) 1999, Fisheries and Oceans Canada</span> +<span class="add"> *</span> +<span class="add"> * This library is free software; you can redistribute it and/or</span> +<span class="add"> * modify it under the terms of the GNU Lesser General Public</span> +<span class="add"> * License as published by the Free Software Foundation; either</span> +<span class="add"> * version 2.1 of the License, or (at your option) any later version.</span> +<span class="add"> *</span> +<span class="add"> * This library is distributed in the hope that it will be useful,</span> +<span class="add"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span> +<span class="add"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> +<span class="add"> * Lesser General Public License for more details.</span> +<span class="add"> *</span> +<span class="add"> * You should have received a copy of the GNU Lesser General Public</span> +<span class="add"> * License along with this library; if not, write to the Free Software</span> +<span class="add"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span> +<span class="add"> *</span> +<span class="add"> *</span> +<span class="add"> * This package contains formulas from the PROJ package of USGS.</span> +<span class="add"> * USGS's work is fully acknowledged here.</span> +<span class="add"> */</span> +<span class="add">/*</span> +<span class="add"> * Some parts Copyright (c) 2000, Frank Warmerdam</span> +<span class="add"> *</span> +<span class="add"> * Permission is hereby granted, free of charge, to any person obtaining a</span> +<span class="add"> * copy of this software and associated documentation files (the "Software"),</span> +<span class="add"> * to deal in the Software without restriction, including without limitation</span> +<span class="add"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span> +<span class="add"> * and/or sell copies of the Software, and to permit persons to whom the</span> +<span class="add"> * Software is furnished to do so, subject to the following conditions:</span> +<span class="add"> *</span> +<span class="add"> * The above copyright notice and this permission notice shall be included</span> +<span class="add"> * in all copies or substantial portions of the Software.</span> +<span class="add"> *</span> +<span class="add"> * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS</span> +<span class="add"> * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span> +<span class="add"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL</span> +<span class="add"> * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span> +<span class="add"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span> +<span class="add"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span> +<span class="add"> * DEALINGS IN THE SOFTWARE.</span> +<span class="add"> */</span> +<span class="add">package org.geotools.referencing.operation.projection;</span> +<span class="add"></span> +<span class="add">// J2SE dependencies and extensions</span> +<span class="add">import java.util.Collection;</span> +<span class="add">import java.awt.geom.Point2D;</span> +<span class="add"></span> +<span class="add">// OpenGIS dependencies</span> +<span class="add">import org.opengis.parameter.ParameterValueGroup;</span> +<span class="add">import org.opengis.parameter.ParameterNotFoundException;</span> +<span class="add"></span> +<span class="add">// Geotools dependencies</span> +<span class="add">import org.geotools.resources.cts.ResourceKeys;</span> +<span class="add">import org.geotools.resources.cts.Resources;</span> +<span class="add"></span> +<span class="add">/**</span> +<span class="add"> * The polar case of the {@linkplain Stereographic stereographic} projection.</span> +<span class="add"> * This default implementation uses USGS equation (i.e. iteration) for computing</span> +<span class="add"> * the {@linkplain #inverseTransformNormalized inverse transform}.</span> +<span class="add"> *</span> +<span class="add"> * @version $Id$</span> +<span class="add"> * @author André Gosselin</span> +<span class="add"> * @author Martin Desruisseaux</span> +<span class="add"> * @author Rueben Schulz</span> +<span class="add"> */</span> +<span class="add">public class StereographicPolar extends Stereographic {</span> +<span class="add"> /**</span> +<span class="add"> * A constant used in the transformations.</span> +<span class="add"> * This is <strong>not</strong> equal to the {@link #scaleFactor}.</span> +<span class="add"> */</span> +<span class="add"> private final double k0;</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Latitude of true scale, in radians (a.k.a. standard_parallel_1).</span> +<span class="add"> */</span> +<span class="add"> protected double latitudeTrueScale;</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * <code>true</code> if this projection is for the south pole, or <code>false</code></span> +<span class="add"> * if it is for the north pole.</span> +<span class="add"> */</span> +<span class="add"> protected final boolean southPole;</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Construct a polar stereographic projection.</span> +<span class="add"> *</span> +<span class="add"> * @param parameters The group of parameter values.</span> +<span class="add"> * @param expected The expected parameter descriptors.</span> +<span class="add"> * @param latitudeOfOrigin The latitude of origin in radians. If not Double.NaN</span> +<span class="add"> * it overrides the latitude of origin parameter.</span> +<span class="add"> * @param stereoType The type of stereographic projection (used for</span> +<span class="add"> * creating wkt).</span> +<span class="add"> * @return The created math transform.</span> +<span class="add"> * @throws ParameterNotFoundException if a required parameter was not found.</span> +<span class="add"> */</span> +<span class="add"> protected StereographicPolar(final ParameterValueGroup parameters, final Collection expected,</span> +<span class="add"> final double latitudeOfOrigin, final short stereoType)</span> +<span class="add"> throws ParameterNotFoundException</span> +<span class="add"> {</span> +<span class="add"> super(parameters, expected);</span> +<span class="add"> this.stereoType = stereoType;</span> +<span class="add"></span> +<span class="add"> //over-ride the latitude of origin parameter</span> +<span class="add"> if (!Double.isNaN(latitudeOfOrigin)) {</span> +<span class="add"> this.latitudeOfOrigin = latitudeOfOrigin;</span> +<span class="add"> }</span> +<span class="add"> southPole = (this.latitudeOfOrigin < 0);</span> +<span class="add"> this.latitudeOfOrigin = (southPole) ? -(Math.PI/2) : +(Math.PI/2);</span> +<span class="add"></span> +<span class="add"> //get standard_parallel_1 parameter value</span> +<span class="add"> latitudeTrueScale = doubleValue(expected, Provider_Polar_B.LATITUDE_TRUE_SCALE, parameters);</span> +<span class="add"> if (Double.isNaN(latitudeTrueScale)) {</span> +<span class="add"> latitudeTrueScale = latitudeOfOrigin;</span> +<span class="add"> }</span> +<span class="add"> ensureLatitudeInRange(Provider_Polar_B.LATITUDE_TRUE_SCALE, latitudeTrueScale, true);</span> +<span class="add"></span> +<span class="add"> if (Math.abs(Math.abs(latitudeTrueScale)-(Math.PI/2)) >= EPS) {</span> +<span class="add"> final double latTrueScale = (southPole) ? -latitudeTrueScale : latitudeTrueScale;</span> +<span class="add"> final double t = Math.sin(latTrueScale);</span> +<span class="add"> k0 = msfn(t ,Math.cos(latTrueScale)) /</span> +<span class="add"> tsfn(latTrueScale, t); //derives from (21-32 and 21-33)</span> +<span class="add"> } else {</span> +<span class="add"> // True scale at pole (part of (21-33))</span> +<span class="add"> k0 = 2.0 / Math.sqrt(Math.pow(1+excentricity, 1+excentricity)*</span> +<span class="add"> Math.pow(1-excentricity, 1-excentricity));</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Transforms the specified (<var>x</var>,<var>y</var>) coordinate (units in radians)</span> +<span class="add"> * and stores the result in <code>ptDst</code> (linear distance on a unit sphere).</span> +<span class="add"> */</span> +<span class="add"> protected Point2D transformNormalized(double x, double y, Point2D ptDst)</span> +<span class="add"> throws ProjectionException</span> +<span class="add"> {</span> +<span class="add"> final double sinlat = Math.sin(y);</span> +<span class="add"> final double coslon = Math.cos(x);</span> +<span class="add"> final double sinlon = Math.sin(x);</span> +<span class="add"> if (southPole) {</span> +<span class="add"> final double rho = k0 * tsfn(-y, -sinlat);</span> +<span class="add"> x = rho * sinlon;</span> +<span class="add"> y = rho * coslon;</span> +<span class="add"> } else {</span> +<span class="add"> final double rho = k0 * tsfn(y, sinlat);</span> +<span class="add"> x = rho * sinlon;</span> +<span class="add"> y = -rho * coslon;</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> if (ptDst != null) {</span> +<span class="add"> ptDst.setLocation(x,y);</span> +<span class="add"> return ptDst;</span> +<span class="add"> }</span> +<span class="add"> return new Point2D.Double(x,y);</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Transforms the specified (<var>x</var>,<var>y</var>) coordinate (units in radians)</span> +<span class="add"> * and stores the result in <code>ptDst</code> (linear distance on a unit sphere).</span> +<span class="add"> */</span> +<span class="add"> protected Point2D inverseTransformNormalized(double x, double y, Point2D ptDst)</span> +<span class="add"> throws ProjectionException</span> +<span class="add"> {</span> +<span class="add"> final double rho = Math.sqrt(x*x + y*y);</span> +<span class="add"> if (southPole) {</span> +<span class="add"> y = -y;</span> +<span class="add"> }</span> +<span class="add"> /*</span> +<span class="add"> * Compute latitude using iterative technique.</span> +<span class="add"> */</span> +<span class="add"> final double t = rho/k0;</span> +<span class="add"> final double halfe = excentricity/2.0;</span> +<span class="add"> double phi0 = 0;</span> +<span class="add"> for (int i=MAX_ITER;;) {</span> +<span class="add"> final double esinphi = excentricity * Math.sin(phi0);</span> +<span class="add"> final double phi = (Math.PI/2) -</span> +<span class="add"> 2.0*Math.atan(t*Math.pow((1-esinphi)/(1+esinphi), halfe));</span> +<span class="add"> if (Math.abs(phi-phi0) < TOL) {</span> +<span class="add"> x = (Math.abs(rho)<EPS) ?</span> +<span class="add"> 0.0 : Math.atan2(x, -y);</span> +<span class="add"> y = (southPole) ? -phi : phi;</span> +<span class="add"> break;</span> +<span class="add"> }</span> +<span class="add"> phi0 = phi;</span> +<span class="add"> if (--i < 0) {</span> +<span class="add"> throw new ProjectionException(Resources.format(ResourceKeys.ERROR_NO_CONVERGENCE));</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> if (ptDst != null) {</span> +<span class="add"> ptDst.setLocation(x,y);</span> +<span class="add"> return ptDst;</span> +<span class="add"> }</span> +<span class="add"> return new Point2D.Double(x,y);</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * {@inheritDoc}</span> +<span class="add"> */</span> +<span class="add"> public ParameterValueGroup getParameterValues() {</span> +<span class="add"> final ParameterValueGroup values = super.getParameterValues();</span> +<span class="add"> switch (stereoType) {</span> +<span class="add"> case POLAR_B:</span> +<span class="add"> case POLAR_NORTH:</span> +<span class="add"> case POLAR_SOUTH: {</span> +<span class="add"> final Collection expected = getParameterDescriptors().descriptors();</span> +<span class="add"> set(expected, Provider_Polar_B.LATITUDE_TRUE_SCALE, values, latitudeTrueScale);</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add"> return values;</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Returns a hash value for this map projection.</span> +<span class="add"> */</span> +<span class="add"> public int hashCode() {</span> +<span class="add"> final long code = Double.doubleToLongBits(k0);</span> +<span class="add"> return ((int)code ^ (int)(code >>> 32)) + 37*super.hashCode();</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Compares the specified object with this map projection for equality.</span> +<span class="add"> */</span> +<span class="add"> public boolean equals(final Object object) {</span> +<span class="add"> if (object == this) {</span> +<span class="add"> // Slight optimization</span> +<span class="add"> return true;</span> +<span class="add"> }</span> +<span class="add"> if (super.equals(object)) {</span> +<span class="add"> final StereographicPolar that = (StereographicPolar) object;</span> +<span class="add"> return this.southPole == that.southPole &&</span> +<span class="add"> equals(this.k0, that.k0) &&</span> +<span class="add"> equals(this.latitudeTrueScale, that.latitudeTrueScale);</span> +<span class="add"> }</span> +<span class="add"> return false;</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Provides the transform equations for the spherical case of the polar</span> +<span class="add"> * stereographic projection.</span> +<span class="add"> *</span> +<span class="add"> * @version $Id$</span> +<span class="add"> * @author Martin Desruisseaux</span> +<span class="add"> * @author Rueben Schulz</span> +<span class="add"> */</span> +<span class="add"> static final class Spherical extends StereographicPolar {</span> +<span class="add"> /**</span> +<span class="add"> * A constant used in the transformations. This constant hides the <code>k0</code></span> +<span class="add"> * constant from the ellipsoidal case. The spherical and ellipsoidal <code>k0</code></span> +<span class="add"> * are not computed in the same way, and we preserve the ellipsoidal <code>k0</code></span> +<span class="add"> * in {@link Stereographic} in order to allow assertions to work.</span> +<span class="add"> */</span> +<span class="add"> private final double k0;</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Construct a spherical stereographic projection.</span> +<span class="add"> *</span> +<span class="add"> * @param parameters The group of parameter values.</span> +<span class="add"> * @param expected The expected parameter descriptors.</span> +<span class="add"> * @param latitudeOfOrigin The latitude of origin in radians. If not Double.NaN</span> +<span class="add"> * it overrides the latitude of origin parameter.</span> +<span class="add"> * @param stereoType The type of stereographic projection (used for</span> +<span class="add"> * creating wkt).</span> +<span class="add"> * @return The created math transform.</span> +<span class="add"> * @throws ParameterNotFoundException if a required parameter was not found.</span> +<span class="add"> */</span> +<span class="add"> protected Spherical(final ParameterValueGroup parameters, final Collection expected,</span> +<span class="add"> final double latitudeOfOrigin, final short stereoType)</span> +<span class="add"> throws ParameterNotFoundException</span> +<span class="add"> {</span> +<span class="add"> super(parameters, expected, latitudeOfOrigin, stereoType);</span> +<span class="add"> assert isSpherical;</span> +<span class="add"> if (Math.abs(Math.abs(latitudeTrueScale) - (Math.PI/2)) >= EPS) {</span> +<span class="add"> if (southPole) {</span> +<span class="add"> k0 = 1 - Math.sin(latitudeTrueScale); //derived from (21-11)</span> +<span class="add"> } else {</span> +<span class="add"> k0 = 1 + Math.sin(latitudeTrueScale); //derived from (21-7)</span> +<span class="add"> }</span> +<span class="add"> } else {</span> +<span class="add"> k0 = 2;</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Transforms the specified (<var>x</var>,<var>y</var>) coordinate (units in radians)</span> +<span class="add"> * and stores the result in <code>ptDst</code> (linear distance on a unit sphere).</span> +<span class="add"> */</span> +<span class="add"> protected Point2D transformNormalized(double x, double y, Point2D ptDst)</span> +<span class="add"> throws ProjectionException</span> +<span class="add"> {</span> +<span class="add"> //Compute using ellipsoidal formulas, for comparaison later.</span> +<span class="add"> assert (ptDst = super.transformNormalized(x, y, ptDst)) != null;</span> +<span class="add"></span> +<span class="add"> final double coslat = Math.cos(y);</span> +<span class="add"> final double sinlat = Math.sin(y);</span> +<span class="add"> final double coslon = Math.cos(x);</span> +<span class="add"> final double sinlon = Math.sin(x);</span> +<span class="add"></span> +<span class="add"> if (southPole) {</span> +<span class="add"> if (Math.abs(1-sinlat) < EPS) {</span> +<span class="add"> throw new ProjectionException(Resources.format(</span> +<span class="add"> ResourceKeys.ERROR_VALUE_TEND_TOWARD_INFINITY));</span> +<span class="add"> }</span> +<span class="add"> // (21-12)</span> +<span class="add"> final double f = k0 * coslat / (1-sinlat); // == tan (pi/4 + phi/2)</span> +<span class="add"> x = f * sinlon; // (21-9)</span> +<span class="add"> y = f * coslon; // (21-10)</span> +<span class="add"> } else {</span> +<span class="add"> if (Math.abs(1+sinlat) < EPS) {</span> +<span class="add"> throw new ProjectionException(Resources.format(</span> +<span class="add"> ResourceKeys.ERROR_VALUE_TEND_TOWARD_INFINITY));</span> +<span class="add"> }</span> +<span class="add"> // (21-8)</span> +<span class="add"> final double f = k0 * coslat / (1+sinlat); // == tan (pi/4 - phi/2)</span> +<span class="add"> x = f * sinlon; // (21-5)</span> +<span class="add"> y = -f * coslon; // (21-6)</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> assert Math.abs(ptDst.getX()-x) <= EPS*globalScale : x;</span> +<span class="add"> assert Math.abs(ptDst.getY()-y) <= EPS*globalScale : y;</span> +<span class="add"> if (ptDst != null) {</span> +<span class="add"> ptDst.setLocation(x,y);</span> +<span class="add"> return ptDst;</span> +<span class="add"> }</span> +<span class="add"> return new Point2D.Double(x,y);</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Transforms the specified (<var>x</var>,<var>y</var>) coordinate (units in radians)</span> +<span class="add"> * and stores the result in <code>ptDst</code> (linear distance on a unit sphere).</span> +<span class="add"> */</span> +<span class="add"> protected Point2D inverseTransformNormalized(double x, double y, Point2D ptDst)</span> +<span class="add"> throws ProjectionException</span> +<span class="add"> {</span> +<span class="add"> // Compute using ellipsoidal formulas, for comparaison later.</span> +<span class="add"> assert (ptDst = super.inverseTransformNormalized(x, y, ptDst)) != null;</span> +<span class="add"></span> +<span class="add"> final double rho = Math.sqrt(x*x + y*y);</span> +<span class="add"></span> +<span class="add"> if (!southPole) {</span> +<span class="add"> y = -y;</span> +<span class="add"> }</span> +<span class="add"> // (20-17) call atan2(x,y) to properly deal with y==0</span> +<span class="add"> x = (Math.abs(x)<EPS && Math.abs(y)<EPS) ? 0.0 : Math.atan2(x, y);</span> +<span class="add"> if (Math.abs(rho) < EPS) {</span> +<span class="add"> y = latitudeOfOrigin;</span> +<span class="add"> } else {</span> +<span class="add"> final double c = 2.0 * Math.atan(rho/k0);</span> +<span class="add"> final double cosc = Math.cos(c);</span> +<span class="add"> y = (southPole) ? Math.asin(-cosc) : Math.asin(cosc);</span> +<span class="add"> // (20-14) with phi1=90</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> assert Math.abs(ptDst.getX()-x) <= EPS : x;</span> +<span class="add"> assert Math.abs(ptDst.getY()-y) <= EPS : y;</span> +<span class="add"> if (ptDst != null) {</span> +<span class="add"> ptDst.setLocation(x,y);</span> +<span class="add"> return ptDst;</span> +<span class="add"> }</span> +<span class="add"> return new Point2D.Double(x,y);</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Overides {@link PolarStereographic} to use the a series for the</span> +<span class="add"> * {@link #inverseTransformNormalized inverseTransformNormalized(...)}</span> +<span class="add"> * method. This is the equation specified by the EPSG. Allows for a</span> +<span class="add"> * <code>"latitude_true_scale"<code> parameter to be used, but this</span> +<span class="add"> * parameter is not listed by the EPSG and is not given as a parameter</span> +<span class="add"> * by the provider.</span> +<span class="add"> * <br><br></span> +<span class="add"> * Compared to the default {@link PolarStereographic} implementation, the series</span> +<span class="add"> * implementation is a little bit faster at the expense of a little bit less</span> +<span class="add"> * accuracy. The default {@link PolarStereographic} implementation implementation</span> +<span class="add"> * is an derivated work of Proj4, and is therefor better tested.</span> +<span class="add"> *</span> +<span class="add"> * @version $Id$</span> +<span class="add"> * @author Rueben Schulz</span> +<span class="add"> */</span> +<span class="add"> static final class Series extends StereographicPolar {</span> +<span class="add"> /**</span> +<span class="add"> * Constants used for the inverse polar series</span> +<span class="add"> */</span> +<span class="add"> private final double A, B;</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Constants used for the inverse polar series</span> +<span class="add"> */</span> +<span class="add"> private double C, D;</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * A constant used in the transformations. This constant hides the <code>k0</code></span> +<span class="add"> * constant from the USGS case. The EPSG and USGS <code>k0</code> are not computed</span> +<span class="add"> * in the same way, and we preserve the USGS <code>k0</code> in order to allow</span> +<span class="add"> * assertions to work.</span> +<span class="add"> */</span> +<span class="add"> private final double k0;</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Construct a polar stereographic projection (seires inverse equations).</span> +<span class="add"> *</span> +<span class="add"> * @param parameters The group of parameter values.</span> +<span class="add"> * @param expected The expected parameter descriptors.</span> +<span class="add"> * @param latitudeOfOrigin The latitude of origin in radians. If not Double.NaN</span> +<span class="add"> * it overrides the latitude of origin parameter.</span> +<span class="add"> * @param stereoType The type of stereographic projection (used for</span> +<span class="add"> * creating wkt).</span> +<span class="add"> * @return The created math transform.</span> +<span class="add"> * @throws ParameterNotFoundException if a required parameter was not found.</span> +<span class="add"> */</span> +<span class="add"> protected Series(final ParameterValueGroup parameters, final Collection expected,</span> +<span class="add"> final double latitudeOfOrigin, final short stereoType)</span> +<span class="add"> throws ParameterNotFoundException</span> +<span class="add"> {</span> +<span class="add"> super(parameters, expected, latitudeOfOrigin, stereoType);</span> +<span class="add"> //See Snyde P. 19, "Computation of Series"</span> +<span class="add"> final double e4 = excentricitySquared*excentricitySquared;</span> +<span class="add"> final double e6 = excentricitySquared*excentricitySquared*excentricitySquared;</span> +<span class="add"> final double e8 = excentricitySquared*excentricitySquared*excentricitySquared*excentricitySquared;</span> +<span class="add"> C = 7.0*e6/120.0 + 81.0*e8/1120.0;</span> +<span class="add"> D = 4279.0*e8/161280.0;</span> +<span class="add"> A = excentricitySquared/2.0 + 5.0*e4/24.0 + e6/12.0 + 13.0*e8/360.0 - C;</span> +<span class="add"> B = 2.0*(7.0*e4/48.0 + 29.0*e6/240.0 + 811.0*e8/11520.0) - 4.0*D;</span> +<span class="add"> C *= 4.0;</span> +<span class="add"> D *= 8.0;</span> +<span class="add"></span> +<span class="add"> if (Math.abs(Math.abs(latitudeTrueScale)-(Math.PI/2)) >= EPS) {</span> +<span class="add"> final double latTrueScale = (southPole) ? -latitudeTrueScale : latitudeTrueScale;</span> +<span class="add"> final double t = Math.sin(latTrueScale);</span> +<span class="add"> k0 = msfn(t, Math.cos(latTrueScale)) *</span> +<span class="add"> Math.sqrt(Math.pow(1+excentricity, 1+excentricity)*</span> +<span class="add"> Math.pow(1-excentricity, 1-excentricity)) /</span> +<span class="add"> (2.0*tsfn(latTrueScale, t));</span> +<span class="add"> } else {</span> +<span class="add"> k0 = 1.0;</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Transforms the specified (<var>x</var>,<var>y</var>) coordinate</span> +<span class="add"> * and stores the result in <code>ptDst</code>.</span> +<span class="add"> */</span> +<span class="add"> protected Point2D inverseTransformNormalized(double x, double y, Point2D ptDst)</span> +<span class="add"> throws ProjectionException</span> +<span class="add"> {</span> +<span class="add"> // Compute using itteration formulas, for comparaison later.</span> +<span class="add"> assert (ptDst = super.inverseTransformNormalized(x, y, ptDst)) != null;</span> +<span class="add"></span> +<span class="add"> final double rho = Math.sqrt(x*x + y*y);</span> +<span class="add"> if (southPole) {</span> +<span class="add"> y = -y;</span> +<span class="add"> }</span> +<span class="add"> // The series form</span> +<span class="add"> final double t = (rho/k0) * Math.sqrt(Math.pow(1+excentricity, 1+excentricity)*</span> +<span class="add"> Math.pow(1-excentricity, 1-excentricity)) / 2;</span> +<span class="add"> final double chi = Math.PI/2 - 2*Math.atan(t);</span> +<span class="add"></span> +<span class="add"> x = (Math.abs(rho)<EPS) ? 0.0 : Math.atan2(x, -y);</span> +<span class="add"></span> +<span class="add"> //See Snyde P. 19, "Computation of Series"</span> +<span class="add"> final double sin2chi = Math.sin(2.0*chi);</span> +<span class="add"> final double cos2chi = Math.cos(2.0*chi);</span> +<span class="add"> y = chi + sin2chi*(A + cos2chi*(B + cos2chi*(C + D*cos2chi)));</span> +<span class="add"> y = (southPole) ? -y : y;</span> +<span class="add"></span> +<span class="add"> assert Math.abs(ptDst.getX()-x) <= EPS : x;</span> +<span class="add"> assert Math.abs(ptDst.getY()-y) <= EPS : y;</span> +<span class="add"> if (ptDst != null) {</span> +<span class="add"> ptDst.setLocation(x,y);</span> +<span class="add"> return ptDst;</span> +<span class="add"> }</span> +<span class="add"> return new Point2D.Double(x,y);</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add">}</span></pre></td></tr> +</table> + </div> + </body> +</html>
Propchange: sis/ip-review/rev/09359/PolarStereographic.xhtml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: sis/ip-review/rev/09359/PolarStereographic.xhtml ------------------------------------------------------------------------------ svn:mime-type = text/html Added: sis/ip-review/rev/10796/EquatorialStereographic.xhtml URL: http://svn.apache.org/viewvc/sis/ip-review/rev/10796/EquatorialStereographic.xhtml?rev=1709620&view=auto ============================================================================== --- sis/ip-review/rev/10796/EquatorialStereographic.xhtml (added) +++ sis/ip-review/rev/10796/EquatorialStereographic.xhtml Tue Oct 20 15:01:18 2015 @@ -0,0 +1,81 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta charset="UTF-8"/> + <title>EquatorialStereographic changes for revisions 10795:10796</title> + <style type="text/css" media="all"> + @import url("../../reports.css"); + </style> + </head> + <body> + <div> + <h1>EquatorialStereographic changes for revisions 10795:10796</h1> +<p>Changes in this commit seem to be the result of some <cite>"auto reformat"</cite> tool execution. +The <cite>Java</cite> - <cite>GeoAPI</cite> - <cite>GeoTools</cite> import ordering is altered, +imports used only in Javadoc are lost and the encoding of non-ASCII characters is broken. +This commit has been reverted, except for the removal of really unused imports which are keep removed.</p> +<p><b>Command line:</b></p> +<blockquote><code>svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r10795:10796 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/EquatorialStereographic.java</code></blockquote> +<table class="changes"> +<tr><th>Revision 10795</th><th>Revision 10796</th></tr> +<tr><td><pre>/* + * Geotools - OpenSource mapping toolkit + * (C) 2003, 2004, Geotools Project Managment Committee (PMC) +<span class="del"> * (C) 2001, Institut de Recherche pour le Développement</span> + * (C) 1999, Fisheries and Oceans Canada + * + * This library is free software; you can redistribute it and/or</pre></td> +<td><pre>/* + * Geotools - OpenSource mapping toolkit + * (C) 2003, 2004, Geotools Project Managment Committee (PMC) +<span class="add"> * (C) 2001, Institut de Recherche pour le D�veloppement</span> + * (C) 1999, Fisheries and Oceans Canada + * + * This library is free software; you can redistribute it and/or</pre></td></tr> +<tr><td><pre>package org.geotools.referencing.operation.projection; + +// J2SE dependencies and extensions +import java.util.Collection; +<span class="del">import java.awt.geom.Point2D;</span> + +<span class="del">// OpenGIS dependencies</span> +<span class="del">import org.opengis.parameter.ParameterValueGroup;</span> +<span class="del">import org.opengis.parameter.ParameterNotFoundException;</span> +<span class="del"></span> +<span class="del">// Geotools dependencies</span> +import org.geotools.resources.cts.ResourceKeys; +import org.geotools.resources.cts.Resources; + +/** + * The USGS equatorial case of the {@linkplain Stereographic stereographic} projection.</pre></td> +<td><pre>package org.geotools.referencing.operation.projection; + +// J2SE dependencies and extensions +<span class="add">import java.awt.geom.Point2D;</span> +import java.util.Collection; + +import org.geotools.resources.cts.ResourceKeys; +import org.geotools.resources.cts.Resources; +<span class="add">import org.opengis.parameter.ParameterNotFoundException;</span> +<span class="add">import org.opengis.parameter.ParameterValueGroup;</span> + +/** + * The USGS equatorial case of the {@linkplain Stereographic stereographic} projection.</pre></td></tr> +<tr><td><pre>* {@link #latitudeOfOrigin} == 0.0. +* +* @version $Id$ +<span class="del">* @author André Gosselin</span> +* @author Martin Desruisseaux +* @author Rueben Schulz +*/</pre></td> +<td><pre>* {@link #latitudeOfOrigin} == 0.0. +* +* @version $Id$ +<span class="add">* @author Andr� Gosselin</span> +* @author Martin Desruisseaux +* @author Rueben Schulz +*/</pre></td></tr> +</table> + </div> + </body> +</html> Propchange: sis/ip-review/rev/10796/EquatorialStereographic.xhtml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: sis/ip-review/rev/10796/EquatorialStereographic.xhtml ------------------------------------------------------------------------------ svn:mime-type = text/html Added: sis/ip-review/rev/10796/ObliqueStereographic.xhtml URL: http://svn.apache.org/viewvc/sis/ip-review/rev/10796/ObliqueStereographic.xhtml?rev=1709620&view=auto ============================================================================== --- sis/ip-review/rev/10796/ObliqueStereographic.xhtml (added) +++ sis/ip-review/rev/10796/ObliqueStereographic.xhtml Tue Oct 20 15:01:18 2015 @@ -0,0 +1,81 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta charset="UTF-8"/> + <title>ObliqueStereographic changes for revisions 10795:10796</title> + <style type="text/css" media="all"> + @import url("../../reports.css"); + </style> + </head> + <body> + <div> + <h1>ObliqueStereographic changes for revisions 10795:10796</h1> +<p>Changes in this commit seem to be the result of some <cite>"auto reformat"</cite> tool execution. +The <cite>Java</cite> - <cite>GeoAPI</cite> - <cite>GeoTools</cite> import ordering is altered, +imports used only in Javadoc are lost and the encoding of non-ASCII characters is broken. +This commit has been reverted, except for the removal of really unused imports which are keep removed.</p> +<p><b>Command line:</b></p> +<blockquote><code>svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r10795:10796 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/ObliqueStereographic.java</code></blockquote> +<table class="changes"> +<tr><th>Revision 10795</th><th>Revision 10796</th></tr> +<tr><td><pre>/* + * Geotools - OpenSource mapping toolkit + * (C) 2003, 2004, Geotools Project Managment Committee (PMC) +<span class="del"> * (C) 2001, Institut de Recherche pour le Développement</span> + * (C) 1999, Fisheries and Oceans Canada + * + * This library is free software; you can redistribute it and/or</pre></td> +<td><pre>/* + * Geotools - OpenSource mapping toolkit + * (C) 2003, 2004, Geotools Project Managment Committee (PMC) +<span class="add"> * (C) 2001, Institut de Recherche pour le D�veloppement</span> + * (C) 1999, Fisheries and Oceans Canada + * + * This library is free software; you can redistribute it and/or</pre></td></tr> +<tr><td><pre>package org.geotools.referencing.operation.projection; + +// J2SE dependencies and extensions +import java.util.Collection; +<span class="del">import java.awt.geom.Point2D;</span> + +<span class="del">// OpenGIS dependencies</span> +<span class="del">import org.opengis.parameter.ParameterValueGroup;</span> +<span class="del">import org.opengis.parameter.ParameterNotFoundException;</span> +<span class="del"></span> +<span class="del">// Geotools dependencies</span> +import org.geotools.resources.cts.ResourceKeys; +import org.geotools.resources.cts.Resources; + +/** + * The USGS oblique/equatorial case of the {@linkplain Stereographic stereographic}</pre></td> +<td><pre>package org.geotools.referencing.operation.projection; + +// J2SE dependencies and extensions +<span class="add">import java.awt.geom.Point2D;</span> +import java.util.Collection; + +import org.geotools.resources.cts.ResourceKeys; +import org.geotools.resources.cts.Resources; +<span class="add">import org.opengis.parameter.ParameterNotFoundException;</span> +<span class="add">import org.opengis.parameter.ParameterValueGroup;</span> + +/** + * The USGS oblique/equatorial case of the {@linkplain Stereographic stereographic}</pre></td></tr> +<tr><td><pre>* projection. This is similar but <strong>NOT</strong> equal to EPSG code 9809. +* +* @version $Id$ +<span class="del">* @author André Gosselin</span> +* @author Martin Desruisseaux +* @author Rueben Schulz +*/</pre></td> +<td><pre>* projection. This is similar but <strong>NOT</strong> equal to EPSG code 9809. +* +* @version $Id$ +<span class="add">* @author Andr� Gosselin</span> +* @author Martin Desruisseaux +* @author Rueben Schulz +*/</pre></td></tr> +</table> + </div> + </body> +</html> Propchange: sis/ip-review/rev/10796/ObliqueStereographic.xhtml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: sis/ip-review/rev/10796/ObliqueStereographic.xhtml ------------------------------------------------------------------------------ svn:mime-type = text/html Added: sis/ip-review/rev/10796/Stereographic.xhtml URL: http://svn.apache.org/viewvc/sis/ip-review/rev/10796/Stereographic.xhtml?rev=1709620&view=auto ============================================================================== --- sis/ip-review/rev/10796/Stereographic.xhtml (added) +++ sis/ip-review/rev/10796/Stereographic.xhtml Tue Oct 20 15:01:18 2015 @@ -0,0 +1,611 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta charset="UTF-8"/> + <title>Stereographic changes for revisions 9358:10796</title> + <style type="text/css" media="all"> + @import url("../../reports.css"); + </style> + </head> + <body> + <div> + <h1>Stereographic changes for revisions 9358:10796</h1> + + <p>The stereographic case (using USGS formulas) has not been ported to Apache SIS. + Instead we use only the formulas provided by the EPSG guide.</p> + +<blockquote><code>svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r9358:10796 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/Stereographic.java</code></blockquote> +<table class="changes"> +<tr><th>Revision 9358</th><th>Revision 10796</th></tr> +<tr><td><pre></pre></td> +<td><pre><span class="add">/*</span> +<span class="add"> * Geotools - OpenSource mapping toolkit</span> +<span class="add"> * (C) 2003, 2004, Geotools Project Managment Committee (PMC)</span> +<span class="add"> * (C) 2001, Institut de Recherche pour le D�veloppement</span> +<span class="add"> * (C) 1999, Fisheries and Oceans Canada</span> +<span class="add"> *</span> +<span class="add"> * This library is free software; you can redistribute it and/or</span> +<span class="add"> * modify it under the terms of the GNU Lesser General Public</span> +<span class="add"> * License as published by the Free Software Foundation; either</span> +<span class="add"> * version 2.1 of the License, or (at your option) any later version.</span> +<span class="add"> *</span> +<span class="add"> * This library is distributed in the hope that it will be useful,</span> +<span class="add"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span> +<span class="add"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> +<span class="add"> * Lesser General Public License for more details.</span> +<span class="add"> *</span> +<span class="add"> * You should have received a copy of the GNU Lesser General Public</span> +<span class="add"> * License along with this library; if not, write to the Free Software</span> +<span class="add"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span> +<span class="add"> *</span> +<span class="add"> *</span> +<span class="add"> * This package contains formulas from the PROJ package of USGS.</span> +<span class="add"> * USGS's work is fully acknowledged here.</span> +<span class="add"> */</span> +<span class="add">package org.geotools.referencing.operation.projection;</span> +<span class="add"></span> +<span class="add">// J2SE dependencies and extensions</span> +<span class="add">import java.util.Collection;</span> +<span class="add"></span> +<span class="add">import javax.units.NonSI;</span> +<span class="add"></span> +<span class="add">import org.geotools.metadata.citation.Citation;</span> +<span class="add">import org.geotools.referencing.Identifier;</span> +<span class="add">import org.geotools.resources.cts.ResourceKeys;</span> +<span class="add">import org.geotools.resources.cts.Resources;</span> +<span class="add">import org.opengis.parameter.ParameterDescriptor;</span> +<span class="add">import org.opengis.parameter.ParameterDescriptorGroup;</span> +<span class="add">import org.opengis.parameter.ParameterNotFoundException;</span> +<span class="add">import org.opengis.parameter.ParameterValueGroup;</span> +<span class="add">import org.opengis.referencing.operation.MathTransform;</span> +<span class="add"></span> +<span class="add">/**</span> +<span class="add"> * Stereographic Projection. The directions starting from the central point are true,</span> +<span class="add"> * but the areas and the lengths become increasingly deformed as one moves away from</span> +<span class="add"> * the center. This projection is used to represent polar areas. It can be adapted</span> +<span class="add"> * for other areas having a circular form.</span> +<span class="add"> * <br><br></span> +<span class="add"> *</span> +<span class="add"> * This implementation, and its subclasses, provides transforms for six cases of the</span> +<span class="add"> * stereographic projection:</span> +<span class="add"> * <ul></span> +<span class="add"> * <li><code>"Oblique_Stereographic"</code> (EPSG code 9809), alias <code>"Double_Stereographic"</code></span> +<span class="add"> * in ESRI software</li></span> +<span class="add"> * <li><code>"Stereographic"</code> in ESRI software (<strong>NOT</strong> EPSG code 9809)</li></span> +<span class="add"> * <li><code>"Polar_Stereographic"</code> (EPSG code 9810, uses a series calculation for the inverse)</li></span> +<span class="add"> * <li><code>"Polar Stereographic (variant B)"</code> (EPSG code 9829, uses a series calculation for the inverse)</li></span> +<span class="add"> * <li><code>"Stereographic_North_Pole"</code> in ESRI software (uses itteration for the inverse)</li></span> +<span class="add"> * <li><code>"Stereographic_South_Pole"</code> in ESRI software (uses itteration for the inverse)</li></span> +<span class="add"> * </ul></span> +<span class="add"> *</span> +<span class="add"> * Both the <code>"Oblique_Stereographic"</code> and <code>"Stereographic"</code></span> +<span class="add"> * projections are "double" projections involving two parts: 1) a conformal</span> +<span class="add"> * transformation of the geographic coordinates to a sphere and 2) a spherical</span> +<span class="add"> * Stereographic projection. The EPSG considers both methods to be valid, but</span> +<span class="add"> * considers them to be a different coordinate operation methods.</span> +<span class="add"> * <br><br></span> +<span class="add"> *</span> +<span class="add"> * The <code>"Stereographic"</code> case uses the USGS equations of Snyder.</span> +<span class="add"> * This employs a simplified conversion to the conformal sphere that computes</span> +<span class="add"> * the conformal latitude of each point on the sphere.</span> +<span class="add"> * <br><br></span> +<span class="add"> *</span> +<span class="add"> * The <code>"Oblique_Stereographic"</code> case uses equations from the EPSG.</span> +<span class="add"> * This uses a more generalized form of the conversion to the conformal sphere; using only</span> +<span class="add"> * a single conformal sphere at the origin point. Since this is a "double" projection,</span> +<span class="add"> * it is sometimes called the "Double Stereographic". The <code>"Oblique_Stereographic"</code></span> +<span class="add"> * is used in New Brunswick (Canada) and the Netherlands.</span> +<span class="add"> * <br><br></span> +<span class="add"> *</span> +<span class="add"> * The <code>"Stereographic"</code> and <code>"Double Stereographic"</code> names are used in</span> +<span class="add"> * ESRI's ArcGIS 8.x product. The <code>"Oblique_Stereographic"</code> name is the EPSG name</span> +<span class="add"> * for the later only.</span> +<span class="add"> * <br><br></span> +<span class="add"> *</span> +<span class="add"> * <strong>WARNING:<strong> Tests points calculated with ArcGIS's "Double Stereographic" are</span> +<span class="add"> * not always equal to points calculated with the <code>"Oblique_Stereographic"</code>.</span> +<span class="add"> * However, where there are differences, two different implementations of these equations</span> +<span class="add"> * (EPSG guidence note 7 and libproj) calculate the same values as we do. Until these</span> +<span class="add"> * differences are resolved, please be careful when using this projection.</span> +<span class="add"> * <br><br></span> +<span class="add"> *</span> +<span class="add"> * If a <code>"latitude_of_origin"</code> parameter is supplied and is not consistent with the</span> +<span class="add"> * projection classification (for example a latitude different from &plusmn;90� for the polar case),</span> +<span class="add"> * then the oblique or polar case will be automatically inferred from the latitude. In other</span> +<span class="add"> * words, the latitude of origin has precedence on the projection classification. If ommited,</span> +<span class="add"> * then the default value is 90�N for <code>"Polar_Stereographic"</code> and 0� for</span> +<span class="add"> * <code>"Oblique_Stereographic"</code>.</span> +<span class="add"> * <br><br></span> +<span class="add"> *</span> +<span class="add"> * Polar projections that use the series equations for the inverse calculation will</span> +<span class="add"> * be little bit faster, but may be a little bit less accurate. If a polar</span> +<span class="add"> * "latitude_of_origin" is used for the "Oblique_Stereographic" or "Stereographic",</span> +<span class="add"> * the itterative equations will be used for inverse polar calculations.</span> +<span class="add"> * <br><br></span> +<span class="add"> *</span> +<span class="add"> * The "Polar Stereographic (variant B)", "Stereographic_North_Pole", and</span> +<span class="add"> * "Stereographic_South_Pole" cases include a "standard_parallel_1" paramter.</span> +<span class="add"> * This parameter sets the latitude with a scale factor equal to the supplied</span> +<span class="add"> * scale factor. The "Polar Stereographic (variant B)" recieves its "lattitude_of_origin"</span> +<span class="add"> * paramater value from the hemisphere of the "standard_parallel_1" value.</span> +<span class="add"> * <br><br></span> +<span class="add"> *</span> +<span class="add"> * <strong>References:</strong><ul></span> +<span class="add"> * <li>John P. Snyder (Map Projections - A Working Manual,<br></span> +<span class="add"> * U.S. Geological Survey Professional Paper 1395, 1987)</li></span> +<span class="add"> * <li>"Coordinate Conversions and Transformations including Formulas",<br></span> +<span class="add"> * EPSG Guidence Note Number 7, Version 19.</li></span> +<span class="add"> * <li>Gerald Evenden. <A HREF="http://members.bellatlantic.net/~vze2hc4d/proj4/sterea.pdf"></span> +<span class="add"> * "Supplementary PROJ.4 Notes - Oblique Stereographic Alternative"</A></li></span> +<span class="add"> * <li>Krakiwsky, E.J., D.B. Thomson, and R.R. Steeves. 1977. A Manual</span> +<span class="add"> * For Geodetic Coordinate Transformations in the Maritimes.</span> +<span class="add"> * Geodesy and Geomatics Engineering, UNB. Technical Report No. 48.</li></span> +<span class="add"> * <li>Thomson, D.B., M.P. Mepham and R.R. Steeves. 1977.</span> +<span class="add"> * The Stereographic Double Projection.</span> +<span class="add"> * Geodesy and Geomatics Engineereng, UNB. Technical Report No. 46.</li></span> +<span class="add"> * </ul></span> +<span class="add"> *</span> +<span class="add"> * @see <A HREF="http://mathworld.wolfram.com/StereographicProjection.html">Stereographic projection on MathWorld</A></span> +<span class="add"> * @see <A HREF="http://www.remotesensing.org/geotiff/proj_list/polar_stereographic.html">Polar_Stereographic</A></span> +<span class="add"> * @see <A HREF="http://www.remotesensing.org/geotiff/proj_list/oblique_stereographic.html">Oblique_Stereographic</A></span> +<span class="add"> * @see <A HREF="http://www.remotesensing.org/geotiff/proj_list/stereographic.html">Stereographic</A></span> +<span class="add"> * @see <A HREF="http://www.remotesensing.org/geotiff/proj_list/random_issues.html#stereographic">Some Random Stereographic Issues</A></span> +<span class="add"> *</span> +<span class="add"> * @version $Id$</span> +<span class="add"> * @author Andr� Gosselin</span> +<span class="add"> * @author Martin Desruisseaux</span> +<span class="add"> * @author Rueben Schulz</span> +<span class="add"> */</span> +<span class="add">public abstract class Stereographic extends MapProjection {</span> +<span class="add"></span> +<span class="add"> /** Projection mode for switch statement. */</span> +<span class="add"> protected static final short EPSG = 0;</span> +<span class="add"> /** Projection mode for switch statement. */</span> +<span class="add"> protected static final short USGS = 1;</span> +<span class="add"> /** Projection mode for switch statement. */</span> +<span class="add"> protected static final short POLAR_A = 2;</span> +<span class="add"> /** Projection mode for switch statement. */</span> +<span class="add"> protected static final short POLAR_B = 3;</span> +<span class="add"> /** Projection mode for switch statement. */</span> +<span class="add"> protected static final short POLAR_NORTH = 4;</span> +<span class="add"> /** Projection mode for switch statement. */</span> +<span class="add"> protected static final short POLAR_SOUTH = 5;</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * The type of stereographic projection, used for wkt parameters.</span> +<span class="add"> */</span> +<span class="add"> protected short stereoType;</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * The {@link org.geotools.referencing.operation.MathTransformProvider}</span> +<span class="add"> * for a {@link Stereographic} Oblique projection.</span> +<span class="add"> *</span> +<span class="add"> * @see org.geotools.referencing.operation.MathTransformFactory</span> +<span class="add"> *</span> +<span class="add"> * @version $Id$</span> +<span class="add"> * @author Rueben Schulz</span> +<span class="add"> */</span> +<span class="add"> public static final class Provider_Oblique extends Provider {</span> +<span class="add"> /**</span> +<span class="add"> * The parameters group.</span> +<span class="add"> */</span> +<span class="add"> static final ParameterDescriptorGroup PARAMETERS = createDescriptorGroup(new Identifier[] {</span> +<span class="add"> new Identifier(Citation.OPEN_GIS, "Oblique_Stereographic"),</span> +<span class="add"> new Identifier(Citation.EPSG, "Oblique Stereographic"),</span> +<span class="add"> new Identifier(Citation.EPSG, "Roussilhe"),</span> +<span class="add"> new Identifier(Citation.EPSG, "9809"),</span> +<span class="add"> new Identifier(Citation.GEOTIFF, "CT_ObliqueStereographic"),</span> +<span class="add"> new Identifier(Citation.ESRI, "Double_Stereographic"),</span> +<span class="add"> new Identifier(Citation.GEOTOOLS, Resources.formatInternational(</span> +<span class="add"> ResourceKeys.STEREOGRAPHIC_PROJECTION))</span> +<span class="add"> }, new ParameterDescriptor[] {</span> +<span class="add"> SEMI_MAJOR, SEMI_MINOR,</span> +<span class="add"> CENTRAL_MERIDIAN, LATITUDE_OF_ORIGIN,</span> +<span class="add"> SCALE_FACTOR,</span> +<span class="add"> FALSE_EASTING, FALSE_NORTHING</span> +<span class="add"> });</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Construct a new provider.</span> +<span class="add"> */</span> +<span class="add"> public Provider_Oblique() {</span> +<span class="add"> super(PARAMETERS);</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Creates a transform from the specified group of parameter values.</span> +<span class="add"> *</span> +<span class="add"> * @param parameters The group of parameter values.</span> +<span class="add"> * @return The created math transform.</span> +<span class="add"> * @throws ParameterNotFoundException if a required parameter was not found.</span> +<span class="add"> */</span> +<span class="add"> public MathTransform createMathTransform(final ParameterValueGroup parameters)</span> +<span class="add"> throws ParameterNotFoundException</span> +<span class="add"> {</span> +<span class="add"> final Collection descriptors = PARAMETERS.descriptors();</span> +<span class="add"> final double latitudeOfOrigin = Math.abs(</span> +<span class="add"> doubleValue(Provider.LATITUDE_OF_ORIGIN, parameters));</span> +<span class="add"> if (isSpherical(parameters)) {</span> +<span class="add"> // Polar case.</span> +<span class="add"> if (Math.abs(latitudeOfOrigin - Math.PI/2) < EPS) {</span> +<span class="add"> return new StereographicPolar.Spherical(parameters, descriptors, Double.NaN, EPSG);</span> +<span class="add"> }</span> +<span class="add"> // Equatorial case.</span> +<span class="add"> else if (latitudeOfOrigin < EPS) {</span> +<span class="add"> return new StereographicEquatorial.Spherical(parameters, descriptors, EPSG);</span> +<span class="add"> }</span> +<span class="add"> // Generic (oblique) case.</span> +<span class="add"> else {</span> +<span class="add"> return new StereographicOblique.Spherical(parameters, descriptors, EPSG);</span> +<span class="add"> }</span> +<span class="add"> } else {</span> +<span class="add"> // Polar case.</span> +<span class="add"> if (Math.abs(latitudeOfOrigin - Math.PI/2) < EPS) {</span> +<span class="add"> return new StereographicPolar(parameters, descriptors, Double.NaN, EPSG);</span> +<span class="add"> }</span> +<span class="add"> // Generic (oblique) case.</span> +<span class="add"> else {</span> +<span class="add"> return new StereographicOblique.EPSG(parameters, descriptors, EPSG);</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * The {@link org.geotools.referencing.operation.MathTransformProvider}</span> +<span class="add"> * for a {@link Stereographic} Polar projection. This provider uses the</span> +<span class="add"> * series equations for the inverse elliptical calculations.</span> +<span class="add"> *</span> +<span class="add"> * @see org.geotools.referencing.operation.MathTransformFactory</span> +<span class="add"> *</span> +<span class="add"> * @version $Id$</span> +<span class="add"> * @author Rueben Schulz</span> +<span class="add"> */</span> +<span class="add"> public static final class Provider_Polar_A extends Provider {</span> +<span class="add"> /**</span> +<span class="add"> * The parameters group.</span> +<span class="add"> */</span> +<span class="add"> static final ParameterDescriptorGroup PARAMETERS = createDescriptorGroup(new Identifier[] {</span> +<span class="add"> new Identifier(Citation.OPEN_GIS, "Polar_Stereographic"),</span> +<span class="add"> new Identifier(Citation.EPSG, "Polar Stereographic (variant A)"),</span> +<span class="add"> new Identifier(Citation.EPSG, "9810"),</span> +<span class="add"> new Identifier(Citation.GEOTIFF, "CT_PolarStereographic"),</span> +<span class="add"> new Identifier(Citation.GEOTOOLS, Resources.formatInternational(</span> +<span class="add"> ResourceKeys.STEREOGRAPHIC_PROJECTION))</span> +<span class="add"> }, new ParameterDescriptor[] {</span> +<span class="add"> SEMI_MAJOR, SEMI_MINOR,</span> +<span class="add"> CENTRAL_MERIDIAN, LATITUDE_OF_ORIGIN,</span> +<span class="add"> SCALE_FACTOR,</span> +<span class="add"> FALSE_EASTING, FALSE_NORTHING</span> +<span class="add"> });</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Construct a new provider.</span> +<span class="add"> */</span> +<span class="add"> public Provider_Polar_A() {</span> +<span class="add"> super(PARAMETERS);</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Creates a transform from the specified group of parameter values.</span> +<span class="add"> *</span> +<span class="add"> * @param parameters The group of parameter values.</span> +<span class="add"> * @return The created math transform.</span> +<span class="add"> * @throws ParameterNotFoundException if a required parameter was not found.</span> +<span class="add"> */</span> +<span class="add"> public MathTransform createMathTransform(final ParameterValueGroup parameters)</span> +<span class="add"> throws ParameterNotFoundException</span> +<span class="add"> {</span> +<span class="add"> final Collection descriptors = PARAMETERS.descriptors();</span> +<span class="add"> if (isSpherical(parameters)) {</span> +<span class="add"> return new StereographicPolar.Spherical(parameters, descriptors, Double.NaN, POLAR_A);</span> +<span class="add"> } else {</span> +<span class="add"> return new StereographicPolar.Series(parameters, descriptors, Double.NaN, POLAR_A);</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * The {@link org.geotools.referencing.operation.MathTransformProvider}</span> +<span class="add"> * for a {@link Stereographic} Polar (Variant B) projection. This provider</span> +<span class="add"> * includes a "Standard_Parallel_1" parameter and determines the hemisphere</span> +<span class="add"> * of the projection from the Standard_Parallel_1 value. It also uses the</span> +<span class="add"> * series equations for the inverse elliptical calculations.</span> +<span class="add"> *</span> +<span class="add"> * @see org.geotools.referencing.operation.MathTransformFactory</span> +<span class="add"> *</span> +<span class="add"> * @version $Id$</span> +<span class="add"> * @author Rueben Schulz</span> +<span class="add"> */</span> +<span class="add"> public static class Provider_Polar_B extends Provider {</span> +<span class="add"> /**</span> +<span class="add"> * The operation parameter descriptor for the latitudeTrueScale</span> +<span class="add"> * parameter value. Valid values range is from -90 to 90�.</span> +<span class="add"> * Default value is Double.NaN.</span> +<span class="add"> */</span> +<span class="add"> public static final ParameterDescriptor LATITUDE_TRUE_SCALE = createDescriptor(</span> +<span class="add"> new Identifier[] {</span> +<span class="add"> new Identifier(Citation.ESRI, "Standard_Parallel_1"),</span> +<span class="add"> new Identifier(Citation.EPSG, "Latitude of standard parallel")</span> +<span class="add"> },</span> +<span class="add"> Double.NaN, -90, 90, NonSI.DEGREE_ANGLE);</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * The parameters group.</span> +<span class="add"> */</span> +<span class="add"> static final ParameterDescriptorGroup PARAMETERS = createDescriptorGroup(new Identifier[] {</span> +<span class="add"> new Identifier(Citation.EPSG, "Polar Stereographic (variant B)"),</span> +<span class="add"> new Identifier(Citation.EPSG, "9829"),</span> +<span class="add"> new Identifier(Citation.GEOTOOLS, Resources.formatInternational(</span> +<span class="add"> ResourceKeys.STEREOGRAPHIC_PROJECTION))</span> +<span class="add"> }, new ParameterDescriptor[] {</span> +<span class="add"> SEMI_MAJOR, SEMI_MINOR,</span> +<span class="add"> CENTRAL_MERIDIAN, LATITUDE_TRUE_SCALE,</span> +<span class="add"> FALSE_EASTING, FALSE_NORTHING</span> +<span class="add"> });</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Construct a new provider.</span> +<span class="add"> */</span> +<span class="add"> public Provider_Polar_B() {</span> +<span class="add"> super(PARAMETERS);</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Construct a new provider.</span> +<span class="add"> */</span> +<span class="add"> protected Provider_Polar_B(final ParameterDescriptorGroup params) {</span> +<span class="add"> super(params);</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Creates a transform from the specified group of parameter values.</span> +<span class="add"> *</span> +<span class="add"> * @param parameters The group of parameter values.</span> +<span class="add"> * @return The created math transform.</span> +<span class="add"> * @throws ParameterNotFoundException if a required parameter was not found.</span> +<span class="add"> */</span> +<span class="add"> public MathTransform createMathTransform(final ParameterValueGroup parameters)</span> +<span class="add"> throws ParameterNotFoundException</span> +<span class="add"> {</span> +<span class="add"> final Collection descriptors = PARAMETERS.descriptors();</span> +<span class="add"> final double latitudeTrueScale = doubleValue(LATITUDE_TRUE_SCALE, parameters);</span> +<span class="add"> final double latitudeOfOrigin = (latitudeTrueScale < 0.0) ? -Math.PI/2.0 : Math.PI/2.0;</span> +<span class="add"></span> +<span class="add"> if (isSpherical(parameters)) {</span> +<span class="add"> return new StereographicPolar.Spherical(parameters, descriptors, latitudeOfOrigin, POLAR_B);</span> +<span class="add"> } else {</span> +<span class="add"> return new StereographicPolar.Series(parameters, descriptors, latitudeOfOrigin, POLAR_B);</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * The {@link org.geotools.referencing.operation.MathTransformProvider}</span> +<span class="add"> * for a {@link Stereographic} North Polar projection. This provider sets</span> +<span class="add"> * the "latitude_of_origin" parameter to +90.0 degrees and uses the</span> +<span class="add"> * itterative equations for the inverse elliptical calculations.</span> +<span class="add"> *</span> +<span class="add"> * @see org.geotools.referencing.operation.MathTransformFactory</span> +<span class="add"> *</span> +<span class="add"> * @version $Id$</span> +<span class="add"> * @author Rueben Schulz</span> +<span class="add"> */</span> +<span class="add"> public static class Provider_North_Pole extends Provider_Polar_B {</span> +<span class="add"> /**</span> +<span class="add"> * The parameters group.</span> +<span class="add"> */</span> +<span class="add"> static final ParameterDescriptorGroup PARAMETERS = createDescriptorGroup(new Identifier[] {</span> +<span class="add"> new Identifier(Citation.ESRI, "Stereographic_North_Pole"),</span> +<span class="add"> new Identifier(Citation.GEOTOOLS, Resources.formatInternational(</span> +<span class="add"> ResourceKeys.STEREOGRAPHIC_PROJECTION))</span> +<span class="add"> }, new ParameterDescriptor[] {</span> +<span class="add"> SEMI_MAJOR, SEMI_MINOR,</span> +<span class="add"> CENTRAL_MERIDIAN, LATITUDE_TRUE_SCALE,</span> +<span class="add"> SCALE_FACTOR,</span> +<span class="add"> FALSE_EASTING, FALSE_NORTHING</span> +<span class="add"> });</span> +<span class="add"></span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Construct a new provider.</span> +<span class="add"> */</span> +<span class="add"> public Provider_North_Pole() {</span> +<span class="add"> super(PARAMETERS);</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Construct a new provider.</span> +<span class="add"> */</span> +<span class="add"> protected Provider_North_Pole(final ParameterDescriptorGroup params) {</span> +<span class="add"> super(params);</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Creates a transform from the specified group of parameter values.</span> +<span class="add"> *</span> +<span class="add"> * @param parameters The group of parameter values.</span> +<span class="add"> * @return The created math transform.</span> +<span class="add"> * @throws ParameterNotFoundException if a required parameter was not found.</span> +<span class="add"> */</span> +<span class="add"> public MathTransform createMathTransform(final ParameterValueGroup parameters)</span> +<span class="add"> throws ParameterNotFoundException</span> +<span class="add"> {</span> +<span class="add"> final Collection descriptors = PARAMETERS.descriptors();</span> +<span class="add"> if (isSpherical(parameters)) {</span> +<span class="add"> return new StereographicPolar.Spherical(parameters, descriptors, Math.PI/2.0, POLAR_NORTH);</span> +<span class="add"> } else {</span> +<span class="add"> return new StereographicPolar(parameters, descriptors, Math.PI/2.0, POLAR_NORTH);</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * The {@link org.geotools.referencing.operation.MathTransformProvider}</span> +<span class="add"> * for a {@link Stereographic} North Polar projection. This provider sets</span> +<span class="add"> * the "latitude_of_origin" parameter to -90.0 degrees and uses the</span> +<span class="add"> * itterative equations for the inverse elliptical calculations.</span> +<span class="add"> *</span> +<span class="add"> * @see org.geotools.referencing.operation.MathTransformFactory</span> +<span class="add"> *</span> +<span class="add"> * @version $Id$</span> +<span class="add"> * @author Rueben Schulz</span> +<span class="add"> */</span> +<span class="add"> public static final class Provider_South_Pole extends Provider_North_Pole {</span> +<span class="add"> /**</span> +<span class="add"> * The parameters group.</span> +<span class="add"> */</span> +<span class="add"> static final ParameterDescriptorGroup PARAMETERS = createDescriptorGroup(new Identifier[] {</span> +<span class="add"> new Identifier(Citation.ESRI, "Stereographic_South_Pole"),</span> +<span class="add"> new Identifier(Citation.GEOTOOLS, Resources.formatInternational(</span> +<span class="add"> ResourceKeys.STEREOGRAPHIC_PROJECTION))</span> +<span class="add"> }, new ParameterDescriptor[] {</span> +<span class="add"> SEMI_MAJOR, SEMI_MINOR,</span> +<span class="add"> CENTRAL_MERIDIAN, LATITUDE_TRUE_SCALE,</span> +<span class="add"> SCALE_FACTOR,</span> +<span class="add"> FALSE_EASTING, FALSE_NORTHING</span> +<span class="add"> });</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Construct a new provider.</span> +<span class="add"> */</span> +<span class="add"> public Provider_South_Pole() {</span> +<span class="add"> super(PARAMETERS);</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Creates a transform from the specified group of parameter values.</span> +<span class="add"> *</span> +<span class="add"> * @param parameters The group of parameter values.</span> +<span class="add"> * @return The created math transform.</span> +<span class="add"> * @throws ParameterNotFoundException if a required parameter was not found.</span> +<span class="add"> */</span> +<span class="add"> public MathTransform createMathTransform(final ParameterValueGroup parameters)</span> +<span class="add"> throws ParameterNotFoundException</span> +<span class="add"> {</span> +<span class="add"> final Collection descriptors = PARAMETERS.descriptors();</span> +<span class="add"> if (isSpherical(parameters)) {</span> +<span class="add"> return new StereographicPolar.Spherical(parameters, descriptors, -Math.PI/2.0, POLAR_SOUTH);</span> +<span class="add"> } else {</span> +<span class="add"> return new StereographicPolar(parameters, descriptors, -Math.PI/2.0, POLAR_SOUTH);</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * The {@link org.geotools.referencing.operation.MathTransformProvider}</span> +<span class="add"> * for a {@link Stereographic} (USGS equations) projection.</span> +<span class="add"> *</span> +<span class="add"> * @see org.geotools.referencing.operation.MathTransformFactory</span> +<span class="add"> *</span> +<span class="add"> * @version $Id$</span> +<span class="add"> * @author Rueben Schulz</span> +<span class="add"> */</span> +<span class="add"> public static final class Provider_USGS extends Provider{</span> +<span class="add"> /**</span> +<span class="add"> * The parameters group.</span> +<span class="add"> */</span> +<span class="add"> static final ParameterDescriptorGroup PARAMETERS = createDescriptorGroup(new Identifier[] {</span> +<span class="add"> new Identifier(Citation.ESRI, "Stereographic"),</span> +<span class="add"> new Identifier(Citation.GEOTIFF, "CT_Stereographic"),</span> +<span class="add"> new Identifier(Citation.GEOTOOLS, Resources.formatInternational(</span> +<span class="add"> ResourceKeys.STEREOGRAPHIC_PROJECTION))</span> +<span class="add"> }, new ParameterDescriptor[] {</span> +<span class="add"> SEMI_MAJOR, SEMI_MINOR,</span> +<span class="add"> CENTRAL_MERIDIAN, LATITUDE_OF_ORIGIN,</span> +<span class="add"> SCALE_FACTOR,</span> +<span class="add"> FALSE_EASTING, FALSE_NORTHING</span> +<span class="add"> });</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Construct a new provider.</span> +<span class="add"> */</span> +<span class="add"> public Provider_USGS() {</span> +<span class="add"> super(PARAMETERS);</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Creates a transform from the specified group of parameter values.</span> +<span class="add"> *</span> +<span class="add"> * @param parameters The group of parameter values.</span> +<span class="add"> * @return The created math transform.</span> +<span class="add"> * @throws ParameterNotFoundException if a required parameter was not found.</span> +<span class="add"> */</span> +<span class="add"> public MathTransform createMathTransform(final ParameterValueGroup parameters)</span> +<span class="add"> throws ParameterNotFoundException</span> +<span class="add"> {</span> +<span class="add"> final Collection descriptors = PARAMETERS.descriptors();</span> +<span class="add"> final double latitudeOfOrigin = Math.abs(</span> +<span class="add"> doubleValue(Provider.LATITUDE_OF_ORIGIN, parameters));</span> +<span class="add"> if (isSpherical(parameters)) {</span> +<span class="add"> // Polar case.</span> +<span class="add"> if (Math.abs(latitudeOfOrigin - Math.PI/2) < EPS) {</span> +<span class="add"> return new StereographicPolar.Spherical(parameters, descriptors, Double.NaN, USGS);</span> +<span class="add"> }</span> +<span class="add"> // Equatorial case.</span> +<span class="add"> else if (latitudeOfOrigin < EPS) {</span> +<span class="add"> return new StereographicEquatorial.Spherical(parameters, descriptors, USGS);</span> +<span class="add"> }</span> +<span class="add"> // Generic (oblique) case.</span> +<span class="add"> else {</span> +<span class="add"> return new StereographicOblique.Spherical(parameters, descriptors, USGS);</span> +<span class="add"> }</span> +<span class="add"> } else {</span> +<span class="add"> // Polar case.</span> +<span class="add"> if (Math.abs(latitudeOfOrigin - Math.PI/2) < EPS) {</span> +<span class="add"> return new StereographicPolar(parameters, descriptors, Double.NaN, USGS);</span> +<span class="add"> }</span> +<span class="add"> // Equatorial case.</span> +<span class="add"> else if (latitudeOfOrigin < EPS) {</span> +<span class="add"> return new StereographicEquatorial(parameters, descriptors, USGS);</span> +<span class="add"> }</span> +<span class="add"> // Generic (oblique) case.</span> +<span class="add"> else {</span> +<span class="add"> return new StereographicOblique(parameters, descriptors, USGS);</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * Creates a transform from the specified group of parameter values.</span> +<span class="add"> *</span> +<span class="add"> * @param parameters The group of parameter values.</span> +<span class="add"> * @param expected The expected parameter descriptors.</span> +<span class="add"> * @return The created math transform.</span> +<span class="add"> * @throws ParameterNotFoundException if a required parameter was not found.</span> +<span class="add"> */</span> +<span class="add"> Stereographic(final ParameterValueGroup parameters, final Collection expected)</span> +<span class="add"> throws ParameterNotFoundException</span> +<span class="add"> {</span> +<span class="add"> //Fetch parameters</span> +<span class="add"> super(parameters, expected);</span> +<span class="add"> }</span> +<span class="add"></span> +<span class="add"> /**</span> +<span class="add"> * {@inheritDoc}</span> +<span class="add"> */</span> +<span class="add"> public ParameterDescriptorGroup getParameterDescriptors() {</span> +<span class="add"> switch (stereoType) {</span> +<span class="add"> case EPSG:</span> +<span class="add"> return Provider_Oblique.PARAMETERS;</span> +<span class="add"> case USGS:</span> +<span class="add"> return Provider_USGS.PARAMETERS;</span> +<span class="add"> case POLAR_A:</span> +<span class="add"> return Provider_Polar_A.PARAMETERS;</span> +<span class="add"> case POLAR_B:</span> +<span class="add"> return Provider_Polar_B.PARAMETERS;</span> +<span class="add"> case POLAR_NORTH:</span> +<span class="add"> return Provider_North_Pole.PARAMETERS;</span> +<span class="add"> case POLAR_SOUTH:</span> +<span class="add"> return Provider_South_Pole.PARAMETERS;</span> +<span class="add"> default:</span> +<span class="add"> assert false; return null;</span> +<span class="add"> }</span> +<span class="add"> }</span> +<span class="add">}</span></pre></td></tr> +</table> + </div> + </body> +</html> Propchange: sis/ip-review/rev/10796/Stereographic.xhtml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: sis/ip-review/rev/10796/Stereographic.xhtml ------------------------------------------------------------------------------ svn:mime-type = text/html Added: sis/ip-review/rev/10860/HEADER.html URL: http://svn.apache.org/viewvc/sis/ip-review/rev/10860/HEADER.html?rev=1709620&view=auto ============================================================================== --- sis/ip-review/rev/10860/HEADER.html (added) +++ sis/ip-review/rev/10860/HEADER.html Tue Oct 20 15:01:18 2015 @@ -0,0 +1,17 @@ +<!DOCTYPE html> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta charset="UTF-8"/> + <title>Revision 10860</title> + </head> + <body> + <div> + <h1>Revision 10860</h1> +<table> + <tr><td><b>Author:</b></td><td>rschulz</td></tr> + <tr><td><b>Date:</b></td><td>2005-01-29</td></tr> + <tr><td><b>Message:</b></td><td>fixed small mistake in assigning default value for the 'Standard_parallel_1 parameter</td></tr> +</table> + </div> + </body> +</html> Propchange: sis/ip-review/rev/10860/HEADER.html ------------------------------------------------------------------------------ svn:eol-style = native Propchange: sis/ip-review/rev/10860/HEADER.html ------------------------------------------------------------------------------ svn:mime-type = text/html