You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2016/06/02 04:57:06 UTC

svn commit: r1746518 [6/6] - in /sis/site/trunk: book/en/ book/fr/ book/math/ content/book/en/ content/book/fr/

Modified: sis/site/trunk/content/book/en/developer-guide.html
URL: http://svn.apache.org/viewvc/sis/site/trunk/content/book/en/developer-guide.html?rev=1746518&r1=1746517&r2=1746518&view=diff
==============================================================================
--- sis/site/trunk/content/book/en/developer-guide.html (original)
+++ sis/site/trunk/content/book/en/developer-guide.html Thu Jun  2 04:57:06 2016
@@ -19,7 +19,7 @@
 <p style="margin-top: 30pt"><span style="font-size: 30pt; font-weight: 900">Introduction to Apache SIS®</span></p>
 <p style="margin-bottom: 20pt">(English | <a href="../fr/developer-guide.html">Français</a>)</p>
 <p><i>Martin Desruisseaux</i><br/>
-<i>Christina Hough</i></p>
+Partially translated by <i>Christina Hough</i></p>
 <p>This work is licensed under the Apache 2 license.</p>
 <hr/>
 
@@ -60,7 +60,8 @@
 <li><a href="#CRS_UserCode">Adding new CRS definitions</a></li></ul></li>
 <li><a href="#CoordinateOperation">Coordinate operations</a><ul>
 <li><a href="#MathTransform">Executing an operation on coordinate values</a><ul>
-<li><a href="#AffineTransform">Affine transform</a></li></ul></li>
+<li><a href="#AffineTransform">Affine transform</a></li>
+<li><a href="#AffineTransformAPI">Integration with graphical libraries</a></li></ul></li>
 <li><a href="#TransformDerivative">Partial derivatives of coordinate operations</a><ul>
 <li><a href="#DerivativeAndEnvelope">Transform derivatives applied to envelopes</a></li>
 <li><a href="#DerivativeAndRaster">Transform derivatives applied to rasters</a></li>
@@ -1375,7 +1376,8 @@ or the use of <code>isWhitespace(…)
 <li><a href="#CRS_UserCode">Adding new CRS definitions</a></li></ul></li>
 <li><a href="#CoordinateOperation">Coordinate operations</a><ul>
 <li><a href="#MathTransform">Executing an operation on coordinate values</a><ul>
-<li><a href="#AffineTransform">Affine transform</a></li></ul></li>
+<li><a href="#AffineTransform">Affine transform</a></li>
+<li><a href="#AffineTransformAPI">Integration with graphical libraries</a></li></ul></li>
 <li><a href="#TransformDerivative">Partial derivatives of coordinate operations</a><ul>
 <li><a href="#DerivativeAndEnvelope">Transform derivatives applied to envelopes</a></li>
 <li><a href="#DerivativeAndRaster">Transform derivatives applied to rasters</a></li>
@@ -1634,36 +1636,98 @@ while countries elongated along the Nort
 <h4 id="AffineTransform"><span class="section-number">3.3.1.1.</span> Affine transform</h4>
 <p>
 Among the many kinds of operations performed by <abbr>GIS</abbr> softwares on spatial coordinates,
-<cite>linear operations</cite> are both simple and very common.
-Linear operations are combinations of only additions and some multiplications.
-Linear operations do not include map projections, which are more complex, but cover many other cases:
+<cite>affine transforms</cite>  are both relatively simple and very common.
+Affine transforms can represent any combination of scales, shears, flips, rotations and translations,
+which are <em>linear</em> operations.
+Affine transforms can not handle <em>non-linear</em> operations like map projections,
+but the affine transform capabilities nevertheless cover many other cases:
 </p>
 <ul>
-<li>Change axis order, for example from (<var>latitude</var>, <var>longitude</var>) to (<var>longitude</var>, <var>latitude</var>).</li>
-<li>Change axis direction (for example the <var>y</var> axis in images is often oriented toward down).</li>
-<li>Change the prime meridian (for example from <cite>Paris</cite> to <cite>Greenwich</cite>).</li>
-<li>Change the number of dimensions (for example from 3-dimensional coordinates to 2-dimensional coordinates).</li>
-<li>Convert units of measurement (for example convert feet to metres).</li>
-<li>Convert pixel coordinates in an image to geodetic coordinates
-(for example the conversion represented in the <code>.tfw</code> files associated to some <abbr>TIFF</abbr> images).</li>
-<li>Handle a small part of map projection task
-(for example the <cite>False Easting</cite>, <cite>False Northing</cite> and <cite>Scale factor</cite> parameters).</li>
-<li>Apply rotations, translations, scales and shears (part of <cite>affines</cite> transforms).</li>
+<li>Axis order changes,           for example from (<var>latitude</var>, <var>longitude</var>) to (<var>longitude</var>, <var>latitude</var>).</li>
+<li>Axis direction changes,       for example the <var>y</var> axis oriented toward down in images.</li>
+<li>Prime meridian rotations,     for example from <cite>Paris</cite> to <cite>Greenwich</cite> prime meridian.</li>
+<li>Dimensionality changes,       for example from 3-dimensional coordinates to 2-dimensional coordinates by dropping the height.</li>
+<li>Unit conversion,              for example from feet to metres.</li>
+<li>Pixel to geodetic coordinate, for example the conversion represented in the <code>.tfw</code> files associated to some <abbr>TIFF</abbr> images.</li>
+<li>Part of map projections,      for example the <cite>False Easting</cite>, <cite>False Northing</cite> and <cite>Scale factor</cite> parameters.</li>
 </ul>
 <p>
-Linear operations can be concatenated efficiently.
-No matter how many linear operations are chained, the result can be represented by a single linear operation.
-This property is more easily seen when linear operations are represented by matrices:
-in order to concatenate those operations, we only need to multiply the matrices.
+Affine transforms can be concatenated efficiently.
+No matter how many affine transforms are chained, the result can be represented by a single affine transform.
+This property is more easily seen when affine transforms are represented by matrices:
+in order to concatenate those operations, we only need to multiply those matrices.
+The “pixel to geographic coordinate conversions” case below gives an example.
 </p>
-<div class="example"><p><b>Example:</b>
-give an image with pixel coordinates represented by (<var>i</var>,<var>j</var>) coordinates,
-assuming that all pixels have the same size in longitude and latitude degrees,
-and assuming there there is no rotation, then conversion from
-(<var>i</var>,<var>j</var>) pixel coordinates to (<var>λ</var>,<var>φ</var>) geographic coordinates
-can be represented by the following matrices:</p>
 
-<table class="hidden"><tr><td>
+<div class="example">
+<p><b>Example:</b>
+given an image with pixel coordinates represented by (<var>x</var>,<var>y</var>) tuples
+and given the following assumptions:
+</p>
+<ul>
+<li>There is no shear, no rotation and no flip.</li>
+<li>All pixels have the same width in degrees of longitude.</li>
+<li>All pixels have the same height in degrees of latitude.</li>
+<li>Pixel indices are positive integers starting at (0,0) inclusive.</li>
+</ul>
+<p>Then conversions from pixel coordinates (<var>x</var>,<var>y</var>)
+to geographic coordinates (<var>λ</var>,<var>φ</var>) can be represented by the following equations,
+where <var>N</var><sub><var>x</var></sub> is the image width and
+<var>N</var><sub><var>y</var></sub> the image height in number of pixels:
+</p><p>
+
+
+<math xmlns="http://www.w3.org/1998/Math/MathML" alttext="MathML capable browser required" display="block">
+<mtable>
+<mtr>
+<mtd><mo>λ</mo></mtd>
+<mtd><mo>=</mo></mtd>
+<mtd><msub><mi>S</mi><mrow>λ</mrow></msub><mi>x</mi><mo>+</mo><msub><mi>T</mi><mrow>λ</mrow></msub></mtd>
+<mtd><mtext>        where        </mtext></mtd>
+<mtd><msub><mi>S</mi><mrow>λ</mrow></msub></mtd>
+<mtd><mo>=</mo></mtd>
+<mtd>
+<mfrac>
+<mrow>
+<msub><mi>λ</mi><mrow>max</mrow></msub><mo>-</mo>
+<msub><mi>λ</mi><mrow>min</mrow></msub>
+</mrow><mrow>
+<msub><mi>N</mi><mrow><mi>x</mi></mrow></msub>
+</mrow>
+</mfrac>
+</mtd>
+<mtd><mtext>    and    </mtext></mtd>
+<mtd><msub><mi>T</mi><mrow>λ</mrow></msub></mtd>
+<mtd><mo>=</mo></mtd>
+<mtd><msub><mi>λ</mi><mrow>min</mrow></msub></mtd>
+</mtr>
+<mtr>
+<mtd><mo>φ</mo></mtd>
+<mtd><mo>=</mo></mtd>
+<mtd><msub><mi>S</mi><mrow>φ</mrow></msub><mi>y</mi><mo>+</mo><msub><mi>T</mi><mrow>φ</mrow></msub></mtd>
+<mtd><mtext>        where        </mtext></mtd>
+<mtd><msub><mi>S</mi><mrow>φ</mrow></msub></mtd>
+<mtd><mo>=</mo></mtd>
+<mtd>
+<mfrac>
+<mrow>
+<msub><mi>φ</mi><mrow>max</mrow></msub><mo>-</mo>
+<msub><mi>φ</mi><mrow>min</mrow></msub>
+</mrow><mrow>
+<msub><mi>N</mi><mrow><mi>y</mi></mrow></msub>
+</mrow>
+</mfrac>
+</mtd>
+<mtd><mtext>    and    </mtext></mtd>
+<mtd><msub><mi>T</mi><mrow>φ</mrow></msub></mtd>
+<mtd><mo>=</mo></mtd>
+<mtd><msub><mi>φ</mi><mrow>min</mrow></msub></mtd>
+</mtr>
+</mtable>
+</math>
+</p><p>
+Above equations can be represented in matrix form as below:
+</p><p>
 
 
 <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="MathML capable browser required" display="block">
@@ -1679,11 +1743,11 @@ can be represented by the following matr
 <mtable>
 <mtr>
 <mtd><msub><mi>S</mi><mrow>λ</mrow></msub></mtd>
-<mtd><msub><mi>H</mi><mrow>λ</mrow></msub></mtd>
+<mtd><mn>0</mn></mtd>
 <mtd><msub><mi>T</mi><mrow>λ</mrow></msub></mtd>
 </mtr>
 <mtr>
-<mtd><msub><mi>H</mi><mrow>φ</mrow></msub></mtd>
+<mtd><mn>0</mn></mtd>
 <mtd><msub><mi>S</mi><mrow>φ</mrow></msub></mtd>
 <mtd><msub><mi>T</mi><mrow>φ</mrow></msub></mtd>
 </mtr>
@@ -1697,29 +1761,33 @@ can be represented by the following matr
 <mo>×</mo>
 <mfenced close="]" open="[">
 <mtable>
-<mtr><mtd><mi>i</mi></mtd></mtr>
-<mtr><mtd><mi>j</mi></mtd></mtr>
+<mtr><mtd><mi>x</mi></mtd></mtr>
+<mtr><mtd><mi>y</mi></mtd></mtr>
 <mtr><mtd><mn>1</mn></mtd></mtr>
 </mtable>
 </mfenced>
 </math>
-</td><td style="vertical-align: middle; padding-left: 30px">
-where
-</td><td style="vertical-align: middle">
-<ul>
-<li><var>S</var> is a scale factor which, in this example, is equals to the pixel size in degrees.</li>
-<li><var>H</var> is a shear factor, usually equals to zero except if the image is rotated.</li>
-<li><var>T</var> is a translation term which, in this example, is equals to the geographic coordinate of an image corner.</li>
-</ul>
-</td></tr></table>
-<p>
-<span style="color: red">TODO</span>
+</p><p>
+In this particular case, scale factors <var>S</var> are the pixel size in degrees
+and translation terms <var>T</var> are the geographic coordinate of an image corner
+(not necessarily the lower-left corner if some axes have been flipped).
+This straightforward interpretation holds because of above-cited assumptions, but
+matrix coefficients become more complex if the image has shear or rotation
+or if pixel coordinates do not start at (0,0).
+However it is not necessary to use more complex equations for supporting more generic cases.
+The following example starts with an “initial conversion” matrix
+where the <var>S</var> and <var>T</var> terms are set to the most straightforward values.
+Then the <var>y</var> axis direction is reversed for matching the most common convention in image coordinate systems (change 1),
+and axis are swapped resulting in latitude before longitude (change 2).
+Note that when affine transform concatenations are written as matrix multiplications, operations are ordered from right to left:
+<var>A</var>×<var>B</var>×<var>C</var> is equivalent to first applying operation <var>C</var>,
+then operation <var>B</var> and finally operation <var>A</var>.
 </p>
 <table class="hidden"><tr>
 <th>Change 2</th><th/>
 <th>Change 1</th><th/>
-<th>Original conversion</th><th/>
-<th>Modified conversion</th>
+<th>Initial conversion</th><th/>
+<th>Concatenated operation</th>
 </tr><tr>
 <td style="vertical-align: middle">
 <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="MathML capable browser required" display="block">
@@ -1757,8 +1825,7 @@ where
 <mtr>
 <mtd><mn>0</mn></mtd>
 <mtd><mn>-1</mn></mtd>
-<mtd><mo>(</mo><msub><mi>j</mi><mrow>max</mrow></msub><mo>-</mo>
-<msub><mi>j</mi><mrow>min</mrow></msub><mo>)</mo></mtd>
+<msub><mi>N</mi><mrow><mi>y</mi></mrow></msub>
 </mtr>
 <mtr>
 <mtd><mn>0</mn></mtd>
@@ -1780,8 +1847,7 @@ where
 <msub><mi>λ</mi><mrow>max</mrow></msub><mo>-</mo>
 <msub><mi>λ</mi><mrow>min</mrow></msub>
 </mrow><mrow>
-<msub><mi>i</mi><mrow>max</mrow></msub><mo>-</mo>
-<msub><mi>i</mi><mrow>min</mrow></msub>
+<msub><mi>N</mi><mrow><mi>x</mi></mrow></msub>
 </mrow>
 </mfrac></mtd>
 <mtd><mn>0</mn></mtd>
@@ -1794,8 +1860,7 @@ where
 <msub><mi>φ</mi><mrow>max</mrow></msub><mo>-</mo>
 <msub><mi>φ</mi><mrow>min</mrow></msub>
 </mrow><mrow>
-<msub><mi>j</mi><mrow>max</mrow></msub><mo>-</mo>
-<msub><mi>j</mi><mrow>min</mrow></msub>
+<msub><mi>N</mi><mrow><mi>y</mi></mrow></msub>
 </mrow>
 </mfrac></mtd>
 <mtd><msub><mi>φ</mi><mrow>min</mrow></msub></mtd>
@@ -1821,8 +1886,7 @@ where
 <msub><mi>φ</mi><mrow>max</mrow></msub><mo>-</mo>
 <msub><mi>φ</mi><mrow>min</mrow></msub>
 </mrow><mrow>
-<msub><mi>j</mi><mrow>max</mrow></msub><mo>-</mo>
-<msub><mi>j</mi><mrow>min</mrow></msub>
+<msub><mi>N</mi><mrow><mi>y</mi></mrow></msub>
 </mrow>
 </mfrac></mtd>
 <mtd><msub><mi>φ</mi><mrow>max</mrow></msub></mtd>
@@ -1833,8 +1897,7 @@ where
 <msub><mi>λ</mi><mrow>max</mrow></msub><mo>-</mo>
 <msub><mi>λ</mi><mrow>min</mrow></msub>
 </mrow><mrow>
-<msub><mi>i</mi><mrow>max</mrow></msub><mo>-</mo>
-<msub><mi>i</mi><mrow>min</mrow></msub>
+<msub><mi>N</mi><mrow><mi>x</mi></mrow></msub>
 </mrow>
 </mfrac></mtd>
 <mtd><mn>0</mn></mtd>
@@ -1851,11 +1914,51 @@ where
 </td>
 </tr></table>
 <p>
-<span style="color: red">TODO</span>
+A key principle is that there is no need to write Java code dedicated to above kinds of axis changes.
+Those operations, and many other, can be handled by matrix algebra.
+This approach makes easier to write generic code and improves performance.
+Apache <abbr title="Spatial Information System">SIS</abbr> follows this principle by using affine transforms for every operations
+that can be performed by such transform.
+For instance there is no code dedicated to changing order of ordinate values in a coordinate.
 </p>
 </div>
 
-<p style="color: red">TODO</p>
+<h4 id="AffineTransformAPI"><span class="section-number">3.3.1.2.</span> Integration with graphical libraries</h4>
+<p>
+About all graphical libraries support some kind of coordinate operations, usually as <cite>affine transforms</cite>
+or a slight generalization like <cite>perspective transforms</cite>.
+Each library defines its own <abbr title="Application Programming Interface">API</abbr>. Some examples are listed below:
+</p>
+<table>
+<caption>Affine transform implementations in graphical libraries</caption>
+<tr><th>Library</th>                                  <th>Transform implementation</th>                          <th>Dimensions</th></tr>
+<tr><td>Java2D</td>                                   <td><code>java.awt.geom.AffineTransform</code></td>        <td>2</td></tr>
+<tr><td>Java3D</td>                                   <td><code>javax.media.j3d.Transform3D</code></td>          <td>3</td></tr>
+<tr><td>JavaFX</td>                                   <td><code>javafx.scene.transform.Affine</code></td>        <td>2 or 3</td></tr>
+<tr><td>Java Advanced Imaging (<abbr>JAI</abbr>)</td> <td><code>javax.media.jai.PerspectiveTransform</code></td> <td>2</td></tr>
+<tr><td>Android</td>                                  <td><code>android.graphics.Matrix</code></td>              <td>2</td></tr>
+</table>
+<p>
+However in many cases, affine or perspective transforms are the only kind of coordinate operations supported by the graphical library.
+Apache <abbr title="Spatial Information System">SIS</abbr> needs to handle a wider range of operations, in which affine transforms are only special cases.
+In particular most map projections and datum shifts can not be represented by affine transforms.
+<abbr>SIS</abbr> also needs to support arbitrary number of dimensions,
+while above-cited <abbr>API</abbr> restrict the use to a fixed number of dimensions.
+For those reasons <abbr>SIS</abbr> can not use directly the above-cited <abbr>API</abbr>.
+Instead, <abbr>SIS</abbr> uses the more abstract <code class="GeoAPI">org.opengis.referencing.transform.MathTransform</code> interface.
+But in the special case where the transform is actually affine, <abbr>SIS</abbr> may try to use an existing implementation,
+in particular Java2D. The following Java code can be used in situations where the Java2D object is desired:
+</p>
+<pre><code class="GeoAPI">MathTransform</code> mt = ...;    <code class="comment">// Any math transform created by Apache SIS.
+</code><b>if</b> (mt <b>instanceof</b> AffineTransform) {
+    AffineTransform at = (AffineTransform) mt;
+    <code class="comment">// Use Java2D API from here.
+</code>}</pre>
+<p>
+However <abbr>SIS</abbr> uses Java2D on a <em>best effort</em> basis only.
+The above cast is not guaranteed to succeed,
+even when the <code class="GeoAPI">MathTransform</code> meets the requirements allowing Java2D usage.
+</p>
 
 <h3 id="TransformDerivative"><span class="section-number">3.3.2.</span> Partial derivatives of coordinate operations</h3>
 <p>

Modified: sis/site/trunk/content/book/fr/developer-guide.html
URL: http://svn.apache.org/viewvc/sis/site/trunk/content/book/fr/developer-guide.html?rev=1746518&r1=1746517&r2=1746518&view=diff
==============================================================================
--- sis/site/trunk/content/book/fr/developer-guide.html [UTF-8] (original)
+++ sis/site/trunk/content/book/fr/developer-guide.html [UTF-8] Thu Jun  2 04:57:06 2016
@@ -60,7 +60,8 @@
 <li><a href="#CRS_UserCode">Ajout de d�finitions</a></li></ul></li>
 <li><a href="#CoordinateOperation">Op�rations sur les coordonn�es</a><ul>
 <li><a href="#MathTransform">Ex�cution de op�rations</a><ul>
-<li><a href="#AffineTransform">Les transformations affines</a></li></ul></li>
+<li><a href="#AffineTransform">Les transformations affines</a></li>
+<li><a href="#AffineTransformAPI">Int�gration avec les biblioth�ques graphiques</a></li></ul></li>
 <li><a href="#TransformDerivative">D�riv�es partielles des op�rations</a><ul>
 <li><a href="#DerivativeAndEnvelope">Utilit� des d�riv�es pour la reprojection d\u2019enveloppes</a></li>
 <li><a href="#DerivativeAndRaster">Utilit� des d�riv�es pour la reprojection d\u2019images</a></li>
@@ -1429,7 +1430,8 @@ de la biblioth�que <abbr>SIS</abbr>.
 <li><a href="#CRS_UserCode">Ajout de d�finitions</a></li></ul></li>
 <li><a href="#CoordinateOperation">Op�rations sur les coordonn�es</a><ul>
 <li><a href="#MathTransform">Ex�cution de op�rations</a><ul>
-<li><a href="#AffineTransform">Les transformations affines</a></li></ul></li>
+<li><a href="#AffineTransform">Les transformations affines</a></li>
+<li><a href="#AffineTransformAPI">Int�gration avec les biblioth�ques graphiques</a></li></ul></li>
 <li><a href="#TransformDerivative">D�riv�es partielles des op�rations</a><ul>
 <li><a href="#DerivativeAndEnvelope">Utilit� des d�riv�es pour la reprojection d\u2019enveloppes</a></li>
 <li><a href="#DerivativeAndRaster">Utilit� des d�riv�es pour la reprojection d\u2019images</a></li>
@@ -1687,36 +1689,102 @@ alors que les pays plut�t allong�s dan
 
 <h4 id="AffineTransform"><span class="section-number">3.3.1.1.</span> Les transformations affines</h4>
 <p>
-Parmi les sortes d\u2019op�rations qu\u2019un <abbr>SIG</abbr> doit effectuer sur les coordonn�es spatiales, il en est une � la fois simple et tr�s fr�quente.
-Ce sont les op�rations lin�aires, constitu�es uniquement d\u2019une combinaison d\u2019additions et de certaines multiplications.
-Ces op�rations n\u2019effectuent pas de projections cartographiques, plus complexes, mais couvrent de nombreux autres cas:
-</p>
-<ul>
-<li>Changer l\u2019ordre des axes, par exemple de (<var>latitude</var>, <var>longitude</var>) vers (<var>longitude</var>, <var>latitude</var>).</li>
-<li>Changer la direction des axes (par exemple l\u2019axe des <var>y</var> des images pointe souvent vers le bas).</li>
-<li>Changer de m�ridien d\u2019origine (par exemple de <cite>Paris</cite> vers <cite>Greenwich</cite>).</li>
-<li>Changer le nombre de dimensions (par exemple passer des coordonn�es 3D vers 2D).</li>
-<li>Convertir des unit�s de mesures (par exemple convertir des pieds en m�tres).</li>
-<li>Convertir les coordonn�es pixels d\u2019une image en coordonn�es g�ographiques
-(par exemple la conversion exprim�e dans les fichiers <code>.tfw</code> qui accompagnent certaines images <abbr>TIFF</abbr>).</li>
-<li>Prendre en charge une petite partie des projections cartographiques
-(par exemple les param�tres <cite>False Easting</cite>, <cite>False Northing</cite> et <cite>Scale factor</cite>).</li>
-<li>Appliquer des rotations, translations, �chelles ou cisaillements (des transformations dites <cite>affines</cite>).</li>
-</ul>
-<p>
-Les op�rations lin�aires peuvent se combiner efficacement:
-peu importe le nombre d\u2019op�rations lin�aires que l\u2019on encha�ne, le r�sultat sera exprimable par une seule op�ration lin�aire.
-Cette propri�t� est plus facilement visible lorsque les op�rations lin�aires sont exprim�es sous forme de matrices:
+Parmi les sortes d\u2019op�rations qu\u2019un <abbr>SIG</abbr> doit effectuer sur les coordonn�es spatiales,
+les <cite>transformations affines</cite> sont � la fois relativement simples et tr�s fr�quentes.
+Les transformations affines peuvent repr�senter n\u2019importe quelle combinaison d\u2019�chelles, de cisaillements,
+de retournements, de rotations ou de translations, qui sont toutes des <cite>op�rations lin�aires</cite>.
+Les transformations affines ne peuvent pas effectuer des op�rations <cite>non-lin�aires</cite>
+telles que les projections cartographiques, mais couvrent n�anmoins de nombreux autres cas:
+</p>
+<ul>
+<li>Changer l\u2019ordre des axes,        par exemple de (<var>latitude</var>, <var>longitude</var>) vers (<var>longitude</var>, <var>latitude</var>).</li>
+<li>Changer la direction des axes,   par exemple l\u2019axe des <var>y</var> qui pointe habituellement vers le bas dans les images.</li>
+<li>Changer le m�ridien d\u2019origine,   par exemple du m�ridien de <cite>Paris</cite> vers celui de <cite>Greenwich</cite>.</li>
+<li>Changer le nombre de dimensions, par exemple passer des coordonn�es 3D vers 2D en supprimant la hauteur.</li>
+<li>Convertir des unit�s de mesures, par exemple convertir des pieds en m�tres.</li>
+<li>Convertir des coordonn�es pixels en coordonn�es g�ographiques,
+par exemple la conversion exprim�e dans les fichiers <code>.tfw</code> qui accompagnent certaines images <abbr>TIFF</abbr>.</li>
+<li>Prendre en charge une petite partie des projections cartographiques,
+par exemple les param�tres <cite>False Easting</cite>, <cite>False Northing</cite> et <cite>Scale factor</cite>.</li>
+</ul>
+<p>
+Les transformations affines peuvent se combiner efficacement.
+Peu importe le nombre de transformations affines que l\u2019on encha�ne, le r�sultat sera exprimable par une seule transformation affine.
+Cette propri�t� est plus facilement visible lorsque les transformations affines sont exprim�es sous forme de matrices:
 pour combiner les op�rations, il suffit de multiplier les matrices.
+Le cas des conversions des coordonn�es pixels en coordonn�es g�ographiques ci-dessous donne un exemple.
 </p>
-<div class="example"><p><b>Example:</b>
-supposons que nous disposons d\u2019une image dont les coordonn�es des pixels sont repr�sent�es par (<var>i</var>,<var>j</var>).
-Supposons que la taille de chaque pixel correspond � un nombre fixe de degr�es de longitude et de latitude
-dans un syst�me g�ographique donn� et qu\u2019il n\u2019y a pas de rotation.
-La conversion des coordonn�es pixels (<var>i</var>,<var>j</var>) vers les coordonn�es g�ographiques (<var>\u03bb</var>,<var>\u03c6</var>)
-est alors lin�aire et peut �tre repr�sent�e par la matrice suivante:</p>
 
-<table class="hidden"><tr><td>
+<div class="example">
+<p><b>Exemple:</b>
+supposons que nous disposons d\u2019une image dont les coordonn�es des pixels sont repr�sent�es par (<var>x</var>,<var>y</var>).
+Supposons aussi que les contraintes suivantes sont respect�es:
+</p>
+<ul>
+<li>Il n\u2019y a ni cisaillement, ni rotation, ni retournement de l\u2019image.</li>
+<li>Tous les pixels ont la m�me largeur en degr�s de longitude.</li>
+<li>Tous les pixels ont la m�me hauteur en degr�s de latitude.</li>
+<li>Les coordonn�es des pixels commencent � (0,0) inclusivement.</li>
+</ul>
+<p>Alors la conversion des coordonn�es pixels (<var>x</var>,<var>y</var>)
+vers les coordonn�es g�ographiques (<var>\u03bb</var>,<var>\u03c6</var>)
+peut �tre repr�sent�e par les �quations suivantes,
+o� <var>N</var><sub><var>x</var></sub> est la largeur
+et <var>N</var><sub><var>y</var></sub> la hauteur de l\u2019image en nombre de pixels.
+</p><p>
+
+
+<math xmlns="http://www.w3.org/1998/Math/MathML" alttext="MathML capable browser required" display="block">
+<mtable>
+<mtr>
+<mtd><mo>\u03bb</mo></mtd>
+<mtd><mo>=</mo></mtd>
+<mtd><msub><mi>S</mi><mrow>\u03bb</mrow></msub><mi>x</mi><mo>+</mo><msub><mi>T</mi><mrow>\u03bb</mrow></msub></mtd>
+<mtd><mtext>��������where��������</mtext></mtd>
+<mtd><msub><mi>S</mi><mrow>\u03bb</mrow></msub></mtd>
+<mtd><mo>=</mo></mtd>
+<mtd>
+<mfrac>
+<mrow>
+<msub><mi>\u03bb</mi><mrow>max</mrow></msub><mo>-</mo>
+<msub><mi>\u03bb</mi><mrow>min</mrow></msub>
+</mrow><mrow>
+<msub><mi>N</mi><mrow><mi>x</mi></mrow></msub>
+</mrow>
+</mfrac>
+</mtd>
+<mtd><mtext>����and����</mtext></mtd>
+<mtd><msub><mi>T</mi><mrow>\u03bb</mrow></msub></mtd>
+<mtd><mo>=</mo></mtd>
+<mtd><msub><mi>\u03bb</mi><mrow>min</mrow></msub></mtd>
+</mtr>
+<mtr>
+<mtd><mo>\u03c6</mo></mtd>
+<mtd><mo>=</mo></mtd>
+<mtd><msub><mi>S</mi><mrow>\u03c6</mrow></msub><mi>y</mi><mo>+</mo><msub><mi>T</mi><mrow>\u03c6</mrow></msub></mtd>
+<mtd><mtext>��������where��������</mtext></mtd>
+<mtd><msub><mi>S</mi><mrow>\u03c6</mrow></msub></mtd>
+<mtd><mo>=</mo></mtd>
+<mtd>
+<mfrac>
+<mrow>
+<msub><mi>\u03c6</mi><mrow>max</mrow></msub><mo>-</mo>
+<msub><mi>\u03c6</mi><mrow>min</mrow></msub>
+</mrow><mrow>
+<msub><mi>N</mi><mrow><mi>y</mi></mrow></msub>
+</mrow>
+</mfrac>
+</mtd>
+<mtd><mtext>����and����</mtext></mtd>
+<mtd><msub><mi>T</mi><mrow>\u03c6</mrow></msub></mtd>
+<mtd><mo>=</mo></mtd>
+<mtd><msub><mi>\u03c6</mi><mrow>min</mrow></msub></mtd>
+</mtr>
+</mtable>
+</math>
+</p><p>
+Les �quations ci-dessus peuvent �tre repr�sent�es sous forme de matrices comme ci-dessous:
+</p><p>
 
 
 <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="MathML capable browser required" display="block">
@@ -1732,11 +1800,11 @@ est alors lin�aire et peut �tre repr�
 <mtable>
 <mtr>
 <mtd><msub><mi>S</mi><mrow>\u03bb</mrow></msub></mtd>
-<mtd><msub><mi>H</mi><mrow>\u03bb</mrow></msub></mtd>
+<mtd><mn>0</mn></mtd>
 <mtd><msub><mi>T</mi><mrow>\u03bb</mrow></msub></mtd>
 </mtr>
 <mtr>
-<mtd><msub><mi>H</mi><mrow>\u03c6</mrow></msub></mtd>
+<mtd><mn>0</mn></mtd>
 <mtd><msub><mi>S</mi><mrow>\u03c6</mrow></msub></mtd>
 <mtd><msub><mi>T</mi><mrow>\u03c6</mrow></msub></mtd>
 </mtr>
@@ -1750,35 +1818,35 @@ est alors lin�aire et peut �tre repr�
 <mo>�</mo>
 <mfenced close="]" open="[">
 <mtable>
-<mtr><mtd><mi>i</mi></mtd></mtr>
-<mtr><mtd><mi>j</mi></mtd></mtr>
+<mtr><mtd><mi>x</mi></mtd></mtr>
+<mtr><mtd><mi>y</mi></mtd></mtr>
 <mtr><mtd><mn>1</mn></mtd></mtr>
 </mtable>
 </mfenced>
 </math>
-</td><td style="vertical-align: middle; padding-left: 30px">
-o�
-</td><td style="vertical-align: middle">
-<ul>
-<li><var>S</var> est un facteur d\u2019�chelle (<cite>Scale</cite>) correspondant dans cet exemple � la taille des pixels en degr�s.</li>
-<li><var>H</var> est un terme de cisaillement (<cite>Shear</cite>), habituellement z�ro sauf si l\u2019image a une rotation.</li>
-<li><var>T</var> est une translation (<cite>Translation</cite>) correspondant dans cet exemple � la coordonn�e g�ographique d\u2019un coin de l\u2019image.</li>
-</ul>
-</td></tr></table>
-<p>
-Concentrons notre attention sur la matrice du milieu dans l\u2019�quation ci-dessus.
-Si nous n\u2019interchangeons ni n\u2019inversons la direction d\u2019aucun axe, alors une conversion des coordonn�es pixels vers les coordonn�es g�ographiques
-pourrait s\u2019exprimer par la matrice ��conversion originale�� ci-dessous.
-Mais si l\u2019on veut en outre inverser la direction de l\u2019axe des <var>j</var> pour se conformer � la convention la plus courante appliqu�e aux images
-(��changement 1��) et interchanger l\u2019ordre des axes pour exprimer la latitude avant la longitude (��changement 2��),
-alors on peut exprimer ces modifications par des multiplications matricielles comme suit
-(l\u2019ordre dans laquelle les op�rations sont effectu�es sur les coordonn�es se lit de droite � gauche):
+</p><p>
+Dans ce cas particulier, les facteurs d\u2019�chelles <var>S</var> correspondent � la taille des pixels en degr�s
+et les termes de translations <var>T</var> correspondent aux coordonn�es g�ographiques d\u2019un coin de l\u2019image
+(pas n�cessairement le coin inf�rieur gauche si certains axes ont �t� retourn�s).
+Cette interpr�tation directe n\u2019est possible que lorsque les contraintes �num�r�es plus haut sont respect�es.
+Les coefficients des matrices deviennent plus complexes si l\u2019image a un cisaillement ou une rotation,
+ou si les coordonn�es des pixels ne commencent pas � (0,0).
+Toutefois il n\u2019est pas n�cessaire d\u2019utiliser des �quations plus complexes pour g�rer des cas plus g�n�riques.
+L\u2019exemple ci-dessous prend comme point de d�part la matrice d\u2019une ��conversion initiale��
+dans laquelle les coefficients <var>S</var> et <var>T</var> sont les valeurs relativement simples donn�es ci-dessus.
+Ensuite la direction de l\u2019axe des <var>y</var> est invers�e de mani�re � correspondre
+� la convention habituelle des syst�mes de coordonn�es des images (changement 1),
+et les axes sont intervertis de mani�re � avoir la latitude avant la longitude (changement 2).
+Notez que les concat�nations de transformations affines �crites sous forme de multiplications matricielles
+se lisent de droite � gauche:
+<var>A</var>�<var>B</var>�<var>C</var> est �quivalent � d\u2019abord appliquer l\u2019op�ration <var>C</var>,
+suivit de l\u2019op�ration <var>B</var> et finalement l\u2019op�ration <var>A</var>.
 </p>
 <table class="hidden"><tr>
 <th>Changement 2</th><th/>
 <th>Changement 1</th><th/>
-<th>Conversion originale</th><th/>
-<th>Conversion modifi�e</th>
+<th>Conversion initiale</th><th/>
+<th>Op�rations combin�es</th>
 </tr><tr>
 <td style="vertical-align: middle">
 <math xmlns="http://www.w3.org/1998/Math/MathML" alttext="MathML capable browser required" display="block">
@@ -1816,8 +1884,7 @@ alors on peut exprimer ces modifications
 <mtr>
 <mtd><mn>0</mn></mtd>
 <mtd><mn>-1</mn></mtd>
-<mtd><mo>(</mo><msub><mi>j</mi><mrow>max</mrow></msub><mo>-</mo>
-<msub><mi>j</mi><mrow>min</mrow></msub><mo>)</mo></mtd>
+<msub><mi>N</mi><mrow><mi>y</mi></mrow></msub>
 </mtr>
 <mtr>
 <mtd><mn>0</mn></mtd>
@@ -1839,8 +1906,7 @@ alors on peut exprimer ces modifications
 <msub><mi>\u03bb</mi><mrow>max</mrow></msub><mo>-</mo>
 <msub><mi>\u03bb</mi><mrow>min</mrow></msub>
 </mrow><mrow>
-<msub><mi>i</mi><mrow>max</mrow></msub><mo>-</mo>
-<msub><mi>i</mi><mrow>min</mrow></msub>
+<msub><mi>N</mi><mrow><mi>x</mi></mrow></msub>
 </mrow>
 </mfrac></mtd>
 <mtd><mn>0</mn></mtd>
@@ -1853,8 +1919,7 @@ alors on peut exprimer ces modifications
 <msub><mi>\u03c6</mi><mrow>max</mrow></msub><mo>-</mo>
 <msub><mi>\u03c6</mi><mrow>min</mrow></msub>
 </mrow><mrow>
-<msub><mi>j</mi><mrow>max</mrow></msub><mo>-</mo>
-<msub><mi>j</mi><mrow>min</mrow></msub>
+<msub><mi>N</mi><mrow><mi>y</mi></mrow></msub>
 </mrow>
 </mfrac></mtd>
 <mtd><msub><mi>\u03c6</mi><mrow>min</mrow></msub></mtd>
@@ -1880,8 +1945,7 @@ alors on peut exprimer ces modifications
 <msub><mi>\u03c6</mi><mrow>max</mrow></msub><mo>-</mo>
 <msub><mi>\u03c6</mi><mrow>min</mrow></msub>
 </mrow><mrow>
-<msub><mi>j</mi><mrow>max</mrow></msub><mo>-</mo>
-<msub><mi>j</mi><mrow>min</mrow></msub>
+<msub><mi>N</mi><mrow><mi>y</mi></mrow></msub>
 </mrow>
 </mfrac></mtd>
 <mtd><msub><mi>\u03c6</mi><mrow>max</mrow></msub></mtd>
@@ -1892,8 +1956,7 @@ alors on peut exprimer ces modifications
 <msub><mi>\u03bb</mi><mrow>max</mrow></msub><mo>-</mo>
 <msub><mi>\u03bb</mi><mrow>min</mrow></msub>
 </mrow><mrow>
-<msub><mi>i</mi><mrow>max</mrow></msub><mo>-</mo>
-<msub><mi>i</mi><mrow>min</mrow></msub>
+<msub><mi>N</mi><mrow><mi>x</mi></mrow></msub>
 </mrow>
 </mfrac></mtd>
 <mtd><mn>0</mn></mtd>
@@ -1910,14 +1973,15 @@ alors on peut exprimer ces modifications
 </td>
 </tr></table>
 <p>
-L\u2019id�e principale est qu\u2019il n\u2019y a pas besoin d\u2019�crire un code d�di� � l\u2019inversion des axes.
-Cette op�ration, et bien d\u2019autres, est prise en compte naturellement par l\u2019alg�bre matricielle.
+Un principe cl� est qu\u2019il n\u2019y a pas besoin d\u2019�crire un code d�di� � ce type d\u2019op�rations sur les axes.
+Ces op�rations, et bien d\u2019autres, sont prises en compte naturellement par l\u2019alg�bre matricielle.
 On y gagne en g�n�ricit� du code et en performance.
+Apache <abbr title="Spatial Information System">SIS</abbr> suit ce principe en utilisant les tranformations affine pour toutes les op�rations
+o� elles peuvent s\u2019appliquer.
+Il n\u2019y a par exemple aucun code d�di� au changement de l\u2019ordre des ordonn�es dans une coordonn�e.
 </p>
 </div>
 
-<p style="color: red">TODO</p>
-
 <article>
 <header>
 <h1>Particularit�s d\u2019une biblioth�que de calculs matriciels pour un <abbr>SIG</abbr></h1>
@@ -2033,6 +2097,47 @@ En r�sum�, les besoins qui ont amen�
 </ul>
 </article>
 
+<h4 id="AffineTransformAPI"><span class="section-number">3.3.1.2.</span> Int�gration avec les biblioth�ques graphiques</h4>
+<p>
+A peu pr�s toutes les biblioth�ques graphiques supportent une forme de transformation de coordonn�es,
+souvent les <cite>transformations affines</cite> ou une l�g�re g�n�ralisation.
+Chaque biblioth�que d�fini son propre <abbr title="Application Programming Interface">API</abbr>.
+Quelques exemples sont:
+</p>
+<table>
+<caption>Impl�mentations des transformations affines dans des biblioth�ques graphiques</caption>
+<tr><th>Biblioth�que</th>                             <th>Implementation de la transformation</th>               <th>Dimensions</th></tr>
+<tr><td>Java2D</td>                                   <td><code>java.awt.geom.AffineTransform</code></td>        <td>2</td></tr>
+<tr><td>Java3D</td>                                   <td><code>javax.media.j3d.Transform3D</code></td>          <td>3</td></tr>
+<tr><td>JavaFX</td>                                   <td><code>javafx.scene.transform.Affine</code></td>        <td>2 ou 3</td></tr>
+<tr><td>Java Advanced Imaging (<abbr>JAI</abbr>)</td> <td><code>javax.media.jai.PerspectiveTransform</code></td> <td>2</td></tr>
+<tr><td>Android</td>                                  <td><code>android.graphics.Matrix</code></td>              <td>2</td></tr>
+</table>
+<p>
+Toutefois dans plusieurs cas, les transformations affines sont les seuls types d\u2019op�rations support�es par la biblioth�que graphique.
+Apache <abbr title="Spatial Information System">SIS</abbr> a besoin de g�rer un plus grand nombre de type d\u2019op�rations,
+parmi lesquelles les transformations affines ne sont que des cas particuliers.
+Les projections cartographiques et les changements de r�f�rentiels notamment,
+ne peuvent pas �tre repr�sent�s par des transformations affines.
+<abbr>SIS</abbr> a aussi besoin de transformer des points ayant un nombre arbitraire de dimensions,
+alors que les <abbr>API</abbr> cit�s ci-haut restreignent leur usage � un nombre fixe de dimensions.
+Pour ces raisons, <abbr>SIS</abbr> ne peut pas utiliser directement ces <abbr>API</abbr>.
+<abbr>SIS</abbr> utilise plut�t une interface plus abstraite, <code class="GeoAPI">org.opengis.referencing.transform.MathTransform</code>.
+Mais dans le cas particulier o� la transformation est r�ellement affine, <abbr>SIS</abbr> peut essayer d\u2019utiliser
+une impl�mentation existante, surtout Java2D.
+Par exemple le code suivant peut �tre utilis� dans les situations o� un objet Java2D est d�sir�:
+</p>
+<pre><code class="GeoAPI">MathTransform</code> mt = ...;    <code class="comment">// N\u2019importe quelle instance cr��e par Apache SIS.
+</code><b>if</b> (mt <b>instanceof</b> AffineTransform) {
+    AffineTransform at = (AffineTransform) mt;
+    <code class="comment">// Utiliser l\u2019API de Java2D API � partir d\u2019ici.
+</code>}</pre>
+<p>
+Toutefois <abbr>SIS</abbr> n\u2019utilisera Java2D que sur une base opportuniste.
+Le for�age de type ci-haut n\u2019est pas garantit de r�ussir, m�me si l\u2019instance de
+<code class="GeoAPI">MathTransform</code> r�pond aux conditions qui devrait permettre un usage de Java2D.
+</p>
+
 <h3 id="TransformDerivative"><span class="section-number">3.3.2.</span> D�riv�es partielles des op�rations</h3>
 <p>
 La section pr�c�dente indiquait comment calculer les coordonn�es d\u2019un point g�ographique dans une projection au choix.