sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1762744 - in /sis/branches/JDK8/core/sis-referencing/src: main/java/org/apache/sis/referencing/operation/projection/ test/java/org/apache/sis/referencing/operation/projection/
Date Thu, 29 Sep 2016 08:25:53 GMT
Author: desruisseaux
Date: Thu Sep 29 08:25:53 2016
New Revision: 1762744

URL: http://svn.apache.org/viewvc?rev=1762744&view=rev
Log:
Remove an unnecessary package-private ProjectionException constructor, and opportunistic javadoc
formatting.

Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ConformalProjection.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/EqualAreaProjection.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ObliqueStereographic.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ProjectionException.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorMethodComparison.java

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ConformalProjection.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ConformalProjection.java?rev=1762744&r1=1762743&r2=1762744&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ConformalProjection.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ConformalProjection.java
[UTF-8] Thu Sep 29 08:25:53 2016
@@ -147,7 +147,7 @@ abstract class ConformalProjection exten
      * <p>It is sub-classes responsibility to invoke {@code super.computeCoefficients()}
in their
      * constructor when ready, or to compute the coefficients themselves.</p>
      *
-     * @param initializer The initializer for computing map projection internal parameters.
+     * @param  initializer  the initializer for computing map projection internal parameters.
      */
     ConformalProjection(final Initializer initializer) {
         super(initializer);
@@ -227,8 +227,8 @@ abstract class ConformalProjection exten
      * for the same precision, but this precision is achieved "only" for relatively small
eccentricity like
      * the Earth's one. See the {@code MercatorMethodComparison} class in the test package
for more discussion.
      *
-     * @param  expOfSouthing The <em>reciprocal</em> of the value returned by
{@link #expOfNorthing}.
-     * @return The latitude in radians.
+     * @param  expOfSouthing  the <em>reciprocal</em> of the value returned by
{@link #expOfNorthing}.
+     * @return the latitude in radians.
      * @throws ProjectionException if the iteration does not converge.
      *
      * @see #expOfNorthing(double, double)
@@ -289,7 +289,7 @@ abstract class ConformalProjection exten
                 return φ;
             }
         }
-        throw new ProjectionException(Resources.Keys.NoConvergence);
+        throw new ProjectionException(Resources.format(Resources.Keys.NoConvergence));
     }
 
     /**
@@ -343,8 +343,8 @@ abstract class ConformalProjection exten
      *   <li>Reciprocal of (15-9) in the <cite>Lambert Conformal Conic projection</cite>
chapter.</li>
      * </ul>
      *
-     * @param  φ     The latitude in radians.
-     * @param  ℯsinφ The sine of the φ argument multiplied by {@link #eccentricity}.
+     * @param  φ      the latitude in radians.
+     * @param  ℯsinφ  the sine of the φ argument multiplied by {@link #eccentricity}.
      * @return {@code Math.exp} of the Mercator projection of the given latitude.
      *
      * @see #φ(double)
@@ -368,9 +368,9 @@ abstract class ConformalProjection exten
      * <p>In order to get the derivative of the {@link #expOfNorthing(double, double)}
function, call can multiply
      * the returned value by by {@code expOfNorthing}.</p>
      *
-     * @param  sinφ the sine of latitude.
-     * @param  cosφ The cosine of latitude.
-     * @return The partial derivative of a Mercator projection at the given latitude.
+     * @param  sinφ  the sine of latitude.
+     * @param  cosφ  the cosine of latitude.
+     * @return the partial derivative of a Mercator projection at the given latitude.
      *
      * @see #expOfNorthing(double, double)
      * @see #φ(double)

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/EqualAreaProjection.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/EqualAreaProjection.java?rev=1762744&r1=1762743&r2=1762744&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/EqualAreaProjection.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/EqualAreaProjection.java
[UTF-8] Thu Sep 29 08:25:53 2016
@@ -88,7 +88,7 @@ abstract class EqualAreaProjection exten
     /**
      * Creates a new normalized projection from the parameters computed by the given initializer.
      *
-     * @param initializer The initializer for computing map projection internal parameters.
+     * @param  initializer  the initializer for computing map projection internal parameters.
      */
     EqualAreaProjection(final Initializer initializer) {
         super(initializer);
@@ -152,7 +152,7 @@ abstract class EqualAreaProjection exten
      *
      * In the spherical case, <var>q</var> = 2⋅sinφ.
      *
-     * @param  sinφ sine of the latitude <var>q</var> is calculated for.
+     * @param  sinφ  the sine of the latitude <var>q</var> is calculated for.
      * @return <var>q</var> from Snyder equation (3-12).
      */
     final double qm(final double sinφ) {
@@ -168,7 +168,7 @@ abstract class EqualAreaProjection exten
      * It is caller responsibility to ensure that this method is not invoked in the spherical
case, since
      * this implementation does not work in such case.
      *
-     * @param  sinφ sine of the latitude <var>q</var> is calculated for.
+     * @param  sinφ  the sine of the latitude <var>q</var> is calculated for.
      * @return <var>q</var> from Snyder equation (3-12).
      */
     final double qm_ellipsoid(final double sinφ) {
@@ -197,7 +197,7 @@ abstract class EqualAreaProjection exten
      * have a sufficient amount of terms for achieving the centimetric precision, so we "finish"
it by the
      * iterative method. The series expansion is nevertheless useful for reducing the number
of iterations.
      *
-     * @param  y in the cylindrical case, this is northing on the normalized ellipsoid.
+     * @param  y  in the cylindrical case, this is northing on the normalized ellipsoid.
      * @return the latitude in radians.
      */
     final double φ(final double y) throws ProjectionException {
@@ -275,7 +275,7 @@ abstract class EqualAreaProjection exten
             return Double.NaN;                      // Value "after" the pole.
         }
         // Value should have converged but did not.
-        throw new ProjectionException(Resources.Keys.NoConvergence);
+        throw new ProjectionException(Resources.format(Resources.Keys.NoConvergence));
     }
 
     /**

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ObliqueStereographic.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ObliqueStereographic.java?rev=1762744&r1=1762743&r2=1762744&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ObliqueStereographic.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ObliqueStereographic.java
[UTF-8] Thu Sep 29 08:25:53 2016
@@ -97,8 +97,8 @@ public class ObliqueStereographic extend
      *   <li><cite>"Oblique Stereographic"</cite>, also known as <cite>"Roussilhe"</cite>.</li>
      * </ul>
      *
-     * @param method     Description of the projection parameters.
-     * @param parameters The parameter values of the projection to create.
+     * @param  method      description of the projection parameters.
+     * @param  parameters  the parameter values of the projection to create.
      */
     public ObliqueStereographic(final OperationMethod method, final Parameters parameters)
{
         this(initializer(method, parameters));
@@ -216,8 +216,8 @@ public class ObliqueStereographic extend
      * <p>The non-linear part of the returned transform will be {@code this} transform,
except if the ellipsoid
      * is spherical. In the later case, {@code this} transform will be replaced by a simplified
implementation.</p>
      *
-     * @param  factory The factory to use for creating the transform.
-     * @return The map projection from (λ,φ) to (<var>x</var>,<var>y</var>)
coordinates.
+     * @param  factory  the factory to use for creating the transform.
+     * @return the map projection from (λ,φ) to (<var>x</var>,<var>y</var>)
coordinates.
      * @throws FactoryException if an error occurred while creating a transform.
      */
     @Override
@@ -244,7 +244,7 @@ public class ObliqueStereographic extend
      * Converts the specified (λ,φ) coordinate (units in radians) and stores the result
in {@code dstPts}.
      * In addition, opportunistically computes the projection derivative if {@code derivate}
is {@code true}.
      *
-     * @return The matrix of the projection derivative at the given source position,
+     * @return the matrix of the projection derivative at the given source position,
      *         or {@code null} if the {@code derivate} argument is {@code false}.
      * @throws ProjectionException if the coordinate can not be converted.
      */
@@ -364,7 +364,7 @@ public class ObliqueStereographic extend
                 return;
             }
         }
-        throw new ProjectionException(Resources.Keys.NoConvergence);
+        throw new ProjectionException(Resources.format(Resources.Keys.NoConvergence));
     }
 
 
@@ -389,7 +389,7 @@ public class ObliqueStereographic extend
         /**
          * Constructs a new map projection from the supplied parameters.
          *
-         * @param parameters The parameters of the projection to be created.
+         * @param  parameters  the parameters of the projection to be created.
          */
         protected Spherical(ObliqueStereographic other) {
             super(other);

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ProjectionException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ProjectionException.java?rev=1762744&r1=1762743&r2=1762744&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ProjectionException.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ProjectionException.java
[UTF-8] Thu Sep 29 08:25:53 2016
@@ -17,7 +17,6 @@
 package org.apache.sis.referencing.operation.projection;
 
 import org.opengis.referencing.operation.TransformException;
-import org.apache.sis.internal.referencing.Resources;
 
 
 /**
@@ -85,13 +84,4 @@ public class ProjectionException extends
     public ProjectionException(final String message, final Throwable cause) {
         super(message, cause);
     }
-
-    /**
-     * Constructs a new exception with the specified detail message.
-     *
-     * @param  code  one of the constants suitable for {@link Resources#format(short)}.
-     */
-    ProjectionException(final short code) {
-        this(Resources.format(code));
-    }
 }

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java?rev=1762744&r1=1762743&r2=1762744&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java
[UTF-8] Thu Sep 29 08:25:53 2016
@@ -96,8 +96,8 @@ public class TransverseMercator extends
      *   <li><cite>"Transverse Mercator (South Orientated)"</cite>.</li>
      * </ul>
      *
-     * @param method     Description of the projection parameters.
-     * @param parameters The parameter values of the projection to create.
+     * @param  method      description of the projection parameters.
+     * @param  parameters  the parameter values of the projection to create.
      */
     public TransverseMercator(final OperationMethod method, final Parameters parameters)
{
         this(initializer(method, parameters));
@@ -245,7 +245,7 @@ public class TransverseMercator extends
      *
      *     <blockquote>b/a = √(1 - ℯ²)</blockquote>
      *
-     * @param n The value of {@code f / (2-f)} where {@code f} is the flattening factor.
+     * @param  n  the value of {@code f / (2-f)} where {@code f} is the flattening factor.
      */
     private void computeCoefficients(final double n) {
         final double n2 = n  * n;
@@ -288,8 +288,8 @@ public class TransverseMercator extends
      * <p>The non-linear part of the returned transform will be {@code this} transform,
except if the ellipsoid
      * is spherical. In the later case, {@code this} transform will be replaced by a simplified
implementation.</p>
      *
-     * @param  factory The factory to use for creating the transform.
-     * @return The map projection from (λ,φ) to (<var>x</var>,<var>y</var>)
coordinates.
+     * @param  factory  the factory to use for creating the transform.
+     * @return the map projection from (λ,φ) to (<var>x</var>,<var>y</var>)
coordinates.
      * @throws FactoryException if an error occurred while creating a transform.
      */
     @Override
@@ -305,7 +305,7 @@ public class TransverseMercator extends
      * Converts the specified (λ,φ) coordinate (units in radians) and stores the result
in {@code dstPts}.
      * In addition, opportunistically computes the projection derivative if {@code derivate}
is {@code true}.
      *
-     * @return The matrix of the projection derivative at the given source position,
+     * @return the matrix of the projection derivative at the given source position,
      *         or {@code null} if the {@code derivate} argument is {@code false}.
      * @throws ProjectionException if the coordinate can not be converted.
      */
@@ -578,7 +578,7 @@ public class TransverseMercator extends
             }
             p = c;
         }
-        throw new ProjectionException(Resources.Keys.NoConvergence);
+        throw new ProjectionException(Resources.format(Resources.Keys.NoConvergence));
     }
 
 
@@ -603,7 +603,7 @@ public class TransverseMercator extends
         /**
          * Constructs a new map projection from the parameters of the given projection.
          *
-         * @param other The other projection (usually ellipsoidal) from which to copy the
parameters.
+         * @param  other  the other projection (usually ellipsoidal) from which to copy the
parameters.
          */
         protected Spherical(final TransverseMercator other) {
             super(other);

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorMethodComparison.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorMethodComparison.java?rev=1762744&r1=1762743&r2=1762744&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorMethodComparison.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorMethodComparison.java
[UTF-8] Thu Sep 29 08:25:53 2016
@@ -85,7 +85,7 @@ public final class MercatorMethodCompari
     /**
      * Creates a new instance for the same eccentricity than the given projection.
      *
-     * @param projection the projection from which to take the eccentricity.
+     * @param  projection  the projection from which to take the eccentricity.
      */
     public MercatorMethodComparison(final NormalizedProjection projection) {
         this(projection.eccentricitySquared);
@@ -115,8 +115,8 @@ public final class MercatorMethodCompari
      * Computes φ using the series expansion given by Geomatics Guidance Note number 7,
part 2.
      * This is the first part of the {@link ConformalProjection#φ(double)} method.
      *
-     * @param  t The {@code expOfSouthing} parameter value.
-     * @return The latitude (in radians) for the given parameter.
+     * @param  t  the {@code expOfSouthing} parameter value.
+     * @return the latitude (in radians) for the given parameter.
      */
     public double bySeriesExpansion(final double t) {
         final double χ = PI/2 - 2*atan(t);
@@ -136,8 +136,8 @@ public final class MercatorMethodCompari
      *   <li>sin(4⋅x) = (4 - 8⋅sin²(x))⋅sin(x)⋅cos(x)</li>
      * </ul>
      *
-     * @param  t The {@code expOfSouthing} parameter value.
-     * @return The latitude (in radians) for the given parameter.
+     * @param  t  the {@code expOfSouthing} parameter value.
+     * @return the latitude (in radians) for the given parameter.
      */
     public double usingTrigonometricIdentities(final double t) {
         final double χ = PI/2 - 2*atan(t);
@@ -154,8 +154,8 @@ public final class MercatorMethodCompari
      * Computes φ using the iterative method used by USGS.
      * This is the second part of the {@link ConformalProjection#φ(double)} method.
      *
-     * @param  t The {@code expOfSouthing} parameter value.
-     * @return The latitude (in radians) for the given parameter.
+     * @param  t  the {@code expOfSouthing} parameter value.
+     * @return the latitude (in radians) for the given parameter.
      * @throws ProjectionException if the iteration does not converge.
      */
     public double byIterativeMethod(final double t) throws ProjectionException {
@@ -171,7 +171,7 @@ public final class MercatorMethodCompari
         if (Double.isNaN(t)) {
             return Double.NaN;
         }
-        throw new ProjectionException(Resources.Keys.NoConvergence);
+        throw new ProjectionException(Resources.format(Resources.Keys.NoConvergence));
     }
 
     /**
@@ -187,7 +187,7 @@ public final class MercatorMethodCompari
      * values for random numbers. The result is printed to the standard output stream as
the maximum and average errors,
      * in units of {@link NormalizedProjection#ITERATION_TOLERANCE} (about 0.25 cm on a planet
of the size of Earth).
      *
-     * @param  numSamples Number of random sample values.
+     * @param  numSamples  number of random sample values.
      * @throws ProjectionException if an error occurred during the calculation of φ.
      */
     public void printAccuracyComparison(final int numSamples) throws ProjectionException
{
@@ -265,8 +265,8 @@ public final class MercatorMethodCompari
      * The current threshold value is shown by inserting a horizontal line separator in the
table when that threshold
      * is crossed.</p>
      *
-     * @param min The first eccentricity value to test.
-     * @param max The maximal eccentricity value to test.
+     * @param  min  the first eccentricity value to test.
+     * @param  max  the maximal eccentricity value to test.
      * @throws ProjectionException if an error occurred in {@link #φ(double)}.
      */
     public static void printErrorForExcentricities(final double min, final double max) throws
ProjectionException {
@@ -334,7 +334,7 @@ public final class MercatorMethodCompari
     /**
      * The result is printed to the standard output stream.
      *
-     * @param  args ignored.
+     * @param  args  ignored.
      * @throws ProjectionException if an error occurred in {@link #φ(double)}.
      * @throws InterruptedException if the thread has been interrupted between two benchmarks.
      */



Mime
View raw message