sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1691145 - in /sis/ip-review: ./ rev/09153/ rev/10796/ rev/11697/ rev/20874/
Date Wed, 15 Jul 2015 08:31:14 GMT
Author: desruisseaux
Date: Wed Jul 15 08:31:14 2015
New Revision: 1691145

URL: http://svn.apache.org/r1691145
Log:
Added IP review. In this case, this is partially for information purpose only because the file reviewed in this commit uses the USGS formulas,
while the file to be ported to SIS will be rewritten for using the "JHS formulas" reproduced in IOGP Publication 373-7-2:
Geomatics Guidance Note number 7, part 2 (April 2015). An exception is the formulas for the Spherical case, which stay the same.

Added:
    sis/ip-review/TransverseMercator.xhtml   (with props)
    sis/ip-review/rev/09153/
    sis/ip-review/rev/09153/HEADER.html   (with props)
    sis/ip-review/rev/09153/TransverseMercator.xhtml   (with props)
    sis/ip-review/rev/10796/TransverseMercator.xhtml   (with props)
    sis/ip-review/rev/11697/
    sis/ip-review/rev/11697/HEADER.html   (with props)
    sis/ip-review/rev/11697/TransverseMercator.xhtml   (with props)
    sis/ip-review/rev/20874/TransverseMercator.xhtml   (with props)

Added: sis/ip-review/TransverseMercator.xhtml
URL: http://svn.apache.org/viewvc/sis/ip-review/TransverseMercator.xhtml?rev=1691145&view=auto
==============================================================================
--- sis/ip-review/TransverseMercator.xhtml (added)
+++ sis/ip-review/TransverseMercator.xhtml Wed Jul 15 08:31:14 2015
@@ -0,0 +1,78 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>TransverseMercator history</title>
+    <style type="text/css" media="all">
+      @import url("./reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>TransverseMercator history</h1>
+  <p>Click on the commit message for inspecting the <code>diff</code> and how the code has been rewritten.</p>
+<p><b>Command line:</b></p>
+<blockquote><code>svn log -r31996:1 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/TransverseMercator.java</code></blockquote>
+<table>
+  <tr>
+    <th>Rev.</th>
+    <th>Date</th>
+    <th>Author</th>
+    <th class="last">Message</th>
+  </tr>
+<tr><td class="rev">30641</td><td>2008-06-12</td><td>acuster</td><td>Copyright headers: lib/referencing, this time with feeling (and the el in Toolkit)</td></tr>
+<tr><td class="rev">30639</td><td>2008-06-12</td><td>acuster</td><td>Copyright headers: cleanup library/referencing</td></tr>
+<tr><td class="rev">30521</td><td>2008-06-05</td><td>acuster</td><td>Copyright: Update referencing headers</td></tr>
+<tr><td class="rev">30258</td><td>2008-05-08</td><td>acuster</td><td>Reshuffle the top level repo: drop uDig, move up trunk, tags, and branches.</td></tr>
+<tr><td class="rev">30257</td><td>2008-05-08</td><td>acuster</td><td>Move trunk/gt/ directory contents up to trunk/ and drop gt</td></tr>
+<tr><td class="rev">29955</td><td>2008-04-17</td><td>desruisseaux</td><td>Added a paranoiac check for CRS.transform(CoordinateOperation, ...) working on envelopes crossing axis extremums. Fixed a NoSuchElementException in MosaicImageReader when the requested region has no tiles. Fixed a NullPointerException in MosaicImageWriter when the allowed memory is smaller than the area of the smallest tile.</td></tr>
+<tr><td class="rev">29723</td><td>2008-03-27</td><td>desruisseaux</td><td>Added serialVersionIUD in MapProjection with values computed from the 2.4.1 release for cross-version compatibility. NewZealandMapGrid now creates Complex object in method body on the assumption that modern compilers can allocate on stack. Provides a way to reinitialize the warnings for every MapProjections in a JVM. Formatting.</td></tr>
+<tr><td class="rev">29711</td><td>2008-03-25</td><td>desruisseaux</td><td>In MapProjection, provide more information in the logged warning (especially the projection name) in order to compensate for the loss of stack trace. In subclasses, replaced "Math." occurences by a static import for readability (there is a lot of sin(x), cos(x), sqrt(x) etc. calls in those classes). Also replaced sqrt(x*x + y*y) by hypot(x,y) and (exp(x)-exp(-x))/2 by sinh(x) which are new functions in Java 5 (hopefully more accurate and/or faster). Applied some Java 5 language syntax (generic types and @Override annotation).</td></tr>
+<tr><td class="rev">28922</td><td>2008-01-24</td><td>acuster</td><td>Bump the (at)since version to 2.5 since WKTParser was cut from 2.4</td></tr>
+<tr><td class="rev">28540</td><td>2007-12-29</td><td>acuster</td><td>Hide buttons which are not yet used</td></tr>
+<tr><td class="rev">27575</td><td>2007-10-22</td><td>desruisseaux</td><td>Converted Java source files from ISO-LATIN-1 encoding to UTF-8 (GEOT-1516).</td></tr>
+<tr><td class="rev">25262</td><td>2007-04-23</td><td>desruisseaux</td><td>Finished review of metadata and factory hints change. Fixed a potential glitch in parameter names handling (some code were disabled in AbstractIdentifiedObject apparently in order to avoid a ClassCastException caused by the spit of org.opengis.metadata.Identifier in two interfaces, Identifier and ReferenceIdentifier. Fixed the exception and reenabled the code). Not sure yet what the consequence was. It may help for the stereographic projection issue, but need to check.</td></tr>
+<tr><td class="rev">24384</td><td>2007-02-14</td><td>desruisseaux</td><td>GEOT-1160: First working implementation of AbstractAuthorityFactory.find(IdentifiedObject). This includes a package-privated AuthorityFactoryProxy class, together with many fix in the code base in order to get CRS.equalsIgnoreCase to work in the ProjectedCRS case.</td></tr>
+<tr><td class="rev">24333</td><td>2007-02-10</td><td>desruisseaux</td><td>GEOT-786: Rearrange projection constructors and providers, especially in orthographic and stereographic projection.</td></tr>
+<tr><td class="rev">22474</td><td>2006-10-31</td><td>desruisseaux</td><td>Added a test script for Lambert Azimuthal Equal Area (actually Rueben's work). Bug fixes and minor cleaning in the projection package.</td></tr>
+<tr><td class="rev">22327</td><td>2006-10-23</td><td>desruisseaux</td><td>GEOT-982: regroup 'module', 'plugin', 'ext' and 'unsupported' in a common directory.</td></tr>
+<tr><td class="rev">22315</td><td>2006-10-22</td><td>desruisseaux</td><td>Reorganisation of directory tree structure (GEOT-982) phase 1: moved 'src' to 'src/main/java'.</td></tr>
+<tr><td class="rev">22295</td><td>2006-10-20</td><td>desruisseaux</td><td>Added Lambert Azimuthal Equal Area projection. Various minor cleaning in other projection related code.</td></tr>
+<tr><td class="rev">20874</td><td>2006-08-07</td><td class="unav">jgarnett</td><td><a href="rev/20874/TransverseMercator.xhtml">ip review</a></td></tr>
+<tr><td class="rev">20539</td><td>2006-07-14</td><td>desruisseaux</td><td>Relicensed the Proj.4 derived work under LGPL as permitted by Frank Warmerdam on geotools-devel mailing list on June 21, 2006.</td></tr>
+<tr><td class="rev">19769</td><td>2006-06-02</td><td>desruisseaux</td><td>Javadoc fix: replaced 'degrees' by 'decimal degrees' when relevant (GEOT-855)</td></tr>
+<tr><td class="rev">18517</td><td>2006-03-07</td><td>desruisseaux</td><td>Added 'Gauss_Kruger' to the alias list for transverse mercator projection. Translated some javadoc from French to English.</td></tr>
+<tr><td class="rev">17672</td><td>2006-01-19</td><td>desruisseaux</td><td>Added @source tag.</td></tr>
+<tr><td class="rev">17660</td><td>2006-01-18</td><td>desruisseaux</td><td>Fixed SVN attributes, including the addition of URL attribute.</td></tr>
+<tr><td class="rev">17241</td><td>2005-12-09</td><td>desruisseaux</td><td>Initial round of MapProjection constructors simplification (GEOT-786)</td></tr>
+<tr><td class="rev">16983</td><td>2005-11-25</td><td>desruisseaux</td><td>Replaced references to static fields and methods of CitationImpl.* by Citations.*</td></tr>
+<tr><td class="rev">16514</td><td>2005-10-25</td><td>desruisseaux</td><td>Added a check if order to use an 'Equirectangular' parameter group without 'latitude of origin' parameter if the latitude of origin is 0.</td></tr>
+<tr><td class="rev">16205</td><td>2005-10-11</td><td>desruisseaux</td><td>Cleaned javadoc warning. More work done on Maven 2 configuration (GEOT-691)</td></tr>
+<tr><td class="rev">15350</td><td>2005-08-16</td><td>desruisseaux</td><td>Merged the 'split-main' branch to trunk (GEOT-662)</td></tr>
+<tr><td class="rev">15256</td><td>2005-08-09</td><td>desruisseaux</td><td>Extraction of referencing module from main</td></tr>
+<tr><td class="rev">15255</td><td>2005-08-09</td><td>desruisseaux</td><td>Prepare branch for splitting main</td></tr>
+<tr><td class="rev">15150</td><td>2005-08-05</td><td>desruisseaux</td><td>Added more localizations / Bug fix in image sample values table widget</td></tr>
+<tr><td class="rev">14834</td><td>2005-07-20</td><td>desruisseaux</td><td>Reorganized I18N resources</td></tr>
+<tr><td class="rev">14581</td><td>2005-06-22</td><td>desruisseaux</td><td>Implemented South-Orientated transverse mercator / more GEOT-589 work</td></tr>
+<tr><td class="rev">13925</td><td>2005-05-30</td><td>desruisseaux</td><td>Added @since javadoc tag</td></tr>
+<tr><td class="rev">13922</td><td>2005-05-29</td><td>desruisseaux</td><td>Renaming of remainding GeoAPI implementations. Renaming is now finished.</td></tr>
+<tr><td class="rev">13853</td><td>2005-05-26</td><td>desruisseaux</td><td>Bug fix: arrays must be NamedIndentifier[], because it implements two interfaces</td></tr>
+<tr><td class="rev">13836</td><td>2005-05-26</td><td>desruisseaux</td><td>Added 'Default' suffix to some CRS implementations: partial work</td></tr>
+<tr><td class="rev">13773</td><td>2005-05-24</td><td>desruisseaux</td><td>Removed old metadata implementations (they are now renamed with 'Impl' suffix) / Use OGC citation instead of OPEN_GIS</td></tr>
+<tr><td class="rev">13752</td><td>2005-05-23</td><td>desruisseaux</td><td>Added the 'Impl' suffix to direct implementations of all metadata interfaces; deprecated the old implementations (not yet deleted).</td></tr>
+<tr><td class="rev">12020</td><td>2005-03-11</td><td>desruisseaux</td><td>First working version of Resampler2D port (side effect: GEOT-390 fix)</td></tr>
+<tr><td class="rev">11697</td><td>2005-02-28</td><td class="unav">rschulz</td><td><a href="rev/11697/TransverseMercator.xhtml">fixed small bug in spherical inverse, changed to Snyder's equations for calculating y in the spherical forward; overrode  getToleranceForAssertions() to deal with assertion errors, added getToleranceForSphereAssertions() to deal with assertion errors when comparing spherical calculations to elliptical</a></td></tr>
+<tr><td class="rev">11101</td><td>2005-02-04</td><td>desruisseaux</td><td>Renamed MapProjection.Provider as AbstractProvider</td></tr>
+<tr><td class="rev">11074</td><td>2005-02-03</td><td>desruisseaux</td><td>Revisited CRSFactory.createProjectedCRS(...) API</td></tr>
+<tr><td class="rev">11001</td><td>2005-02-02</td><td>desruisseaux</td><td>Fixed wrong encoding in main/src</td></tr>
+<tr><td class="rev">10944</td><td>2005-02-01</td><td>desruisseaux</td><td>Bug fix in ProjectedCRS: axis swapping and units conversion were not correctly handled</td></tr>
+<tr><td class="rev">10796</td><td>2005-01-28</td><td class="unav">dzwiers</td><td><a href="rev/10796/TransverseMercator.xhtml">imports cleaned</a></td></tr>
+<tr><td class="rev">9358</td><td>2004-11-30</td><td class="unav">rschulz</td><td><a href="rev/10796/TransverseMercator.xhtml">javadoc updates and typo fix in the Spherical class (extends Mercator changed to extends TransverseMercator</a></td></tr>
+<tr><td class="rev">9266</td><td>2004-11-23</td><td>desruisseaux</td><td>Last WKT tuning; parsing and formatting should now be functional</td></tr>
+<tr><td class="rev">9220</td><td>2004-11-21</td><td>desruisseaux</td><td>WKT bug fixes</td></tr>
+<tr><td class="rev">9199</td><td>2004-11-18</td><td>desruisseaux</td><td>Removed outdated 'Contacts' section in the copyright header</td></tr>
+<tr><td class="rev">9153</td><td>2004-11-18</td><td class="unav">rschulz</td><td><a href="rev/09153/TransverseMercator.xhtml">ported to geoapi referencing api</a></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/TransverseMercator.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/ip-review/TransverseMercator.xhtml
------------------------------------------------------------------------------
    svn:mime-type = text/html

Added: sis/ip-review/rev/09153/HEADER.html
URL: http://svn.apache.org/viewvc/sis/ip-review/rev/09153/HEADER.html?rev=1691145&view=auto
==============================================================================
--- sis/ip-review/rev/09153/HEADER.html (added)
+++ sis/ip-review/rev/09153/HEADER.html Wed Jul 15 08:31:14 2015
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>Revision 9153</title>
+  </head>
+  <body>
+    <div>
+      <h1>Revision 9153</h1>
+<table>
+  <tr><td><b>Author:</b></td><td>rschulz</td></tr>
+  <tr><td><b>Date:</b></td><td>2004-11-18</td></tr>
+  <tr><td><b>Message:</b></td><td>ported to geoapi referencing api</td></tr>
+</table>
+    </div>
+  </body>
+</html>

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

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

Added: sis/ip-review/rev/09153/TransverseMercator.xhtml
URL: http://svn.apache.org/viewvc/sis/ip-review/rev/09153/TransverseMercator.xhtml?rev=1691145&view=auto
==============================================================================
--- sis/ip-review/rev/09153/TransverseMercator.xhtml (added)
+++ sis/ip-review/rev/09153/TransverseMercator.xhtml Wed Jul 15 08:31:14 2015
@@ -0,0 +1,648 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>TransverseMercator changes for revisions 9152:9153</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>TransverseMercator changes for revisions 9152:9153</h1>
+
+<p>The class shown below has been ported from the SeaGIS project (which existed before GeoTools 2), for which we can relicense.
+But adaption work has been done by Rueben Schulz, which require us to get a contributor agreement from him if we can not separate
+his contribution from the original SeaGIS code.</p>
+
+<p>However the <code>TransverseMercator</code> class had to be rewritten anyway because the formulas changed.
+The formulas implemented below are from USGS, while the formulas implemented in Apache SIS are the "JHS formulas"
+reproduced in IOGP Publication 373-7-2 – Geomatics Guidance Note number 7, part 2 – April 2015.
+The commit history of the original <code>TransverseMercator</code> class is nevertheless shown here for information.</p>
+
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r9152:9153 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/TransverseMercator.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 9152</th><th>Revision 9153</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) 2002, Centre for Computational Geography</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"> * Contacts:</span>
+<span class="add"> *     UNITED KINGDOM: James Macgill</span>
+<span class="add"> *             mailto:j.macgill@geog.leeds.ac.uk</span>
+<span class="add"> *</span>
+<span class="add"> *     FRANCE: Surveillance de l'Environnement Assistée par Satellite</span>
+<span class="add"> *             Institut de Recherche pour le Développement / US-Espace</span>
+<span class="add"> *             mailto:seasnet@teledetection.fr</span>
+<span class="add"> *</span>
+<span class="add"> *     CANADA: Observatoire du Saint-Laurent</span>
+<span class="add"> *             Institut Maurice-Lamontagne</span>
+<span class="add"> *             mailto:osl@osl.gc.ca</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.ParameterDescriptor;</span>
+<span class="add">import org.opengis.parameter.ParameterValueGroup;</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.referencing.operation.MathTransform;</span>
+<span class="add"></span>
+<span class="add">// Geotools dependencies</span>
+<span class="add">import org.geotools.referencing.Identifier;</span>
+<span class="add">import org.geotools.metadata.citation.Citation;</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"> * Transverse Mercator Projection (EPSG code 9807). This</span>
+<span class="add"> * is a cylindrical projection, in which the cylinder has been rotated 90°.</span>
+<span class="add"> * Instead of being tangent to the equator (or to an other standard latitude),</span>
+<span class="add"> * it is tangent to a central meridian. Deformation are more important as we</span>
+<span class="add"> * are going futher from the central meridian. The Transverse Mercator</span>
+<span class="add"> * projection is appropriate for region wich have a greater extent north-south</span>
+<span class="add"> * than east-west.</span>
+<span class="add"> * &lt;br&gt;&lt;br&gt;</span>
+<span class="add"> *</span>
+<span class="add"> * The elliptical equations used here are series approximations, and their accuracy</span>
+<span class="add"> * decreases as points move farther from the central meridian of the projection.</span>
+<span class="add"> * The forward equations here are accurate to a less than a mm +- 10 degrees from</span>
+<span class="add"> * the central meridian, a few mm +- 15 degrees from the</span>
+<span class="add"> * central meridian and a few cm +- 20 degrees from the central meridian.</span>
+<span class="add"> * The spherical equations are not approximations and should always give the</span>
+<span class="add"> * correct values.</span>
+<span class="add"> * &lt;br&gt;&lt;br&gt;</span>
+<span class="add"> *</span>
+<span class="add"> * There are a number of versions of the transverse mercator projection</span>
+<span class="add"> * including the Universal (UTM) and Modified (MTM) Transverses Mercator</span>
+<span class="add"> * projections. In these cases the earth is divided into zones. For the UTM</span>
+<span class="add"> * the zones are 6 degrees wide, numbered from 1 to 60 proceeding east from</span>
+<span class="add"> * 180 degrees longitude, and between lats 84 degrees North and 80</span>
+<span class="add"> * degrees South. The central meridian is taken as the center of the zone</span>
+<span class="add"> * and the latitude of origin is the equator. A scale factor of 0.9996 and</span>
+<span class="add"> * false easting of 500000m is used for all zones and a false northing of 10000000m</span>
+<span class="add"> * is used for zones in the southern hemisphere.</span>
+<span class="add"> * &lt;br&gt;&lt;br&gt;</span>
+<span class="add"> *</span>
+<span class="add"> * NOTE: formulas used below are not those of Snyder, but rather those</span>
+<span class="add"> *       from the &lt;code&gt;proj4&lt;/code&gt; package of the USGS survey, which</span>
+<span class="add"> *       have been reproduced verbatim. USGS work is acknowledged here.</span>
+<span class="add"> * &lt;br&gt;&lt;br&gt;</span>
+<span class="add"> *</span>
+<span class="add"> * &lt;strong&gt;References:&lt;/strong&gt;&lt;ul&gt;</span>
+<span class="add"> *   &lt;li&gt; Proj-4.4.6 available at &lt;A HREF="http://www.remotesensing.org/proj"&gt;www.remotesensing.org/proj&lt;/A&gt;&lt;br&gt;</span>
+<span class="add"> *        Relevent files are: PJ_tmerc.c, pj_mlfn.c, pj_fwd.c and pj_inv.c &lt;/li&gt;</span>
+<span class="add"> *   &lt;li&gt; John P. Snyder (Map Projections - A Working Manual,</span>
+<span class="add"> *        U.S. Geological Survey Professional Paper 1395, 1987)&lt;/li&gt;</span>
+<span class="add"> *   &lt;li&gt; "Coordinate Conversions and Transformations including Formulas",</span>
+<span class="add"> *        EPSG Guidence Note Number 7, Version 19.&lt;/li&gt;</span>
+<span class="add"> * &lt;/ul&gt;</span>
+<span class="add"> *</span>
+<span class="add"> * @see &lt;A HREF="http://mathworld.wolfram.com/MercatorProjection.html"&gt;Transverse Mercator projection on MathWorld&lt;/A&gt;</span>
+<span class="add"> * @see &lt;A HREF="http://www.remotesensing.org/geotiff/proj_list/transverse_mercator.html"&gt;"Transverse_Mercator" on Remote Sensing&lt;/A&gt;</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 TransverseMercator extends MapProjection {</span>
+<span class="add">    /**</span>
+<span class="add">     * A derived quantity of excentricity, computed</span>
+<span class="add">     * by &lt;code&gt;e'² = (a²-b²)/b² = es/(1-es)&lt;/code&gt;</span>
+<span class="add">     * where &lt;var&gt;a&lt;/var&gt; is the semi-major axis length</span>
+<span class="add">     * and &lt;var&gt;b&lt;/bar&gt; is the semi-minor axis length.</span>
+<span class="add">     */</span>
+<span class="add">    private final double esp;</span>
+<span class="add"></span>
+<span class="add">    /**</span>
+<span class="add">     * Meridian distance at the &lt;code&gt;latitudeOfOrigin&lt;/code&gt;.</span>
+<span class="add">     * Used for calculations for the ellipsoid.</span>
+<span class="add">     */</span>
+<span class="add">    private final double ml0;</span>
+<span class="add"></span>
+<span class="add">     /**</span>
+<span class="add">     * Constant needed for the &lt;code&gt;mlfn&lt;code&gt; method.</span>
+<span class="add">     * Setup at construction time.</span>
+<span class="add">     */</span>
+<span class="add">    private final double en0,en1,en2,en3,en4;</span>
+<span class="add"></span>
+<span class="add">    /**</span>
+<span class="add">     * Constants used to calculate {@link #en0}, {@link #en1},</span>
+<span class="add">     * {@link #en2}, {@link #en3}, {@link #en4}.</span>
+<span class="add">     */</span>
+<span class="add">    private static final double C00= 1.0,</span>
+<span class="add">                                C02= 0.25,</span>
+<span class="add">                                C04= 0.046875,</span>
+<span class="add">                                C06= 0.01953125,</span>
+<span class="add">                                C08= 0.01068115234375,</span>
+<span class="add">                                C22= 0.75,</span>
+<span class="add">                                C44= 0.46875,</span>
+<span class="add">                                C46= 0.01302083333333333333,</span>
+<span class="add">                                C48= 0.00712076822916666666,</span>
+<span class="add">                                C66= 0.36458333333333333333,</span>
+<span class="add">                                C68= 0.00569661458333333333,</span>
+<span class="add">                                C88= 0.3076171875;</span>
+<span class="add">    /**</span>
+<span class="add">     * Contants used for the forward and inverse transform for the eliptical</span>
+<span class="add">     * case of the Transverse Mercator.</span>
+<span class="add">     */</span>
+<span class="add">    private static final double FC1= 1.00000000000000000000000,  // 1/1</span>
+<span class="add">                                FC2= 0.50000000000000000000000,  // 1/2</span>
+<span class="add">                                FC3= 0.16666666666666666666666,  // 1/6</span>
+<span class="add">                                FC4= 0.08333333333333333333333,  // 1/12</span>
+<span class="add">                                FC5= 0.05000000000000000000000,  // 1/20</span>
+<span class="add">                                FC6= 0.03333333333333333333333,  // 1/30</span>
+<span class="add">                                FC7= 0.02380952380952380952380,  // 1/42</span>
+<span class="add">                                FC8= 0.01785714285714285714285;  // 1/56</span>
+<span class="add"></span>
+<span class="add">    /**</span>
+<span class="add">     * Relative iteration precision used in the &lt;code&gt;mlfn&lt;code&gt; method. This</span>
+<span class="add">     * overrides the value in the MapProjection class.</span>
+<span class="add">     */</span>
+<span class="add">    private static final double TOL = 1E-11;</span>
+<span class="add"></span>
+<span class="add">    /**</span>
+<span class="add">     * The {@link MathTransformProvider} for a {@link TransverseMercator} projection.</span>
+<span class="add">     *</span>
+<span class="add">     * @see MathTransformFactory</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">    public static final class Provider</span>
+<span class="add">            extends org.geotools.referencing.operation.projection.MapProjection.Provider {</span>
+<span class="add"></span>
+<span class="add">        /**</span>
+<span class="add">         * The parameters group.</span>
+<span class="add">         * @task REVISIT: should we set some defualt UTM parameter values</span>
+<span class="add">         */</span>
+<span class="add">        static final ParameterDescriptorGroup PARAMETERS = createDescriptorGroup(new Identifier[] {</span>
+<span class="add">                new Identifier(Citation.OPEN_GIS, "Transverse_Mercator"),</span>
+<span class="add">                new Identifier(Citation.EPSG,     "Transverse Mercator"),</span>
+<span class="add">                new Identifier(Citation.EPSG,     "Gauss-Kruger"),</span>
+<span class="add">                new Identifier(Citation.EPSG,     "9807"),</span>
+<span class="add">                new Identifier(Citation.GEOTIFF,  "CT_TransverseMercator"),</span>
+<span class="add">                new Identifier(Citation.ESRI,     "Transverse_Mercator"),</span>
+<span class="add">                new Identifier(Citation.GEOTOOLS, Resources.formatInternational(</span>
+<span class="add">                                                  ResourceKeys.TRANSVERSE_MERCATOR_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,     FALSE_EASTING,</span>
+<span class="add">                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() {</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 Spherical(parameters, descriptors);</span>
+<span class="add">            } else {</span>
+<span class="add">                return new TransverseMercator(parameters, descriptors);</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">     * Construct a new map projection from the supplied parameters.</span>
+<span class="add">     *</span>
+<span class="add">     * @param  parameters The parameter values in standard units.</span>
+<span class="add">     * @param  The expected parameter descriptors.</span>
+<span class="add">     * @throws ParameterNotFoundException if a mandatory parameter is missing.</span>
+<span class="add">     */</span>
+<span class="add">    public TransverseMercator(final ParameterValueGroup parameters, final Collection expected) {</span>
+<span class="add">        //Fetch parameters</span>
+<span class="add">        super(parameters, expected);</span>
+<span class="add"></span>
+<span class="add">        //  Compute constants</span>
+<span class="add">        esp = excentricitySquared / (1.0 - excentricitySquared);</span>
+<span class="add"></span>
+<span class="add">        double t;</span>
+<span class="add">        en0 = C00 - excentricitySquared * (C02 + excentricitySquared *</span>
+<span class="add">              (C04 + excentricitySquared * (C06 + excentricitySquared * C08)));</span>
+<span class="add">        en1 = excentricitySquared * (C22 - excentricitySquared *</span>
+<span class="add">              (C04 + excentricitySquared * (C06 + excentricitySquared * C08)));</span>
+<span class="add">        en2 = (t = excentricitySquared * excentricitySquared) *</span>
+<span class="add">              (C44 - excentricitySquared * (C46 + excentricitySquared * C48));</span>
+<span class="add">        en3 = (t *= excentricitySquared) * (C66 - excentricitySquared * C68);</span>
+<span class="add">        en4 = t * excentricitySquared * C88;</span>
+<span class="add">        ml0 = mlfn(latitudeOfOrigin, Math.sin(latitudeOfOrigin), Math.cos(latitudeOfOrigin));</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">    protected ParameterDescriptorGroup getParameterDescriptors() {</span>
+<span class="add">        return Provider.PARAMETERS;</span>
+<span class="add">    }</span>
+<span class="add"></span>
+<span class="add">    /**</span>
+<span class="add">     * Transforms the specified (&lt;var&gt;x&lt;/var&gt;,&lt;var&gt;y&lt;/var&gt;) coordinate (units in radians)</span>
+<span class="add">     * and stores the result in &lt;code&gt;ptDst&lt;/code&gt; (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">        double sinphi = Math.sin(y);</span>
+<span class="add">        double cosphi = Math.cos(y);</span>
+<span class="add"></span>
+<span class="add">        double t = (Math.abs(cosphi)&gt;EPS) ? sinphi/cosphi : 0;</span>
+<span class="add">        t *= t;</span>
+<span class="add">        double al = cosphi*x;</span>
+<span class="add">        double als = al*al;</span>
+<span class="add">        al /= Math.sqrt(1.0 - excentricitySquared * sinphi*sinphi);</span>
+<span class="add">        double n = esp * cosphi*cosphi;</span>
+<span class="add"></span>
+<span class="add">        /* NOTE: meridinal distance at latitudeOfOrigin is always 0 */</span>
+<span class="add">        y = (mlfn(y, sinphi, cosphi) - ml0 +</span>
+<span class="add">            sinphi*al*x*</span>
+<span class="add">            FC2 * ( 1.0 +</span>
+<span class="add">            FC4 * als * (5.0 - t + n*(9.0 + 4.0*n) +</span>
+<span class="add">            FC6 * als * (61.0 + t * (t - 58.0) + n*(270.0 - 330.0*t) +</span>
+<span class="add">            FC8 * als * (1385.0 + t * ( t*(543.0 - t) - 3111.0))))));</span>
+<span class="add"></span>
+<span class="add">        x = al*(FC1 + FC3 * als*(1.0 - t + n +</span>
+<span class="add">            FC5 * als * (5.0 + t*(t - 18.0) + n*(14.0 - 58.0*t) +</span>
+<span class="add">            FC7 * als * (61.0+ t*(t*(179.0 - t) - 479.0 )))));</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 (&lt;var&gt;x&lt;/var&gt;,&lt;var&gt;y&lt;/var&gt;) coordinate</span>
+<span class="add">     * and stores the result in &lt;code&gt;ptDst&lt;/code&gt;.</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">        double phi = inv_mlfn(ml0 + y);</span>
+<span class="add"></span>
+<span class="add">        if (Math.abs(phi) &gt;= (Math.PI/2)) {</span>
+<span class="add">            y = y&lt;0.0 ? -(Math.PI/2) : (Math.PI/2);</span>
+<span class="add">            x = 0.0;</span>
+<span class="add">        } else {</span>
+<span class="add">            double sinphi = Math.sin(phi);</span>
+<span class="add">            double cosphi = Math.cos(phi);</span>
+<span class="add">            double t = (Math.abs(cosphi) &gt; EPS) ? sinphi/cosphi : 0.0;</span>
+<span class="add">            double n = esp * cosphi*cosphi;</span>
+<span class="add">            double con = 1.0 - excentricitySquared * sinphi*sinphi;</span>
+<span class="add">            double d = x*Math.sqrt(con);</span>
+<span class="add">            con *= t;</span>
+<span class="add">            t *= t;</span>
+<span class="add">            double ds = d*d;</span>
+<span class="add"></span>
+<span class="add">            y = phi - (con*ds / (1.0 - excentricitySquared)) *</span>
+<span class="add">                FC2 * (1.0 - ds *</span>
+<span class="add">                FC4 * (5.0 + t*(3.0 - 9.0*n) + n*(1.0 - 4*n) - ds *</span>
+<span class="add">                FC6 * (61.0 + t*(90.0 - 252.0*n + 45.0*t) + 46.0*n - ds *</span>
+<span class="add">                FC8 * (1385.0 + t*(3633.0 + t*(4095.0 + 1574.0*t))))));</span>
+<span class="add"></span>
+<span class="add">            x = d*(FC1 - ds * FC3 * (1.0 + 2.0*t + n -</span>
+<span class="add">                ds*FC5*(5.0 + t*(28.0 + 24* t + 8.0*n) + 6.0*n -</span>
+<span class="add">                ds*FC7*(61.0 + t*(662.0 + t*(1320.0 + 720.0*t))))))/cosphi;</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">    /**</span>
+<span class="add">     * Provides the transform equations for the spherical case of the</span>
+<span class="add">     * TransverseMercator projection.</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">    private static final class Spherical extends Mercator {</span>
+<span class="add">        /**</span>
+<span class="add">         * Construct a new map projection from the suplied parameters.</span>
+<span class="add">         *</span>
+<span class="add">         * @param  parameters The parameter values in standard units.</span>
+<span class="add">         * @param  The expected parameter descriptors.</span>
+<span class="add">         * @throws ParameterNotFoundException if a mandatory parameter is missing.</span>
+<span class="add">         */</span>
+<span class="add">        protected Spherical(final ParameterValueGroup parameters, final Collection expected)</span>
+<span class="add">                throws ParameterNotFoundException</span>
+<span class="add">        {</span>
+<span class="add">            super(parameters, expected);</span>
+<span class="add">            assert isSpherical;</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">        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">            double cosphi = Math.cos(y);</span>
+<span class="add">            double b = cosphi * Math.sin(x);</span>
+<span class="add">            if (Math.abs(Math.abs(b) - 1.0) &lt;= 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"></span>
+<span class="add">            double yy = cosphi * Math.cos(x) / Math.sqrt(1.0-b*b);</span>
+<span class="add">            x = 0.5 * Math.log((1.0+b)/(1.0-b));    /* Snyder 8-1 */</span>
+<span class="add"></span>
+<span class="add">            if ((b=Math.abs(yy)) &gt;= 1.0) {</span>
+<span class="add">                if ((b-1.0) &gt; EPS) {</span>
+<span class="add">                    throw new ProjectionException(Resources.format(</span>
+<span class="add">                        ResourceKeys.ERROR_VALUE_TEND_TOWARD_INFINITY));</span>
+<span class="add">                } else {</span>
+<span class="add">                    yy = 0.0;</span>
+<span class="add">                }</span>
+<span class="add">            } else {</span>
+<span class="add">                yy = Math.acos(yy);</span>
+<span class="add">            }</span>
+<span class="add">            if (y &lt; 0) {</span>
+<span class="add">                yy = -yy;</span>
+<span class="add">            }</span>
+<span class="add">            y = (yy - latitudeOfOrigin);</span>
+<span class="add"></span>
+<span class="add">            assert Math.abs(ptDst.getX()-x) &lt;= EPS*globalScale : x;</span>
+<span class="add">            assert Math.abs(ptDst.getY()-y) &lt;= 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">         * {@inheritDoc}</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">            double t = Math.exp(x);</span>
+<span class="add">            double d = 0.5 * (t-1.0/t);</span>
+<span class="add">            t = Math.cos(latitudeOfOrigin + y);</span>
+<span class="add">            double phi = Math.asin(Math.sqrt((1.0-t*t)/(1.0+d*d)));</span>
+<span class="add">            y = y&lt;0.0 ? -phi : phi;</span>
+<span class="add">            x = (Math.abs(d)&lt;=EPS &amp;&amp; Math.abs(t)&lt;=EPS) ?</span>
+<span class="add">                    0.0 : Math.atan2(d,t);</span>
+<span class="add"></span>
+<span class="add">            assert Math.abs(ptDst.getX()-x) &lt;= EPS : x;</span>
+<span class="add">            assert Math.abs(ptDst.getY()-y) &lt;= 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">    /**</span>
+<span class="add">     * Calculates the meridian distance. This is the distance along the central</span>
+<span class="add">     * meridian from the equator to &lt;code&gt;phi&lt;/code&gt;. Accurate to &lt; 1e-5 meters</span>
+<span class="add">     * when used in conjuction with typical major axis values.</span>
+<span class="add">     *</span>
+<span class="add">     * @param phi latitude to calculate meridian distance for.</span>
+<span class="add">     * @param sphi sin(phi).</span>
+<span class="add">     * @param cphi cos(phi).</span>
+<span class="add">     * @return meridian distance for the given latitude.</span>
+<span class="add">     */</span>
+<span class="add">    private final double mlfn(final double phi, double sphi, double cphi) {</span>
+<span class="add">        cphi *= sphi;</span>
+<span class="add">        sphi *= sphi;</span>
+<span class="add">        return en0 * phi - cphi *</span>
+<span class="add">              (en1 + sphi *</span>
+<span class="add">              (en2 + sphi *</span>
+<span class="add">              (en3 + sphi *</span>
+<span class="add">              (en4))));</span>
+<span class="add">    }</span>
+<span class="add"></span>
+<span class="add">    /**</span>
+<span class="add">     * Calculates the latitude (&lt;code&gt;phi&lt;/code&gt;) from a meridian distance.</span>
+<span class="add">     * Determines phi to TOL (1e-11) radians, about 1e-6 seconds.</span>
+<span class="add">     *</span>
+<span class="add">     * @param arg meridian distance to calulate latitude for.</span>
+<span class="add">     * @return the latitude of the meridian distance.</span>
+<span class="add">     * @throws ProjectionException if the itteration does not converge.</span>
+<span class="add">     */</span>
+<span class="add">    private final double inv_mlfn(double arg) throws ProjectionException {</span>
+<span class="add">        double s, t, phi, k = 1.0/(1.0 - excentricitySquared);</span>
+<span class="add">    int i;</span>
+<span class="add">    phi = arg;</span>
+<span class="add">        for (i=MAX_ITER; true;) { // rarely goes over 5 iterations</span>
+<span class="add">            if (--i &lt; 0) {</span>
+<span class="add">                throw new ProjectionException(Resources.format(</span>
+<span class="add">                            ResourceKeys.ERROR_NO_CONVERGENCE));</span>
+<span class="add">            }</span>
+<span class="add">            s = Math.sin(phi);</span>
+<span class="add">            t = 1.0 - excentricitySquared * s * s;</span>
+<span class="add">            t = (mlfn(phi, s, Math.cos(phi)) - arg) * (t * Math.sqrt(t)) * k;</span>
+<span class="add">            phi -= t;</span>
+<span class="add">            if (Math.abs(t) &lt; TOL) {</span>
+<span class="add">                return phi;</span>
+<span class="add">            }</span>
+<span class="add">    }</span>
+<span class="add">    }</span>
+<span class="add"></span>
+<span class="add">    /**</span>
+<span class="add">     * Returns a hash value for this projection.</span>
+<span class="add">     */</span>
+<span class="add">    public int hashCode() {</span>
+<span class="add">        final long code = Double.doubleToLongBits(ml0);</span>
+<span class="add">        return ((int)code ^ (int)(code &gt;&gt;&gt; 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</span>
+<span class="add">     * 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">        // Relevant parameters are already compared in MapProjection</span>
+<span class="add">        return super.equals(object);</span>
+<span class="add">    }</span>
+<span class="add"></span>
+<span class="add">    /**</span>
+<span class="add">     * Convenience method computing the zone code from the central meridian.</span>
+<span class="add">     * Information about zones convention must be specified in argument. Two</span>
+<span class="add">     * widely set of arguments are of Universal Transverse Mercator (UTM) and</span>
+<span class="add">     * Modified Transverse Mercator (MTM) projections:&lt;br&gt;</span>
+<span class="add">     * &lt;br&gt;</span>
+<span class="add">     *</span>
+<span class="add">     * UTM projection (zones numbered from 1 to 60):&lt;br&gt;</span>
+<span class="add">     * &lt;br&gt;</span>
+<span class="add">     *        &lt;code&gt;getZone(-177, 6);&lt;/code&gt;&lt;br&gt;</span>
+<span class="add">     * &lt;br&gt;</span>
+<span class="add">     * MTM projection (zones numbered from 1 to 120):&lt;br&gt;</span>
+<span class="add">     * &lt;br&gt;</span>
+<span class="add">     *        &lt;code&gt;getZone(-52.5, -3);&lt;/code&gt;&lt;br&gt;</span>
+<span class="add">     *</span>
+<span class="add">     * @param  centralLongitudeZone1 Longitude in the middle of zone 1, in degrees</span>
+<span class="add">     *         relative to Greenwich. Positive longitudes are toward east, and negative</span>
+<span class="add">     *         longitudes toward west.</span>
+<span class="add">     * @param  zoneWidth Number of degrees of longitudes in one zone. A positive value</span>
+<span class="add">     *         means that zones are numbered from west to east (i.e. in the direction of</span>
+<span class="add">     *         positive longitudes). A negative value means that zones are numbered from</span>
+<span class="add">     *         east to west.</span>
+<span class="add">     * @return The zone number. First zone is numbered 1.</span>
+<span class="add">     */</span>
+<span class="add">    private int getZone(final double centralLongitudeZone1, final double zoneWidth) {</span>
+<span class="add">        final double zoneCount = Math.abs(360/zoneWidth);</span>
+<span class="add">        double t;</span>
+<span class="add">        t  = centralLongitudeZone1 - 0.5*zoneWidth; // Longitude at the beginning of the first zone.</span>
+<span class="add">        t  = Math.toDegrees(centralMeridian) - t;   // Degrees of longitude between the central longitude and longitude 1.</span>
+<span class="add">        t  = Math.floor(t/zoneWidth + EPS);         // Number of zones between the central longitude and longitude 1.</span>
+<span class="add">        t -= zoneCount*Math.floor(t/zoneCount);     // If negative, bring back to the interval 0 to (zoneCount-1).</span>
+<span class="add">        return ((int) t)+1;</span>
+<span class="add">    }</span>
+<span class="add"></span>
+<span class="add">    /**</span>
+<span class="add">     * Convenience method returning the meridian in the middle of</span>
+<span class="add">     * current zone. This meridian is typically the central meridian.</span>
+<span class="add">     * This method may be invoked to make sure that the central meridian</span>
+<span class="add">     * is correctly set.</span>
+<span class="add">     *</span>
+<span class="add">     * @param  centralLongitudeZone1 Longitude in the middle of zone 1, in degrees</span>
+<span class="add">     *         relative to Greenwich. Positive longitudes are toward east, and negative</span>
+<span class="add">     *         longitudes toward west.</span>
+<span class="add">     * @param  zoneWidth Number of degrees of longitudes in one zone. A positive value</span>
+<span class="add">     *         means that zones are numbered from west to east (i.e. in the direction of</span>
+<span class="add">     *         positive longitudes). A negative value means that zones are numbered from</span>
+<span class="add">     *         east to west.</span>
+<span class="add">     * @return The central meridian.</span>
+<span class="add">     */</span>
+<span class="add">    private double getCentralMedirian(final double centralLongitudeZone1, final double zoneWidth) {</span>
+<span class="add">        double t;</span>
+<span class="add">        t  = centralLongitudeZone1 + (getZone(centralLongitudeZone1, zoneWidth)-1)*zoneWidth;</span>
+<span class="add">        t -= 360*Math.floor((t+180)/360); // Bring back into [-180..+180] range.</span>
+<span class="add">        return t;</span>
+<span class="add">    }</span>
+<span class="add"></span>
+<span class="add">    /**</span>
+<span class="add">     * Convenience method computing the zone code from the central meridian.</span>
+<span class="add">     *</span>
+<span class="add">     * @return The zone number, using the scalefactor and false easting</span>
+<span class="add">     *         to decide if this is a UTM or MTM case. Returns 0 if the</span>
+<span class="add">     *         case of the projection cannot be determined.</span>
+<span class="add">     */</span>
+<span class="add">    public int getZone() {</span>
+<span class="add">        //UTM</span>
+<span class="add">        if (scaleFactor == 0.9996 &amp;&amp; falseEasting == 500000.0) {</span>
+<span class="add">            return(getZone(-177, 6));</span>
+<span class="add">        }</span>
+<span class="add">        //MTM</span>
+<span class="add">        if (scaleFactor == 0.9999 &amp;&amp; falseEasting == 304800.0){</span>
+<span class="add">            return(getZone(-52.5, -3));</span>
+<span class="add">        }</span>
+<span class="add">        //unknown</span>
+<span class="add">        throw new IllegalStateException();</span>
+<span class="add">    }</span>
+<span class="add"></span>
+<span class="add">    /**</span>
+<span class="add">     * Convenience method returning the meridian in the middle of</span>
+<span class="add">     * current zone. This meridian is typically the central meridian.</span>
+<span class="add">     * This method may be invoked to make sure that the central meridian</span>
+<span class="add">     * is correctly set.</span>
+<span class="add">     *</span>
+<span class="add">     * @return The central meridian, using the scalefactor and false easting</span>
+<span class="add">     *         to decide if this is a UTM or MTM case. Returns Double.NaN if the</span>
+<span class="add">     *         case of the projection cannot be determined.</span>
+<span class="add">     */</span>
+<span class="add">    public double getCentralMeridian() {</span>
+<span class="add">        //UTM</span>
+<span class="add">        if (scaleFactor == 0.9996 &amp;&amp; falseEasting == 500000.0) {</span>
+<span class="add">            return(getCentralMedirian(-177, 6));</span>
+<span class="add">        }</span>
+<span class="add">        //MTM</span>
+<span class="add">        if (scaleFactor == 0.9999 &amp;&amp; falseEasting == 304800.0){</span>
+<span class="add">            return(getCentralMedirian(-52.5, -3));</span>
+<span class="add">        }</span>
+<span class="add">        //unknown</span>
+<span class="add">        throw new IllegalStateException();</span>
+<span class="add">    }</span>
+<span class="add">}</span></pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/09153/TransverseMercator.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: sis/ip-review/rev/10796/TransverseMercator.xhtml
URL: http://svn.apache.org/viewvc/sis/ip-review/rev/10796/TransverseMercator.xhtml?rev=1691145&view=auto
==============================================================================
--- sis/ip-review/rev/10796/TransverseMercator.xhtml (added)
+++ sis/ip-review/rev/10796/TransverseMercator.xhtml Wed Jul 15 08:31:14 2015
@@ -0,0 +1,162 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>TransverseMercator changes for revisions 9357:10796</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>TransverseMercator changes for revisions 9357:10796</h1>
+<p>Except for a javadoc fix and the <code>"extends Mercator"</code> fix in the Spherical inner class,
+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.
+The javadoc error are then identified and fixed by warnings produced by the IDE, and the <code>"extends Mercator"</code>
+statement is fixed as a result of test failures if we do not fix it.</p>
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r9357:10796 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/TransverseMercator.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 9357</th><th>Revision 10796</th></tr>
+<tr><td><pre>* Geotools - OpenSource mapping toolkit
+* (C) 2003, 2004 Geotools Project Managment Committee (PMC)
+* (C) 2002, Centre for Computational Geography
+<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)
+* (C) 2002, Centre for Computational Geography
+<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>
+import org.opengis.parameter.ParameterDescriptor;
+<span class="del">import org.opengis.parameter.ParameterValueGroup;</span>
+import org.opengis.parameter.ParameterDescriptorGroup;
+import org.opengis.parameter.ParameterNotFoundException;
+import org.opengis.referencing.operation.MathTransform;
+
+<span class="del">// Geotools dependencies</span>
+<span class="del">import org.geotools.referencing.Identifier;</span>
+<span class="del">import org.geotools.metadata.citation.Citation;</span>
+<span class="del">import org.geotools.resources.cts.ResourceKeys;</span>
+<span class="del">import org.geotools.resources.cts.Resources;</span>
+<span class="del"></span>
+/**
+ * Transverse Mercator Projection (EPSG code 9807). This
+<span class="del"> * is a cylindrical projection, in which the cylinder has been rotated 90°.</span>
+ * Instead of being tangent to the equator (or to an other standard latitude),
+ * it is tangent to a central meridian. Deformation are more important as we
+ * are going futher from the central meridian. The Transverse Mercator</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;
+
+<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>
+import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.parameter.ParameterDescriptorGroup;
+import org.opengis.parameter.ParameterNotFoundException;
+<span class="add">import org.opengis.parameter.ParameterValueGroup;</span>
+import org.opengis.referencing.operation.MathTransform;
+
+/**
+ * Transverse Mercator Projection (EPSG code 9807). This
+<span class="add"> * is a cylindrical projection, in which the cylinder has been rotated 90�.</span>
+ * Instead of being tangent to the equator (or to an other standard latitude),
+ * it is tangent to a central meridian. Deformation are more important as we
+ * are going futher from the central meridian. The Transverse Mercator</pre></td></tr>
+<tr><td><pre>* @see &lt;A HREF="http://www.remotesensing.org/geotiff/proj_list/transverse_mercator.html"&gt;"Transverse_Mercator" on Remote Sensing&lt;/A&gt;
+*
+* @version $Id$
+<span class="del">* @author André Gosselin</span>
+* @author Martin Desruisseaux
+* @author Rueben Schulz
+*/</pre></td>
+<td><pre>* @see &lt;A HREF="http://www.remotesensing.org/geotiff/proj_list/transverse_mercator.html"&gt;"Transverse_Mercator" on Remote Sensing&lt;/A&gt;
+*
+* @version $Id$
+<span class="add">* @author Andr� Gosselin</span>
+* @author Martin Desruisseaux
+* @author Rueben Schulz
+*/</pre></td></tr>
+<tr><td><pre>public class TransverseMercator extends MapProjection {
+    /**
+     * A derived quantity of excentricity, computed
+<span class="del">     * by &lt;code&gt;e'² = (a²-b²)/b² = es/(1-es)&lt;/code&gt;</span>
+     * where &lt;var&gt;a&lt;/var&gt; is the semi-major axis length
+     * and &lt;var&gt;b&lt;/bar&gt; is the semi-minor axis length.
+     */</pre></td>
+<td><pre>public class TransverseMercator extends MapProjection {
+    /**
+     * A derived quantity of excentricity, computed
+<span class="add">     * by &lt;code&gt;e'� = (a�-b�)/b� = es/(1-es)&lt;/code&gt;</span>
+     * where &lt;var&gt;a&lt;/var&gt; is the semi-major axis length
+     * and &lt;var&gt;b&lt;/bar&gt; is the semi-minor axis length.
+     */</pre></td></tr>
+<tr><td><pre> * @param  expected The expected parameter descriptors.
+ * @throws ParameterNotFoundException if a mandatory parameter is missing.
+ */
+<span class="del">public TransverseMercator(final ParameterValueGroup parameters, final Collection expected) {</span>
+    //Fetch parameters
+    super(parameters, expected);</pre></td>
+<td><pre> * @param  expected The expected parameter descriptors.
+ * @throws ParameterNotFoundException if a mandatory parameter is missing.
+ */
+<span class="add">TransverseMercator(final ParameterValueGroup parameters, final Collection expected)</span>
+<span class="add">        throws ParameterNotFoundException</span>
+<span class="add">{</span>
+    //Fetch parameters
+    super(parameters, expected);</pre></td></tr>
+<tr><td><pre> * TransverseMercator projection.
+ *
+ * @version $Id$
+<span class="del"> * @author André Gosselin</span>
+ * @author Martin Desruisseaux
+ * @author Rueben Schulz
+ */
+<span class="del">private static final class Spherical extends Mercator {</span>
+    /**
+     * Construct a new map projection from the suplied parameters.
+     *
+     * @param  parameters The parameter values in standard units.
+<span class="del">     * @param  The expected parameter descriptors.</span>
+     * @throws ParameterNotFoundException if a mandatory parameter is missing.
+     */
+    protected Spherical(final ParameterValueGroup parameters, final Collection expected)</pre></td>
+<td><pre> * TransverseMercator projection.
+ *
+ * @version $Id$
+<span class="add"> * @author Andr� Gosselin</span>
+ * @author Martin Desruisseaux
+ * @author Rueben Schulz
+ */
+<span class="add">private static final class Spherical extends TransverseMercator {</span>
+    /**
+     * Construct a new map projection from the suplied parameters.
+     *
+     * @param  parameters The parameter values in standard units.
+<span class="add">     * @param  expected The expected parameter descriptors.</span>
+     * @throws ParameterNotFoundException if a mandatory parameter is missing.
+     */
+    protected Spherical(final ParameterValueGroup parameters, final Collection expected)</pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/10796/TransverseMercator.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: sis/ip-review/rev/11697/HEADER.html
URL: http://svn.apache.org/viewvc/sis/ip-review/rev/11697/HEADER.html?rev=1691145&view=auto
==============================================================================
--- sis/ip-review/rev/11697/HEADER.html (added)
+++ sis/ip-review/rev/11697/HEADER.html Wed Jul 15 08:31:14 2015
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>Revision 11697</title>
+  </head>
+  <body>
+    <div>
+      <h1>Revision 11697</h1>
+<table>
+  <tr><td><b>Author:</b></td><td>rschulz</td></tr>
+  <tr><td><b>Date:</b></td><td>2005-02-28</td></tr>
+  <tr><td><b>Message:</b></td><td>fixed small bug in spherical inverse, changed to Snyder's equations for calculating y in the spherical forward; overrode  getToleranceForAssertions() to deal with assertion errors, added getToleranceForSphereAssertions() to deal with assertion errors when comparing spherical calculations to elliptical</td></tr>
+</table>
+    </div>
+  </body>
+</html>

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

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

Added: sis/ip-review/rev/11697/TransverseMercator.xhtml
URL: http://svn.apache.org/viewvc/sis/ip-review/rev/11697/TransverseMercator.xhtml?rev=1691145&view=auto
==============================================================================
--- sis/ip-review/rev/11697/TransverseMercator.xhtml (added)
+++ sis/ip-review/rev/11697/TransverseMercator.xhtml Wed Jul 15 08:31:14 2015
@@ -0,0 +1,165 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>TransverseMercator changes for revisions 11696:11697</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>TransverseMercator changes for revisions 11696:11697</h1>
+<p>Those formulas have been rewritten in SIS.</p>
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r11696:11697 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/TransverseMercator.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 11696</th><th>Revision 11697</th></tr>
+<tr><td><pre>}
+
+
+/**
+ * Provides the transform equations for the spherical case of the
+ * TransverseMercator projection.</pre></td>
+<td><pre>}
+
+
+<span class="add">protected double getToleranceForAssertions(final double longitude, final double latitude) {</span>
+<span class="add">    if (Math.abs(longitude - centralMeridian) &gt; 0.26) {   //15 degrees</span>
+<span class="add">        // When far from the valid area, use a larger tolerance.</span>
+<span class="add">        return 2.5;</span>
+<span class="add">    } else if (Math.abs(longitude - centralMeridian) &gt; 0.22) {  //12.5 degrees</span>
+<span class="add">        return 1.0;</span>
+<span class="add">    } else if (Math.abs(longitude - centralMeridian) &gt; 0.17) {  //10 degrees</span>
+<span class="add">        return 0.5;</span>
+<span class="add">    }</span>
+<span class="add">    // a normal tolerance</span>
+<span class="add">    return 1E-6;</span>
+<span class="add">}</span>
+<span class="add"></span>
+<span class="add"></span>
+/**
+ * Provides the transform equations for the spherical case of the
+ * TransverseMercator projection.</pre></td></tr>
+<tr><td><pre>        throws ProjectionException
+{
+    // Compute using ellipsoidal formulas, for comparaison later.
+    assert (ptDst = super.transformNormalized(x, y, ptDst)) != null;
+
+    double cosphi = Math.cos(y);</pre></td>
+<td><pre>        throws ProjectionException
+{
+    // Compute using ellipsoidal formulas, for comparaison later.
+<span class="add">    double normalizedLongitude = x;</span>
+    assert (ptDst = super.transformNormalized(x, y, ptDst)) != null;
+
+    double cosphi = Math.cos(y);</pre></td></tr>
+<tr><td><pre>    ResourceKeys.ERROR_VALUE_TEND_TOWARD_INFINITY));
+}
+
+<span class="del">double yy = cosphi * Math.cos(x) / Math.sqrt(1.0-b*b);</span>
+x = 0.5 * Math.log((1.0+b)/(1.0-b));    /* Snyder 8-1 */
+
+<span class="del">if ((b=Math.abs(yy)) &gt;= 1.0) {</span>
+<span class="del">    if ((b-1.0) &gt; EPS) {</span>
+<span class="del">        throw new ProjectionException(Resources.format(</span>
+<span class="del">            ResourceKeys.ERROR_VALUE_TEND_TOWARD_INFINITY));</span>
+<span class="del">    } else {</span>
+<span class="del">        yy = 0.0;</span>
+<span class="del">    }</span>
+<span class="del">} else {</span>
+<span class="del">    yy = Math.acos(yy);</span>
+<span class="del">}</span>
+<span class="del">if (y &lt; 0) {</span>
+<span class="del">    yy = -yy;</span>
+<span class="del">}</span>
+<span class="del">y = (yy - latitudeOfOrigin);</span>
+<span class="del"></span>
+<span class="del">assert Math.abs(ptDst.getX()-x) &lt;= EPS*globalScale : x;</span>
+<span class="del">assert Math.abs(ptDst.getY()-y) &lt;= EPS*globalScale : y;</span>
+if (ptDst != null) {
+    ptDst.setLocation(x,y);
+    return ptDst;</pre></td>
+<td><pre>    ResourceKeys.ERROR_VALUE_TEND_TOWARD_INFINITY));
+}
+
+<span class="add">//Using Snyder's equation for calculating y, instead of the one used in Proj4</span>
+<span class="add">//poential problems when y and x = 90 degrees, but behaves ok in tests</span>
+<span class="add">y = Math.atan2(Math.tan(y),Math.cos(x)) - latitudeOfOrigin;   /* Snyder 8-3 */</span>
+x = 0.5 * Math.log((1.0+b)/(1.0-b));    /* Snyder 8-1 */
+
+<span class="add">assert Math.abs(ptDst.getX()-x) &lt;= getToleranceForSphereAssertions(normalizedLongitude,0) : ptDst.getX()-x;</span>
+<span class="add">assert Math.abs(ptDst.getY()-y) &lt;= getToleranceForSphereAssertions(normalizedLongitude,0) : ptDst.getY()-y;</span>
+if (ptDst != null) {
+    ptDst.setLocation(x,y);
+    return ptDst;</pre></td></tr>
+<tr><td><pre>assert (ptDst = super.inverseTransformNormalized(x, y, ptDst)) != null;
+
+double t = Math.exp(x);
+<span class="del">double d = 0.5 * (t-1.0/t);</span>
+<span class="del">t = Math.cos(latitudeOfOrigin + y);</span>
+<span class="del">double phi = Math.asin(Math.sqrt((1.0-t*t)/(1.0+d*d)));</span>
+<span class="del">y = y&lt;0.0 ? -phi : phi;</span>
+<span class="del">x = (Math.abs(d)&lt;=EPS &amp;&amp; Math.abs(t)&lt;=EPS) ?</span>
+<span class="del">        0.0 : Math.atan2(d,t);</span>
+
+<span class="del">assert Math.abs(ptDst.getX()-x) &lt;= EPS : x;</span>
+<span class="del">assert Math.abs(ptDst.getY()-y) &lt;= EPS : y;</span>
+if (ptDst != null) {
+    ptDst.setLocation(x,y);
+    return ptDst;</pre></td>
+<td><pre>assert (ptDst = super.inverseTransformNormalized(x, y, ptDst)) != null;
+
+double t = Math.exp(x);
+<span class="add">double sinhX = 0.5 * (t-1.0/t);                //sinh(x)</span>
+<span class="add">double cosD = Math.cos(latitudeOfOrigin + y);</span>
+<span class="add">double phi = Math.asin(Math.sqrt((1.0-cosD*cosD)/(1.0+sinhX*sinhX)));</span>
+<span class="add">// correct for the fact that we made everything positive using sqrt(x*x)</span>
+<span class="add">y = ((y + latitudeOfOrigin)&lt;0.0) ? -phi : phi;</span>
+<span class="add">x = (Math.abs(sinhX)&lt;=EPS &amp;&amp; Math.abs(cosD)&lt;=EPS) ?</span>
+<span class="add">        0.0 : Math.atan2(sinhX,cosD);</span>
+
+<span class="add">assert Math.abs(ptDst.getX()-x) &lt;= getToleranceForSphereAssertions(x,0) : ptDst.getX()-x;</span>
+<span class="add">assert Math.abs(ptDst.getY()-y) &lt;= getToleranceForSphereAssertions(x,0) : ptDst.getY()-y;</span>
+if (ptDst != null) {
+    ptDst.setLocation(x,y);
+    return ptDst;</pre></td></tr>
+<tr><td><pre>        }
+        return new Point2D.Double(x,y);
+    }
+}
+
+
+/**</pre></td>
+<td><pre>        }
+        return new Point2D.Double(x,y);
+    }
+<span class="add"></span>
+<span class="add">    /*</span>
+<span class="add">     *  Allow a larger tolerance when comparing spherical to elliptical calculations</span>
+<span class="add">     *  when we are far from the central meridian (elliptical calculations are</span>
+<span class="add">     *  not valid here).</span>
+<span class="add">     *</span>
+<span class="add">     *  longitude here is standardized (in radians) and centralMeridian has</span>
+<span class="add">     *  already been removed from it.</span>
+<span class="add">     */</span>
+<span class="add">    protected double getToleranceForSphereAssertions(final double longitude, final double latitude) {</span>
+<span class="add">        if (Math.abs(Math.abs(longitude)- Math.PI/2.0) &lt; TOL) {  //90 degrees</span>
+<span class="add">            // elliptical equations are at their worst here</span>
+<span class="add">            return 1E18;</span>
+}
+<span class="add">        if (Math.abs(longitude) &gt; 0.26) {   //15 degrees</span>
+<span class="add">            // When far from the valid area, use a very larger tolerance.</span>
+<span class="add">            return 1000000;</span>
+<span class="add">        }</span>
+<span class="add">        // a normal tolerance</span>
+<span class="add">        return 1E-6;</span>
+<span class="add">    }</span>
+<span class="add">}</span>
+
+
+/**</pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/11697/TransverseMercator.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

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

Added: sis/ip-review/rev/20874/TransverseMercator.xhtml
URL: http://svn.apache.org/viewvc/sis/ip-review/rev/20874/TransverseMercator.xhtml?rev=1691145&view=auto
==============================================================================
--- sis/ip-review/rev/20874/TransverseMercator.xhtml (added)
+++ sis/ip-review/rev/20874/TransverseMercator.xhtml Wed Jul 15 08:31:14 2015
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+  <head>
+    <meta charset="UTF-8"/>
+    <title>TransverseMercator changes for revisions 20873:20874</title>
+    <style type="text/css" media="all">
+      @import url("../../reports.css");
+    </style>
+  </head>
+  <body>
+    <div>
+      <h1>TransverseMercator changes for revisions 20873:20874</h1>
+<p>Changes in GeoTools header only. The removal of the <cite>"or (at your option) any later version"</cite> clause
+must be keep in Geotk for every classes having contribution from a developer other than those who accepted re-licensing.
+This header does not apply to Apache SIS, since the above-cited contributions are omitted.</p>
+<p><b>Command line:</b></p>
+<blockquote><code>svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r20873:20874 http://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/operation/projection/TransverseMercator.java</code></blockquote>
+<table class="changes">
+<tr><th>Revision 20873</th><th>Revision 20874</th></tr>
+<tr><td><pre>/*
+<span class="del"> * Geotools - OpenSource mapping toolkit</span>
+<span class="del"> * (C) 2003, 2004 Geotools Project Managment Committee (PMC)</span>
+ * (C) 2002, Centre for Computational Geography
+ * (C) 2001, Institut de Recherche pour le Développement
+ * (C) 2000, Frank Warmerdam</pre></td>
+<td><pre>/*
+<span class="add"> *    GeoTools - OpenSource mapping toolkit</span>
+<span class="add"> *    http://geotools.org</span>
+<span class="add"> *</span>
+<span class="add"> *   (C) 2003-2006, Geotools Project Managment Committee (PMC)</span>
+ * (C) 2002, Centre for Computational Geography
+ * (C) 2001, Institut de Recherche pour le Développement
+ * (C) 2000, Frank Warmerdam</pre></td></tr>
+<tr><td><pre>*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+*    Lesser General Public License for more details.
+*
+<span class="del">*</span>
+*    This package contains formulas from the PROJ package of USGS.
+*    USGS's work is fully acknowledged here. This derived work has
+*    been relicensed under LGPL with Frank Warmerdam's permission.</pre></td>
+<td><pre>*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+*    Lesser General Public License for more details.
+*
+*    This package contains formulas from the PROJ package of USGS.
+*    USGS's work is fully acknowledged here. This derived work has
+*    been relicensed under LGPL with Frank Warmerdam's permission.</pre></td></tr>
+</table>
+    </div>
+  </body>
+</html>

Propchange: sis/ip-review/rev/20874/TransverseMercator.xhtml
------------------------------------------------------------------------------
    svn:eol-style = native

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



Mime
View raw message