Added: sis/ip-review/rev/23993/MapProjection.xhtml
URL: 
http://svn.apache.org/viewvc/sis/ip-review/rev/23993/MapProjection.xhtml?rev=1667056&view=auto
==============================================================================
--- sis/ip-review/rev/23993/MapProjection.xhtml (added)
+++ sis/ip-review/rev/23993/MapProjection.xhtml Mon Mar 16 16:18:13 2015
@@ -0,0 +1,272 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml";>
+  <head>
+    <meta charset="UTF-8"/>
+    <title>MapProjection changes for revisions 23992:23993</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>MapProjection changes for revisions 23992:23993</h1>
+
+<p>Most 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 change has been reverted, except for the removal of really unused imports 
which are keep removed.</p>
+
+<p>The commit contains also information which can be retrieved from the 
following sources:</p>
+<ul>
+  <li><a href="http://epsg-registry.org/";>http://epsg-registry.org/</a></li>
+</ul>
+<p>Removing those information cause a test failures, since the JUnit tests 
compare the name declared in the code
+with the name declared in the EPSG database. Test failures are fixed by 
re-introducing the parameter names as
+indicated in the test error message.</p>
+
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change 
--ignore-all-space --ignore-eol-style" -r23992:23993 
http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/MapProjection.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 23992</th><th>Revision 23993</th></tr>
+<tr><td><pre>*    http://geotools.org
+*
+*   (C) 2003-2006, Geotools Project Managment Committee (PMC)
+<span class="del">*   (C) 2001, Institut de Recherche pour le 
Développement</span>
+*   (C) 2000, Frank Warmerdam
+*   (C) 1999, Fisheries and Oceans Canada
+*</pre></td>
+<td><pre>*    http://geotools.org
+*
+*   (C) 2003-2006, Geotools Project Managment Committee (PMC)
+<span class="add">*   (C) 2001, Institut de Recherche pour le 
D�veloppement</span>
+*   (C) 2000, Frank Warmerdam
+*   (C) 1999, Fisheries and Oceans Canada
+*</pre></td></tr>
+<tr><td><pre>* @since 2.0
+* @version $Id$
+* @source $URL$
+<span class="del">* @author André Gosselin</span>
+* @author Martin Desruisseaux
+* @author Rueben Schulz
+*</pre></td>
+<td><pre>* @since 2.0
+* @version $Id$
+* @source $URL$
+<span class="add">* @author Andr� Gosselin</span>
+* @author Martin Desruisseaux
+* @author Rueben Schulz
+*</pre></td></tr>
+<tr><td><pre>protected final double excentricity;
+
+/**
+<span class="del"> * The square of excentricity: e² = (a²-b²)/a² 
where</span>
+ * &lt;var&gt;e&lt;/var&gt; is the {@linkplain #excentricity excentricity},
+ * &lt;var&gt;a&lt;/var&gt; is the {@linkplain #semiMajor semi major} axis 
length and
+ * &lt;var&gt;b&lt;/var&gt; is the {@linkplain #semiMinor semi minor} axis 
length.</pre></td>
+<td><pre>protected final double excentricity;
+
+/**
+<span class="add"> * The square of excentricity: e� = 
(a�-b�)/a� where</span>
+ * &lt;var&gt;e&lt;/var&gt; is the {@linkplain #excentricity excentricity},
+ * &lt;var&gt;a&lt;/var&gt; is the {@linkplain #semiMajor semi major} axis 
length and
+ * &lt;var&gt;b&lt;/var&gt; is the {@linkplain #semiMinor semi minor} axis 
length.</pre></td></tr>
+<tr><td><pre>*         &lt;ul&gt;
+*           &lt;li&gt;"semi_major" (mandatory: no default)&lt;/li&gt;
+*           &lt;li&gt;"semi_minor" (mandatory: no default)&lt;/li&gt;
+<span class="del">*           &lt;li&gt;"central_meridian"   (default to 
0°)&lt;/li&gt;</span>
+<span class="del">*           &lt;li&gt;"latitude_of_origin" (default to 
0°)&lt;/li&gt;</span>
+*           &lt;li&gt;"scale_factor"       (default to 1 )&lt;/li&gt;
+*           &lt;li&gt;"false_easting"      (default to 0 )&lt;/li&gt;
+*           &lt;li&gt;"false_northing"     (default to 0 
)&lt;/li&gt;</pre></td>
+<td><pre>*         &lt;ul&gt;
+*           &lt;li&gt;"semi_major" (mandatory: no default)&lt;/li&gt;
+*           &lt;li&gt;"semi_minor" (mandatory: no default)&lt;/li&gt;
+<span class="add">*           &lt;li&gt;"central_meridian"   (default to 
0�)&lt;/li&gt;</span>
+<span class="add">*           &lt;li&gt;"latitude_of_origin" (default to 
0�)&lt;/li&gt;</span>
+*           &lt;li&gt;"scale_factor"       (default to 1 )&lt;/li&gt;
+*           &lt;li&gt;"false_easting"      (default to 0 )&lt;/li&gt;
+*           &lt;li&gt;"false_northing"     (default to 0 
)&lt;/li&gt;</pre></td></tr>
+<tr><td><pre>/*
+ * Makes sure that the longitude before conversion stay within +/- PI radians. 
As a
+ * special case, we do not check the range if no rotation were applied on the 
longitude.
+<span class="del"> * This is because the user may have a big area ranging from 
-180° to +180°. With the</span>
+<span class="del"> * slight rounding errors related to map projections, the 
180° longitude may be slightly</span>
+ * over the limit. Rolling the longitude would changes its sign. For example a 
bounding
+<span class="del"> * box from 30° to +180° would become 30° to -180°, 
which is probably not what the user</span>
+ * wanted.
+ */
+ptDst = transformNormalized(centralMeridian!=0 ?</pre></td>
+<td><pre>/*
+ * Makes sure that the longitude before conversion stay within +/- PI radians. 
As a
+ * special case, we do not check the range if no rotation were applied on the 
longitude.
+<span class="add"> * This is because the user may have a big area ranging from 
-180� to +180�. With the</span>
+<span class="add"> * slight rounding errors related to map projections, the 
180� longitude may be slightly</span>
+ * over the limit. Rolling the longitude would changes its sign. For example a 
bounding
+<span class="add"> * box from 30� to +180� would become 30� to 
-180�, which is probably not what the user</span>
+ * wanted.
+ */
+ptDst = transformNormalized(centralMeridian!=0 ?</pre></td></tr>
+<tr><td><pre>    throws ProjectionException
+{
+    /*
+<span class="del">     * Vérifie s'il faudra parcourir le tableau en sens 
inverse.</span>
+     * Ce sera le cas si les tableaux source et destination se
+<span class="del">     * chevauchent et que la destination est après la 
source.</span>
+     */
+    final boolean reverse = (src==dest &amp;&amp; srcOffset&lt;dstOffset 
&amp;&amp;
+                             srcOffset+(2*numPts) &gt; dstOffset);</pre></td>
+<td><pre>    throws ProjectionException
+{
+    /*
+<span class="add">     * V�rifie s'il faudra parcourir le tableau en sens 
inverse.</span>
+     * Ce sera le cas si les tableaux source et destination se
+<span class="add">     * chevauchent et que la destination est apr�s la 
source.</span>
+     */
+    final boolean reverse = (src==dest &amp;&amp; srcOffset&lt;dstOffset 
&amp;&amp;
+                             srcOffset+(2*numPts) &gt; 
dstOffset);</pre></td></tr>
+<tr><td><pre>/*
+ * Makes sure that the longitude after conversion stay within +/- PI radians. 
As a
+ * special case, we do not check the range if no rotation were applied on the 
longitude.
+<span class="del"> * This is because the user may have a big area ranging from 
-180° to +180°. With the</span>
+<span class="del"> * slight rounding errors related to map projections, the 
180° longitude may be slightly</span>
+ * over the limit. Rolling the longitude would changes its sign. For example a 
bounding
+<span class="del"> * box from 30° to +180° would become 30° to -180°, 
which is probably not what the user</span>
+ * wanted.
+ */
+final double x = Math.toDegrees(centralMeridian!=0 ?</pre></td>
+<td><pre>/*
+ * Makes sure that the longitude after conversion stay within +/- PI radians. 
As a
+ * special case, we do not check the range if no rotation were applied on the 
longitude.
+<span class="add"> * This is because the user may have a big area ranging from 
-180� to +180�. With the</span>
+<span class="add"> * slight rounding errors related to map projections, the 
180� longitude may be slightly</span>
+ * over the limit. Rolling the longitude would changes its sign. For example a 
bounding
+<span class="add"> * box from 30� to +180� would become 30� to 
-180�, which is probably not what the user</span>
+ * wanted.
+ */
+final double x = Math.toDegrees(centralMeridian!=0 ?</pre></td></tr>
+<tr><td><pre>        throws TransformException
+{
+    /*
+<span class="del">     * Vérifie s'il faudra parcourir le tableau en sens 
inverse.</span>
+     * Ce sera le cas si les tableaux source et destination se
+<span class="del">     * chevauchent et que la destination est après la 
source.</span>
+     */
+    final boolean reverse = (src==dest &amp;&amp; srcOffset&lt;dstOffset 
&amp;&amp;
+                             srcOffset+(2*numPts) &gt; dstOffset);</pre></td>
+<td><pre>        throws TransformException
+{
+    /*
+<span class="add">     * V�rifie s'il faudra parcourir le tableau en sens 
inverse.</span>
+     * Ce sera le cas si les tableaux source et destination se
+<span class="add">     * chevauchent et que la destination est apr�s la 
source.</span>
+     */
+    final boolean reverse = (src==dest &amp;&amp; srcOffset&lt;dstOffset 
&amp;&amp;
+                             srcOffset+(2*numPts) &gt; 
dstOffset);</pre></td></tr>
+<tr><td><pre>}
+
+/**
+<span class="del"> * Compute function &lt;code&gt;f(s,c,e²) = c/sqrt(1 - 
s²&amp;times;e²)&lt;/code&gt; needed for the true scale</span>
+ * latitude (Snyder 14-15), where &lt;var&gt;s&lt;/var&gt; and 
&lt;var&gt;c&lt;/var&gt; are the sine and cosine of
+<span class="del"> * the true scale latitude, and &lt;var&gt;e²&lt;/var&gt; 
is the {@linkplain #excentricitySquared</span>
+ * eccentricity squared}.
+ */
+final double msfn(final double s, final double c) {</pre></td>
+<td><pre>}
+
+/**
+<span class="add"> * Compute function &lt;code&gt;f(s,c,e�) = c/sqrt(1 - 
s�&amp;times;e�)&lt;/code&gt; needed for the true scale</span>
+ * latitude (Snyder 14-15), where &lt;var&gt;s&lt;/var&gt; and 
&lt;var&gt;c&lt;/var&gt; are the sine and cosine of
+<span class="add"> * the true scale latitude, and 
&lt;var&gt;e�&lt;/var&gt; is the {@linkplain #excentricitySquared</span>
+ * eccentricity squared}.
+ */
+final double msfn(final double s, final double c) {</pre></td></tr>
+<tr><td><pre>/**
+ * The operation parameter descriptor for the {@linkplain #centralMeridian 
central meridian}
+<span class="del"> * parameter value. Valid values range is from -180 to 
180°. Default value is 0.</span>
+ */
+public static final ParameterDescriptor CENTRAL_MERIDIAN = createDescriptor(
+        new NamedIdentifier[] {</pre></td>
+<td><pre>/**
+ * The operation parameter descriptor for the {@linkplain #centralMeridian 
central meridian}
+<span class="add"> * parameter value. Valid values range is from -180 to 
180�. Default value is 0.</span>
+ */
+public static final ParameterDescriptor CENTRAL_MERIDIAN = createDescriptor(
+        new NamedIdentifier[] {</pre></td></tr>
+<tr><td><pre>/**
+ * The operation parameter descriptor for the {@linkplain #latitudeOfOrigin 
latitude of origin}
+<span class="del"> * parameter value. Valid values range is from -90 to 90°. 
Default value is 0.</span>
+ */
+public static final ParameterDescriptor LATITUDE_OF_ORIGIN = createDescriptor(
+        new NamedIdentifier[] {</pre></td>
+<td><pre>/**
+ * The operation parameter descriptor for the {@linkplain #latitudeOfOrigin 
latitude of origin}
+<span class="add"> * parameter value. Valid values range is from -90 to 
90�. Default value is 0.</span>
+ */
+public static final ParameterDescriptor LATITUDE_OF_ORIGIN = createDescriptor(
+        new NamedIdentifier[] {</pre></td></tr>
+<tr><td><pre>/**
+ * The operation parameter descriptor for the {@linkplain 
Mercator#standardParallel standard
+<span class="del"> * parallel} parameter value. Valid values range is from -90 
to 90°. Default value is 0.</span>
+ */
+public static final ParameterDescriptor STANDARD_PARALLEL = createDescriptor(
+        new NamedIdentifier[] {</pre></td>
+<td><pre>/**
+ * The operation parameter descriptor for the {@linkplain 
Mercator#standardParallel standard
+<span class="add"> * parallel} parameter value. Valid values range is from -90 
to 90�. Default value is 0.</span>
+ */
+public static final ParameterDescriptor STANDARD_PARALLEL = createDescriptor(
+        new NamedIdentifier[] {</pre></td></tr>
+<tr><td><pre>/**
+ * The operation parameter descriptor for the standard parallel 1 parameter 
value.
+<span class="del"> * Valid values range is from -90 to 90°. Default value is 
0.</span>
+ */
+public static final ParameterDescriptor STANDARD_PARALLEL_1 = createDescriptor(
+        new NamedIdentifier[] {</pre></td>
+<td><pre>/**
+ * The operation parameter descriptor for the standard parallel 1 parameter 
value.
+<span class="add"> * Valid values range is from -90 to 90�. Default value 
is 0.</span>
+ */
+public static final ParameterDescriptor STANDARD_PARALLEL_1 = createDescriptor(
+        new NamedIdentifier[] {</pre></td></tr>
+<tr><td><pre>/**
+ * The operation parameter descriptor for the standard parallel 2 parameter 
value.
+<span class="del"> * Valid values range is from -90 to 90°. Default value is 
0.</span>
+ */
+public static final ParameterDescriptor STANDARD_PARALLEL_2 = 
createOptionalDescriptor(
+        new NamedIdentifier[] {</pre></td>
+<td><pre>/**
+ * The operation parameter descriptor for the standard parallel 2 parameter 
value.
+<span class="add"> * Valid values range is from -90 to 90�. Default value 
is 0.</span>
+ */
+public static final ParameterDescriptor STANDARD_PARALLEL_2 = 
createOptionalDescriptor(
+        new NamedIdentifier[] {</pre></td></tr>
+<tr><td><pre>    new NamedIdentifier(Citations.OGC,     "false_easting"),
+    new NamedIdentifier(Citations.EPSG,    "False easting"),
+    new NamedIdentifier(Citations.EPSG,    "Easting at false origin"),
+    new NamedIdentifier(Citations.GEOTIFF, "FalseEasting")
+},
+0, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METER);</pre></td>
+<td><pre>    new NamedIdentifier(Citations.OGC,     "false_easting"),
+    new NamedIdentifier(Citations.EPSG,    "False easting"),
+    new NamedIdentifier(Citations.EPSG,    "Easting at false origin"),
+<span class="add">    new NamedIdentifier(Citations.EPSG,    "Easting at 
projection centre"),</span>
+    new NamedIdentifier(Citations.GEOTIFF, "FalseEasting")
+},
+0, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, 
SI.METER);</pre></td></tr>
+<tr><td><pre>    new NamedIdentifier(Citations.OGC,     "false_northing"),
+    new NamedIdentifier(Citations.EPSG,    "False northing"),
+    new NamedIdentifier(Citations.EPSG,    "Northing at false origin"),
+    new NamedIdentifier(Citations.GEOTIFF, "FalseNorthing")
+},
+0, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, SI.METER);</pre></td>
+<td><pre>    new NamedIdentifier(Citations.OGC,     "false_northing"),
+    new NamedIdentifier(Citations.EPSG,    "False northing"),
+    new NamedIdentifier(Citations.EPSG,    "Northing at false origin"),
+<span class="add">    new NamedIdentifier(Citations.EPSG,    "Northing at 
projection centre"),</span>
+    new NamedIdentifier(Citations.GEOTIFF, "FalseNorthing")
+},
+0, Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY, 
SI.METER);</pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/23993/MapProjection.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/rev/23993/MapProjection.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: sis/ip-review/rev/25606/HEADER.html
URL: 
http://svn.apache.org/viewvc/sis/ip-review/rev/25606/HEADER.html?rev=1667056&view=auto
==============================================================================
--- sis/ip-review/rev/25606/HEADER.html (added)
+++ sis/ip-review/rev/25606/HEADER.html Mon Mar 16 16:18:13 2015
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml";>
+  <head>
+    <meta charset="UTF-8"/>
+    <title>Revision 25606</title>
+  </head>
+  <body>
+    <div>
+      <h1>Revision 25606</h1>
+<table>
+  <tr><td><b>Author:</b></td><td>simboss</td></tr>
+  <tr><td><b>Date:</b></td><td>2007-05-21</td></tr>
+  <tr><td><b>Message:</b></td><td>-added support on trunk for the latitude of 
origin parameter for Mercator1SP and Mercator2SP</td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/25606/HEADER.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/rev/25606/HEADER.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: sis/ip-review/rev/25606/Mercator.xhtml
URL: 
http://svn.apache.org/viewvc/sis/ip-review/rev/25606/Mercator.xhtml?rev=1667056&view=auto
==============================================================================
--- sis/ip-review/rev/25606/Mercator.xhtml (added)
+++ sis/ip-review/rev/25606/Mercator.xhtml Mon Mar 16 16:18:13 2015
@@ -0,0 +1,144 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml";>
+  <head>
+    <meta charset="UTF-8"/>
+    <title>Mercator changes for revisions 25605:25606</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>Mercator changes for revisions 25605:25606</h1>
+
+<p>The correction factor applied in this commit is the same correction factor 
than the one published in the formula
+of EPSG:9805 - <cite>Mercator (variant B)</cite> (a.k.a. <cite>Mercator 
(2SP)</cite>). Consequently after reverting
+this commit, the same correction factor is re-introduced as a side effect of 
<cite>Mercator (2SP)</cite> implementation,
+except that Apache SIS computes this factor once for ever at construction time 
and combines it with the global scale factor.</p>
+
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change 
--ignore-all-space --ignore-eol-style" -r25605:25606 
http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/Mercator.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 25605</th><th>Revision 25606</th></tr>
+<tr><td><pre>        // No standard parallel. Instead, uses the scale factor 
explicitely provided.
+        standardParallel = Double.NaN;
+    }
+<span class="del">    assert latitudeOfOrigin == 0 : latitudeOfOrigin;</span>
+}
+
+/**</pre></td>
+<td><pre>        // No standard parallel. Instead, uses the scale factor 
explicitely provided.
+        standardParallel = Double.NaN;
+    }
+}
+
+/**</pre></td></tr>
+<tr><td><pre>            ErrorKeys.POLE_PROJECTION_$1, new 
Latitude(Math.toDegrees(y))));
+}
+
+<span class="del">y = - Math.log(tsfn(y, Math.sin(y)));</span>
+
+if (ptDst != null) {
+    ptDst.setLocation(x,y);
+    return ptDst;</pre></td>
+<td><pre>             ErrorKeys.POLE_PROJECTION_$1, new 
Latitude(Math.toDegrees(y))));
+ }
+
+<span class="add"> // 
/////////////////////////////////////////////////////////////////////</span>
+<span class="add">//</span>
+<span class="add">// This correction allows us to employs a latitude of origin 
that is not</span>
+<span class="add">// correspondent to the equator. See Snyderet al. for 
reference, page</span>
+<span class="add">// 47.</span>
+<span class="add">//</span>
+<span class="add">// 
/////////////////////////////////////////////////////////////////////</span>
+<span class="add">final double sinPhi = Math.sin(latitudeOfOrigin);</span>
+<span class="add">final double scaleCorrection = 
(Math.cos(this.latitudeOfOrigin) / (Math</span>
+<span class="add">   .sqrt(1 - this.excentricitySquared * sinPhi * 
sinPhi)));</span>
+
+<span class="add"> x*=scaleCorrection;</span>
+<span class="add">y = -Math.log(tsfn(y, Math.sin(y)))</span>
+<span class="add">   * scaleCorrection;</span>
+<span class="add"></span>
+ if (ptDst != null) {
+     ptDst.setLocation(x,y);
+     return ptDst;</pre></td></tr>
+<tr><td><pre>protected Point2D inverseTransformNormalized(double x, double y, 
final Point2D ptDst)
+        throws ProjectionException
+{
+    y = Math.exp(-y);
+    y = cphi2(y);</pre></td>
+<td><pre>protected Point2D inverseTransformNormalized(double x, double y, 
final Point2D ptDst)
+        throws ProjectionException
+{
+<span class="add">    // 
/////////////////////////////////////////////////////////////////////</span>
+<span class="add">   //</span>
+<span class="add">   // This correction allows us to employs a latitude of 
origin that is not</span>
+<span class="add">   // correspondent to the equator. See Snyderet al. for 
reference, page</span>
+<span class="add">   // 47.</span>
+<span class="add">   //</span>
+<span class="add">   // 
/////////////////////////////////////////////////////////////////////</span>
+<span class="add">   final double sinPhi = Math.sin(latitudeOfOrigin);</span>
+<span class="add">   final double scaleCorrection = 
(Math.cos(this.latitudeOfOrigin) / (Math</span>
+<span class="add">      .sqrt(1 - this.excentricitySquared * sinPhi * 
sinPhi)));</span>
+<span class="add">   y/=scaleCorrection;</span>
+<span class="add">   x/=scaleCorrection;</span>
+<span class="add"></span>
+    y = Math.exp(-y);
+    y = cphi2(y);</pre></td></tr>
+<tr><td><pre>// Compute using ellipsoidal formulas, for comparaison later.
+assert (ptDst = super.transformNormalized(x, y, ptDst)) != null;
+
+<span class="del">y = Math.log(Math.tan((Math.PI/4) + 0.5*y));</span>
+
+assert checkTransform(x, y, ptDst);
+if (ptDst != null) {
+    ptDst.setLocation(x,y);</pre></td>
+<td><pre> // Compute using ellipsoidal formulas, for comparaison later.
+ assert (ptDst = super.transformNormalized(x, y, ptDst)) != null;
+
+<span class="add"> // 
/////////////////////////////////////////////////////////////////////</span>
+<span class="add">//</span>
+<span class="add">// This correction allows us to employs a latitude of origin 
that is not</span>
+<span class="add">// correspondent to the equator. See Snyderet al. for 
reference, page</span>
+<span class="add">// 47.</span>
+<span class="add">//</span>
+<span class="add">// 
/////////////////////////////////////////////////////////////////////</span>
+<span class="add">final double sinPhi = Math.sin(latitudeOfOrigin);</span>
+<span class="add">final double scaleCorrection = 
(Math.cos(this.latitudeOfOrigin) / (Math</span>
+<span class="add">   .sqrt(1 - this.excentricitySquared * sinPhi * 
sinPhi)));</span>
+
+<span class="add"> x*=scaleCorrection;</span>
+<span class="add"> y = Math.log(Math.tan((Math.PI/4) + 
0.5*y))*scaleCorrection;</span>
+<span class="add"></span>
+ assert checkTransform(x, y, ptDst);
+ if (ptDst != null) {
+     ptDst.setLocation(x,y);</pre></td></tr>
+<tr><td><pre>// Compute using ellipsoidal formulas, for comparaison later.
+assert (ptDst = super.inverseTransformNormalized(x, y, ptDst)) != null;
+
+y = (Math.PI/2) - 2.0*Math.atan(Math.exp(-y));
+
+assert checkInverseTransform(x, y, ptDst);</pre></td>
+<td><pre> // Compute using ellipsoidal formulas, for comparaison later.
+ assert (ptDst = super.inverseTransformNormalized(x, y, ptDst)) != null;
+
+<span class="add"> // 
/////////////////////////////////////////////////////////////////////</span>
+<span class="add">//</span>
+<span class="add">// This correction allows us to employs a latitude of origin 
that is not</span>
+<span class="add">// correspondent to the equator. See Snyderet al. for 
reference, page</span>
+<span class="add">// 47.</span>
+<span class="add">//</span>
+<span class="add">// 
/////////////////////////////////////////////////////////////////////</span>
+<span class="add">final double sinPhi = Math.sin(latitudeOfOrigin);</span>
+<span class="add">final double scaleCorrection = 
(Math.cos(this.latitudeOfOrigin) / (Math</span>
+<span class="add">   .sqrt(1 - this.excentricitySquared * sinPhi * 
sinPhi)));</span>
+<span class="add">x/=scaleCorrection;</span>
+<span class="add">y/=scaleCorrection;</span>
+<span class="add"></span>
+ y = (Math.PI/2) - 2.0*Math.atan(Math.exp(-y));
+
+ assert checkInverseTransform(x, y, ptDst);</pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/25606/Mercator.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/rev/25606/Mercator.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: sis/ip-review/rev/25606/Mercator1SP.xhtml
URL: 
http://svn.apache.org/viewvc/sis/ip-review/rev/25606/Mercator1SP.xhtml?rev=1667056&view=auto
==============================================================================
--- sis/ip-review/rev/25606/Mercator1SP.xhtml (added)
+++ sis/ip-review/rev/25606/Mercator1SP.xhtml Mon Mar 16 16:18:13 2015
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml";>
+  <head>
+    <meta charset="UTF-8"/>
+    <title>Mercator1SP changes for revisions 25605:25606</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>Mercator1SP changes for revisions 25605:25606</h1>
+
+<p>Reverting this commit causes a JUnit test failure when comparing our 
parameters with the ones declared in the EPSG
+database for operation method EPSG:9804. The error is fixed by reintroducing 
this parameter as indicated by the error
+message in the test failure.</p>
+
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change 
--ignore-all-space --ignore-eol-style" -r25605:25606 
http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/Mercator1SP.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 25605</th><th>Revision 25606</th></tr>
+<tr><td><pre>    new NamedIdentifier(Citations.GEOTOOLS, 
Vocabulary.formatInternational(
+                        VocabularyKeys.CYLINDRICAL_MERCATOR_PROJECTION))
+}, new ParameterDescriptor[] {
+<span class="del">    SEMI_MAJOR,       SEMI_MINOR,</span>
+    CENTRAL_MERIDIAN, SCALE_FACTOR,
+    FALSE_EASTING,    FALSE_NORTHING
+});</pre></td>
+<td><pre>    new NamedIdentifier(Citations.GEOTOOLS, 
Vocabulary.formatInternational(
+                        VocabularyKeys.CYLINDRICAL_MERCATOR_PROJECTION))
+}, new ParameterDescriptor[] {
+<span class="add">    SEMI_MAJOR,       SEMI_MINOR,LATITUDE_OF_ORIGIN,</span>
+    CENTRAL_MERIDIAN, SCALE_FACTOR,
+    FALSE_EASTING,    FALSE_NORTHING
+});</pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/25606/Mercator1SP.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/rev/25606/Mercator1SP.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: sis/ip-review/rev/25606/Mercator2SP.xhtml
URL: 
http://svn.apache.org/viewvc/sis/ip-review/rev/25606/Mercator2SP.xhtml?rev=1667056&view=auto
==============================================================================
--- sis/ip-review/rev/25606/Mercator2SP.xhtml (added)
+++ sis/ip-review/rev/25606/Mercator2SP.xhtml Mon Mar 16 16:18:13 2015
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml";>
+  <head>
+    <meta charset="UTF-8"/>
+    <title>Mercator2SP changes for revisions 25605:25606</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>Mercator2SP changes for revisions 25605:25606</h1>
+
+<p>This change will be omitted in Apache SIS, since "Latitude of natural 
origin" is not a parameter for EPSG:9805
+coordinate operation method.</p>
+
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change 
--ignore-all-space --ignore-eol-style" -r25605:25606 
http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/Mercator2SP.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 25605</th><th>Revision 25606</th></tr>
+<tr><td><pre>                        
VocabularyKeys.CYLINDRICAL_MERCATOR_PROJECTION))
+}, new ParameterDescriptor[] {
+    SEMI_MAJOR,       SEMI_MINOR,
+<span class="del">    CENTRAL_MERIDIAN, STANDARD_PARALLEL,</span>
+    FALSE_EASTING,    FALSE_NORTHING
+});</pre></td>
+<td><pre>                        
VocabularyKeys.CYLINDRICAL_MERCATOR_PROJECTION))
+}, new ParameterDescriptor[] {
+    SEMI_MAJOR,       SEMI_MINOR,
+<span class="add">    CENTRAL_MERIDIAN, 
STANDARD_PARALLEL,LATITUDE_OF_ORIGIN,</span>
+    FALSE_EASTING,    FALSE_NORTHING
+});</pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/25606/Mercator2SP.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/rev/25606/Mercator2SP.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: sis/ip-review/rev/29681/HEADER.html
URL: 
http://svn.apache.org/viewvc/sis/ip-review/rev/29681/HEADER.html?rev=1667056&view=auto
==============================================================================
--- sis/ip-review/rev/29681/HEADER.html (added)
+++ sis/ip-review/rev/29681/HEADER.html Mon Mar 16 16:18:13 2015
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml";>
+  <head>
+    <meta charset="UTF-8"/>
+    <title>Revision 29681</title>
+  </head>
+  <body>
+    <div>
+      <h1>Revision 29681</h1>
+<table>
+  <tr><td><b>Author:</b></td><td>aaime</td></tr>
+  <tr><td><b>Date:</b></td><td>2008-03-20</td></tr>
+  <tr><td><b>Message:</b></td><td>GEOT-1745, MapProjection: relax coordinate 
checks/make them configurable</td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/29681/HEADER.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/rev/29681/HEADER.html
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: sis/ip-review/rev/29681/MapProjection.xhtml
URL: 
http://svn.apache.org/viewvc/sis/ip-review/rev/29681/MapProjection.xhtml?rev=1667056&view=auto
==============================================================================
--- sis/ip-review/rev/29681/MapProjection.xhtml (added)
+++ sis/ip-review/rev/29681/MapProjection.xhtml Mon Mar 16 16:18:13 2015
@@ -0,0 +1,156 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml";>
+  <head>
+    <meta charset="UTF-8"/>
+    <title>MapProjection changes for revisions 29680:29681</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>MapProjection changes for revisions 29680:29681</h1>
+
+<p>Apache SIS will not contain those checks for the validity of input 
coordinates
+(we let the mathematic do their "natural" behavior for angles greater than 
90° of latitude or 180° of longitude - in
+many cases the result is still okay), so this change does not apply.</p>
+
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change 
--ignore-all-space --ignore-eol-style" -r29680:29681 
http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/MapProjection.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 29680</th><th>Revision 29681</th></tr>
+<tr><td><pre>import java.awt.geom.Point2D;
+import java.io.Serializable;
+import java.util.Collection;
+import javax.units.NonSI;
+import javax.units.SI;
+import javax.units.Unit;</pre></td>
+<td><pre>import java.awt.geom.Point2D;
+import java.io.Serializable;
+import java.util.Collection;
+<span class="add">import java.util.logging.Logger;</span>
+<span class="add"></span>
+import javax.units.NonSI;
+import javax.units.SI;
+import javax.units.Unit;</pre></td></tr>
+<tr><td><pre>import org.geotools.resources.XMath;
+import org.geotools.resources.i18n.Errors;
+import org.geotools.resources.i18n.ErrorKeys;
+
+
+/**</pre></td>
+<td><pre>import org.geotools.resources.XMath;
+import org.geotools.resources.i18n.Errors;
+import org.geotools.resources.i18n.ErrorKeys;
+<span class="add">import org.geotools.util.logging.Logging;</span>
+
+
+/**</pre></td></tr>
+<tr><td><pre>public abstract class MapProjection extends AbstractMathTransform
+                implements MathTransform2D, Serializable
+{
+    /**
+     * Maximum difference allowed when comparing real numbers.
+     */
+    private static final double EPSILON = 1E-6;</pre></td>
+<td><pre>public abstract class MapProjection extends AbstractMathTransform
+                implements MathTransform2D, Serializable
+{
+<span class="add"></span>
+    /**
+<span class="add">     * The projection package logger</span>
+<span class="add">     */</span>
+<span class="add">    protected static final Logger LOGGER = 
Logging.getLogger("org.geotools.referencing.operation.projection");</span>
+<span class="add"></span>
+<span class="add">    /**</span>
+     * Maximum difference allowed when comparing real numbers.
+     */
+    private static final double EPSILON = 1E-6;</pre></td></tr>
+<tr><td><pre>private transient MathTransform2D inverse;
+
+/**
+ * Constructs a new map projection from the suplied parameters.
+ *
+ * @param  values The parameter values in standard units.</pre></td>
+<td><pre>private transient MathTransform2D inverse;
+
+/**
+<span class="add"> * When true lat/lon coordinate ranges will be checked, and 
a WARNING log will be issued</span>
+<span class="add"> * if they are out of their natural ranges (-180/180 for 
longitude, -90/90 for latitude).&lt;br&gt;</span>
+<span class="add"> * To avoid excessive logging, this flag will be set to 
false after the first coordinate</span>
+<span class="add"> * failing the checks is found.</span>
+<span class="add"> */</span>
+<span class="add">protected boolean verifyCoordinateRanges = true;</span>
+<span class="add"></span>
+<span class="add">/**</span>
+ * Constructs a new map projection from the suplied parameters.
+ *
+ * @param  values The parameter values in standard units.</pre></td></tr>
+<tr><td><pre>public final Point2D transform(final Point2D ptSrc, Point2D 
ptDst) throws ProjectionException {
+    final double x = ptSrc.getX();
+    final double y = ptSrc.getY();
+    // Note: the following tests should not fails for NaN values.
+    if (x &lt; (Longitude.MIN_VALUE - ANGLE_TOLERANCE) || x &gt; 
(Longitude.MAX_VALUE + ANGLE_TOLERANCE)) {
+<span class="del">        throw new 
PointOutsideEnvelopeException(Errors.format(</span>
+<span class="del">                ErrorKeys.LONGITUDE_OUT_OF_RANGE_$1, new 
Longitude(x)));</span>
+    }
+    if (y &lt; (Latitude.MIN_VALUE - ANGLE_TOLERANCE) || y &gt; 
(Latitude.MAX_VALUE + ANGLE_TOLERANCE)) {
+<span class="del">        throw new 
PointOutsideEnvelopeException(Errors.format(</span>
+<span class="del">                ErrorKeys.LATITUDE_OUT_OF_RANGE_$1, new 
Latitude(y)));</span>
+    }
+    /*
+     * Makes sure that the longitude before conversion stay within +/- PI 
radians. As a
+     * special case, we do not check the range if no rotation were applied on 
the longitude.</pre></td>
+<td><pre>public final Point2D transform(final Point2D ptSrc, Point2D ptDst) 
throws ProjectionException {
+    final double x = ptSrc.getX();
+    final double y = ptSrc.getY();
+<span class="add"></span>
+<span class="add">    if(verifyCoordinateRanges) {</span>
+    // Note: the following tests should not fails for NaN values.
+    if (x &lt; (Longitude.MIN_VALUE - ANGLE_TOLERANCE) || x &gt; 
(Longitude.MAX_VALUE + ANGLE_TOLERANCE)) {
+<span class="add">            
LOGGER.warning(Errors.format(ErrorKeys.LONGITUDE_OUT_OF_RANGE_$1, new 
Longitude(x)));</span>
+<span class="add">            verifyCoordinateRanges = false;</span>
+    }
+    if (y &lt; (Latitude.MIN_VALUE - ANGLE_TOLERANCE) || y &gt; 
(Latitude.MAX_VALUE + ANGLE_TOLERANCE)) {
+<span class="add">            
LOGGER.warning(Errors.format(ErrorKeys.LATITUDE_OUT_OF_RANGE_$1, new 
Latitude(y)));</span>
+<span class="add">            verifyCoordinateRanges = false;</span>
+    }
+<span class="add">    }</span>
+    /*
+     * Makes sure that the longitude before conversion stay within +/- PI 
radians. As a
+     * special case, we do not check the range if no rotation were applied on 
the longitude.</pre></td></tr>
+<tr><td><pre>    ptDst.setLocation(x,y);
+
+    // Note: the following tests should not fails for NaN values.
+    if (x &lt; (Longitude.MIN_VALUE - ANGLE_TOLERANCE) || x &gt; 
(Longitude.MAX_VALUE + ANGLE_TOLERANCE)) {
+<span class="del">        throw new 
PointOutsideEnvelopeException(Errors.format(</span>
+<span class="del">                ErrorKeys.LONGITUDE_OUT_OF_RANGE_$1, new 
Longitude(x)));</span>
+    }
+    if (y &lt; (Latitude.MIN_VALUE - ANGLE_TOLERANCE) || y &gt; 
(Latitude.MAX_VALUE + ANGLE_TOLERANCE)) {
+<span class="del">        throw new 
PointOutsideEnvelopeException(Errors.format(</span>
+<span class="del">                ErrorKeys.LATITUDE_OUT_OF_RANGE_$1, new 
Latitude(y)));</span>
+    }
+    assert checkReciprocal(ptDst, (ptSrc!=ptDst) ? ptSrc : new 
Point2D.Double(x0, y0), false);
+    return ptDst;
+}</pre></td>
+<td><pre>    ptDst.setLocation(x,y);
+
+    // Note: the following tests should not fails for NaN values.
+<span class="add">    if(verifyCoordinateRanges) {</span>
+<span class="add">        // Note: the following tests should not fails for 
NaN values.</span>
+    if (x &lt; (Longitude.MIN_VALUE - ANGLE_TOLERANCE) || x &gt; 
(Longitude.MAX_VALUE + ANGLE_TOLERANCE)) {
+<span class="add">            
LOGGER.warning(Errors.format(ErrorKeys.LONGITUDE_OUT_OF_RANGE_$1, new 
Longitude(x)));</span>
+<span class="add">            verifyCoordinateRanges = false;</span>
+    }
+    if (y &lt; (Latitude.MIN_VALUE - ANGLE_TOLERANCE) || y &gt; 
(Latitude.MAX_VALUE + ANGLE_TOLERANCE)) {
+<span class="add">            
LOGGER.warning(Errors.format(ErrorKeys.LATITUDE_OUT_OF_RANGE_$1, new 
Latitude(y)));</span>
+<span class="add">            verifyCoordinateRanges = false;</span>
+    }
+<span class="add">    }</span>
+    assert checkReciprocal(ptDst, (ptSrc!=ptDst) ? ptSrc : new 
Point2D.Double(x0, y0), false);
+    return ptDst;
+}</pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/29681/MapProjection.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/rev/29681/MapProjection.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/html


Reply via email to