Author: desruisseaux Date: Fri Dec 7 13:09:01 2018 New Revision: 1848397 URL: http://svn.apache.org/viewvc?rev=1848397&view=rev Log: Add IP review for Geotk "GeophysicsCategory" class (renamed "ConvertedCategory"). Added: sis/ip-review/ConvertedCategory.xhtml sis/ip-review/ConvertedCategoryList.xhtml sis/ip-review/rev/10796/ConvertedCategory.xhtml sis/ip-review/rev/10796/ConvertedCategoryList.xhtml sis/ip-review/rev/20970/ConvertedCategory.xhtml sis/ip-review/rev/20970/ConvertedCategoryList.xhtml Added: sis/ip-review/ConvertedCategory.xhtml URL: http://svn.apache.org/viewvc/sis/ip-review/ConvertedCategory.xhtml?rev=1848397&view=auto ============================================================================== --- sis/ip-review/ConvertedCategory.xhtml (added) +++ sis/ip-review/ConvertedCategory.xhtml Fri Dec 7 13:09:01 2018 @@ -0,0 +1,54 @@ + + + + + ConvertedCategory history + + + +
+

ConvertedCategory history

+

Click on the commit message for inspecting the diff and how the code has been rewritten.

+

Command line:

+
svn log -r31996:1 http://svn.osgeo.org/geotools/trunk/modules/library/coverage/src/main/java/org/geotools/coverage/GeophysicsCategory.java
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Rev.DateAuthorMessage
306432008-06-12acusterCopyright headers: lib/coverage, this time with feeling (and the el in Toolkit)
305412008-06-06acusterCopyright review: update headers on lib/coverage
302582008-05-08acusterReshuffle the top level repo: drop uDig, move up trunk, tags, and branches.
302572008-05-08acusterMove trunk/gt/ directory contents up to trunk/ and drop gt
289222008-01-24acusterBump the (at)since version to 2.5 since WKTParser was cut from 2.4
288522008-01-21desruisseauxReverted back "view(ViewType)" methods to "geophysics(boolean)" in Category and GridSampleDimension because views other than "geophysics" and "packed" don't make sense in current design. However those various views still in GridCoverage2D, which can support a richer set including "photographic" because it know about all bands together (as opposite to Category/GridSampleDimension which don't know what the other bands are). Also removed a few deprecated constructors and changed ViewType constants.
288462008-01-20desruisseauxCovariant return type for inverse() method in MathTransform1D and MathTransform2D. Also javadoc fixes and Java 5 type safety. Changed ViewType to an enum and initial implementation of GridCoverageViews (not yet connected to GridCoverage2D).
285402007-12-29acusterHide buttons which are not yet used
282522007-12-04desruisseauxMore MosaicImageReader work. As a side effect, moved Utilities.getShort[Class]Name in a separated utilities class named 'Classes'. Also added a couple of @Override annotations.
275752007-10-22desruisseauxConverted Java source files from ISO-LATIN-1 encoding to UTF-8 (GEOT-1516).
223272006-10-23desruisseauxGEOT-982: regroup 'module', 'plugin', 'ext' and 'unsupported' in a common directory.
223152006-10-22desruisseauxReorganisation of directory tree structure (GEOT-982) phase 1: moved 'src' to 'src/main/java'.
209702006-08-11jgarnettIP review.txt updated, along with headers
176722006-01-19desruisseauxAdded @source tag.
176602006-01-18desruisseauxFixed SVN attributes, including the addition of URL attribute.
165722005-11-02desruisseauxMoved coverage implementation to its own module (GEOT-745)
157362005-09-19desruisseauxAdded convenience methods or constructors
148342005-07-20desruisseauxReorganized I18N resources
139252005-05-30desruisseauxAdded @since javadoc tag
115492005-02-22desruisseauxInitial cleaning for restarting GridCoverage work
110012005-02-02desruisseauxFixed wrong encoding in main/src
107962005-01-28dzwiersimports cleaned
85212004-10-11desruisseauxFixed compilation errors caused by latest CRS commit
63012004-06-03desruisseauxRefactored basic transform in their own package
62592004-05-31desruisseauxAdded more implementations for Coverage support
62382004-05-28desruisseauxReplaced org.geotools.[...].TransformException by org.opengis.[...].TransformException
62102004-05-27desruisseauxJavadoc fixes / Added Id keyword property
61602004-05-25desruisseauxInitial refactoring of Category
+
+ + Added: sis/ip-review/ConvertedCategoryList.xhtml URL: http://svn.apache.org/viewvc/sis/ip-review/ConvertedCategoryList.xhtml?rev=1848397&view=auto ============================================================================== --- sis/ip-review/ConvertedCategoryList.xhtml (added) +++ sis/ip-review/ConvertedCategoryList.xhtml Fri Dec 7 13:09:01 2018 @@ -0,0 +1,54 @@ + + + + + ConvertedCategoryList history + + + +
+

ConvertedCategoryList history

+

Click on the commit message for inspecting the diff and how the code has been rewritten.

+

Command line:

+
svn log -r31996:1 http://svn.osgeo.org/geotools/trunk/modules/library/coverage/src/main/java/org/geotools/coverage/GeophysicsCategoryList.java
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Rev.DateAuthorMessage
307602008-06-18desruisseauxUpgrated from JSR-108 to JSR-275 (GEOT-1266). Some opportunist javadoc fixes and @Override annotations in the process.
306432008-06-12acusterCopyright headers: lib/coverage, this time with feeling (and the el in Toolkit)
305412008-06-06acusterCopyright review: update headers on lib/coverage
303132008-05-16desruisseauxChanged my mind about Utilities.shallowEquals(Object,Object) and renamed it as equals, since a few tests show that the compiler always select the best overloaded flavor working on primitive types (except if an argument is a boolean and the other a different primitive type). Updated a few references. Fixed a few javadoc warnings by explicit declaration of parameter and return values.
302582008-05-08acusterReshuffle the top level repo: drop uDig, move up trunk, tags, and branches.
302572008-05-08acusterMove trunk/gt/ directory contents up to trunk/ and drop gt
289222008-01-24acusterBump the (at)since version to 2.5 since WKTParser was cut from 2.4
288522008-01-21desruisseauxReverted back "view(ViewType)" methods to "geophysics(boolean)" in Category and GridSampleDimension because views other than "geophysics" and "packed" don't make sense in current design. However those various views still in GridCoverage2D, which can support a richer set including "photographic" because it know about all bands together (as opposite to Category/GridSampleDimension which don't know what the other bands are). Also removed a few deprecated constructors and changed ViewType constants.
288462008-01-20desruisseauxCovariant return type for inverse() method in MathTransform1D and MathTransform2D. Also javadoc fixes and Java 5 type safety. Changed ViewType to an enum and initial implementation of GridCoverageViews (not yet connected to GridCoverage2D).
285402007-12-29acusterHide buttons which are not yet used
285002007-12-24desruisseauxAdded a new GridGeometry implementation (ImageGeometry) has a lightweight placeholder for 'gridRange' as a Rectangle and 'gridToCRS' as an AffineTransform. Used by TileBuilder.
284642007-12-21desruisseauxFirst draft of a TileCollection helper class. Not yet tested.
275752007-10-22desruisseauxConverted Java source files from ISO-LATIN-1 encoding to UTF-8 (GEOT-1516).
228172006-11-17desruisseauxFixed SVN properties for all Java files.
227102006-11-12desruisseauxReview of coverage branch merge: In 'CategoryList', check for the 'no data' category name only if the geophysics value is some NaN value. Moved XAffineTransform to a public place and added methods for testing axis swapping, as a proposed replacement for 'GeneralGridGeometry.swapXY(CoordinateSystem)' (replacement not yet done; waiting for the okay from the mailing list). In GeneralGridGeometry, added methods for returning a math transform relative to some pixel corner instead of pixel center, as a proposed replacement for the 'getTransform(...)' public static methods (I would like to remove those static methods in order to keep the API a little bit more orthogonal).
223272006-10-23desruisseauxGEOT-982: regroup 'module', 'plugin', 'ext' and 'unsupported' in a common directory.
223152006-10-22desruisseauxReorganisation of directory tree structure (GEOT-982) phase 1: moved 'src' to 'src/main/java'.
209702006-08-11jgarnettIP review.txt updated, along with headers
206002006-07-18simboss-committing first bunch of changes from the coverage branch. Modules involved are*api *referencing *coverage *main *renderer *shaperenderer
176722006-01-19desruisseauxAdded @source tag.
176602006-01-18desruisseauxFixed SVN attributes, including the addition of URL attribute.
165722005-11-02desruisseauxMoved coverage implementation to its own module (GEOT-745)
157362005-09-19desruisseauxAdded convenience methods or constructors
139252005-05-30desruisseauxAdded @since javadoc tag
115492005-02-22desruisseauxInitial cleaning for restarting GridCoverage work
110012005-02-02desruisseauxFixed wrong encoding in main/src
107962005-01-28dzwiersimports cleaned
62592004-05-31desruisseauxAdded more implementations for Coverage support
+
+ + Added: sis/ip-review/rev/10796/ConvertedCategory.xhtml URL: http://svn.apache.org/viewvc/sis/ip-review/rev/10796/ConvertedCategory.xhtml?rev=1848397&view=auto ============================================================================== --- sis/ip-review/rev/10796/ConvertedCategory.xhtml (added) +++ sis/ip-review/rev/10796/ConvertedCategory.xhtml Fri Dec 7 13:09:01 2018 @@ -0,0 +1,80 @@ + + + + + ConvertedCategory changes for revisions 10795:10796 + + + +
+

ConvertedCategory changes for revisions 10795:10796

+

Changes in this commit seem to be the result of some "auto reformat" tool execution. +The Java - GeoAPI - GeoTools 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.

+

Command line:

+
svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r10795:10796 http://svn.osgeo.org/geotools/trunk/modules/library/coverage/src/main/java/org/geotools/coverage/GeophysicsCategory.java
+ + + + + + +
Revision 10795Revision 10796
/*
+ * Geotools 2 - OpenSource mapping toolkit
+ * (C) 2003, Geotools Project Management Committee (PMC)
+ * (C) 2001, Institut de Recherche pour le Développement
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
/*
+ * Geotools 2 - OpenSource mapping toolkit
+ * (C) 2003, Geotools Project Management Committee (PMC)
+ * (C) 2001, Institut de Recherche pour le D�veloppement
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
// J2SE dependencies
+import java.awt.Color;
+import java.util.Locale;
+
+// OpenGIS dependencies
+import org.opengis.util.InternationalString;
+import org.opengis.referencing.FactoryException;
+import org.opengis.referencing.operation.MathTransform1D;
+import org.opengis.referencing.operation.TransformException;
+import org.opengis.referencing.operation.MathTransformFactory;
+
+// Geotools dependencies
+import org.geotools.util.NumberRange;
+import org.geotools.resources.Utilities;
+import org.geotools.resources.gcs.Resources;
+import org.geotools.resources.gcs.ResourceKeys;
+import org.geotools.referencing.FactoryFinder;
+import org.geotools.referencing.operation.transform.LinearTransform1D;
+
+
+/**
+ * A "geophysics" view of a category. Sample values in this category are equal to geophysics
+ * values.   By definition, the {@link #getSampleToGeophysics} method for this class returns
// J2SE dependencies
+import java.awt.Color;
+
+import org.geotools.referencing.FactoryFinder;
+import org.geotools.referencing.operation.transform.LinearTransform1D;
+import org.geotools.resources.Utilities;
+import org.geotools.resources.gcs.ResourceKeys;
+import org.geotools.resources.gcs.Resources;
+import org.geotools.util.NumberRange;
+import org.opengis.referencing.FactoryException;
+import org.opengis.referencing.operation.MathTransform1D;
+import org.opengis.referencing.operation.MathTransformFactory;
+import org.opengis.referencing.operation.TransformException;
+import org.opengis.util.InternationalString;
+
+
+/**
+ * A "geophysics" view of a category. Sample values in this category are equal to geophysics
+ * values.   By definition, the {@link #getSampleToGeophysics} method for this class returns
+
+ + Added: sis/ip-review/rev/10796/ConvertedCategoryList.xhtml URL: http://svn.apache.org/viewvc/sis/ip-review/rev/10796/ConvertedCategoryList.xhtml?rev=1848397&view=auto ============================================================================== --- sis/ip-review/rev/10796/ConvertedCategoryList.xhtml (added) +++ sis/ip-review/rev/10796/ConvertedCategoryList.xhtml Fri Dec 7 13:09:01 2018 @@ -0,0 +1,147 @@ + + + + + ConvertedCategoryList changes for revisions 10795:10796 + + + +
+

ConvertedCategoryList changes for revisions 10795:10796

+

Changes in this commit seem to be the result of some "auto reformat" tool execution. +The Java - GeoAPI - GeoTools 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.

+

Command line:

+
svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r10795:10796 http://svn.osgeo.org/geotools/trunk/modules/library/coverage/src/main/java/org/geotools/coverage/GeophysicsCategoryList.java
+ + + + + + + + + + + + +
Revision 10795Revision 10796
/*
+ * Geotools 2 - OpenSource mapping toolkit
+ * (C) 2003, Geotools Project Management Committee (PMC)
+ * (C) 2001, Institut de Recherche pour le Développement
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
/*
+ * Geotools 2 - OpenSource mapping toolkit
+ * (C) 2003, Geotools Project Management Committee (PMC)
+ * (C) 2001, Institut de Recherche pour le D�veloppement
+ *
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
package org.geotools.coverage;
+
+// J2SE dependencies
+import java.util.Locale;
+import java.text.NumberFormat;
+import java.text.FieldPosition;
+import javax.units.Unit;
+
+// Resources
+import org.geotools.resources.XMath;
+import org.geotools.resources.Utilities;
+
+
+/**
package org.geotools.coverage;
+
+// J2SE dependencies
+import java.text.FieldPosition;
+import java.text.NumberFormat;
+import java.util.AbstractList;
+import java.util.Locale;
+
+import javax.units.Unit;
+
+import org.geotools.resources.Utilities;
+import org.geotools.resources.XMath;
+
+
+/**
private static final int MAX_DIGITS = 6;
+
+/**
+ * Unités des mesures géophysiques représentées par les catégories.
+ * Ce champ peut être nul s'il ne s'applique pas ou si les unités
+ * ne sont pas connues.
+ */
+private final Unit unit;
+
+/**
+ * Nombre de chiffres significatifs après la virgule.
+ * Cette information est utilisée pour les écritures
+ * des valeurs géophysiques des catégories.
+ */
+private final int ndigits;
private static final int MAX_DIGITS = 6;
+
+/**
+ * Unit�s des mesures g�ophysiques repr�sent�es par les cat�gories.
+ * Ce champ peut �tre nul s'il ne s'applique pas ou si les unit�s
+ * ne sont pas connues.
+ */
+private final Unit unit;
+
+/**
+ * Nombre de chiffres significatifs apr�s la virgule.
+ * Cette information est utilis�e pour les �critures
+ * des valeurs g�ophysiques des cat�gories.
+ */
+private final int ndigits;
private transient Locale locale;
+
+/**
+ * Format à utiliser pour écrire les
+ * valeurs géophysiques des thèmes.
+ */
+private transient NumberFormat format;
private transient Locale locale;
+
+/**
+ * Format � utiliser pour �crire les
+ * valeurs g�ophysiques des th�mes.
+ */
+private transient NumberFormat format;
}
+
+/**
+ * Formatte la valeur spécifiée selon les conventions locales. Le nombre sera
+ * écrit avec un nombre de chiffres après la virgule approprié pour la catégorie.
+ * Le symbole des unités sera ajouté après le nombre si <code>writeUnit</code>
+ * est <code>true</code>.
+ *
+ * @param  value Valeur du paramètre géophysique à formatter.
+ * @param  writeUnit Indique s'il faut écrire le symbole des unités après le nombre.
+ *         Cet argument sera ignoré si aucune unité n'avait été spécifiée au constructeur.
+ * @param  locale Conventions locales à utiliser, ou <code>null</code> pour les conventions par
+ *         défaut.
+ * @param  buffer Le buffer dans lequel écrire la valeur.
+ * @return Le buffer <code>buffer</code> dans lequel auront été écrit la valeur et les unités.
+ */
+synchronized StringBuffer format(final double value, final boolean writeUnits,
+                                 final Locale locale, StringBuffer buffer)
}
+
+/**
+ * Formatte la valeur sp�cifi�e selon les conventions locales. Le nombre sera
+ * �crit avec un nombre de chiffres apr�s la virgule appropri� pour la cat�gorie.
+ * Le symbole des unit�s sera ajout� apr�s le nombre si <code>writeUnit</code>
+ * est <code>true</code>.
+ *
+ * @param  value Valeur du param�tre g�ophysique � formatter.
+ * @param  writeUnit Indique s'il faut �crire le symbole des unit�s apr�s le nombre.
+ *         Cet argument sera ignor� si aucune unit� n'avait �t� sp�cifi�e au constructeur.
+ * @param  locale Conventions locales � utiliser, ou <code>null</code> pour les conventions par
+ *         d�faut.
+ * @param  buffer Le buffer dans lequel �crire la valeur.
+ * @return Le buffer <code>buffer</code> dans lequel auront �t� �crit la valeur et les unit�s.
+ */
+synchronized StringBuffer format(final double value, final boolean writeUnits,
+                                 final Locale locale, StringBuffer buffer)
+
+ + Added: sis/ip-review/rev/20970/ConvertedCategory.xhtml URL: http://svn.apache.org/viewvc/sis/ip-review/rev/20970/ConvertedCategory.xhtml?rev=1848397&view=auto ============================================================================== --- sis/ip-review/rev/20970/ConvertedCategory.xhtml (added) +++ sis/ip-review/rev/20970/ConvertedCategory.xhtml Fri Dec 7 13:09:01 2018 @@ -0,0 +1,53 @@ + + + + + ConvertedCategory changes for revisions 20969:20970 + + + +
+

ConvertedCategory changes for revisions 20969:20970

+ +

Change in LGPL header does not apply to Apache SIS.

+ +

Command line:

+
svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r20969:20970 http://svn.osgeo.org/geotools/trunk/modules/library/coverage/src/main/java/org/geotools/coverage/GeophysicsCategory.java
+ + + + + + +
Revision 20969Revision 20970
/*
+ * Geotools 2 - OpenSource mapping toolkit
+ * (C) 2003, Geotools Project Management Committee (PMC)
+ * (C) 2001, Institut de Recherche pour le Développement
+ *
+ *    This library is free software; you can redistribute it and/or
/*
+ *    GeoTools - OpenSource mapping toolkit
+ *    http://geotools.org
+ *    (C) 2003-2006, Geotools Project Management Committee (PMC)
+ * (C) 2001, Institut de Recherche pour le Développement
+ *
+ *    This library is free software; you can redistribute it and/or
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+*    Lesser General Public License for more details.
+*
+*    You should have received a copy of the GNU Lesser General Public
+*    License along with this library; if not, write to the Free Software
+*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*
+*
+*    This package contains documentation from OpenGIS specifications.
+*    OpenGIS consortium's work is fully acknowledged here.
+*/
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+*    Lesser General Public License for more details.
+*
+*    This package contains documentation from OpenGIS specifications.
+*    OpenGIS consortium's work is fully acknowledged here.
+*/
+
+ + Added: sis/ip-review/rev/20970/ConvertedCategoryList.xhtml URL: http://svn.apache.org/viewvc/sis/ip-review/rev/20970/ConvertedCategoryList.xhtml?rev=1848397&view=auto ============================================================================== --- sis/ip-review/rev/20970/ConvertedCategoryList.xhtml (added) +++ sis/ip-review/rev/20970/ConvertedCategoryList.xhtml Fri Dec 7 13:09:01 2018 @@ -0,0 +1,69 @@ + + + + + ConvertedCategoryList changes for revisions 20599:20970 + + + +
+

ConvertedCategoryList changes for revisions 20599:20970

+ +

Change in LGPL header does not apply to Apache SIS. +Change in stop condition of the loop has been reverted.

+ +

Command line:

+
svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r20599:20970 http://svn.osgeo.org/geotools/trunk/modules/library/coverage/src/main/java/org/geotools/coverage/GeophysicsCategoryList.java
+ + + + + + + + +
Revision 20599Revision 20970
/*
+ * Geotools 2 - OpenSource mapping toolkit
+ * (C) 2003, Geotools Project Management Committee (PMC)
+ * (C) 2001, Institut de Recherche pour le Développement
+ *
+ *    This library is free software; you can redistribute it and/or
/*
+ *    GeoTools - OpenSource mapping toolkit
+ *    http://geotools.org
+ *    (C) 2003-2006, Geotools Project Management Committee (PMC)
+ * (C) 2001, Institut de Recherche pour le Développement
+ *
+ *    This library is free software; you can redistribute it and/or
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+*    Lesser General Public License for more details.
+*
+*    You should have received a copy of the GNU Lesser General Public
+*    License along with this library; if not, write to the Free Software
+*    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*
+*
+*    This package contains documentation from OpenGIS specifications.
+*    OpenGIS consortium's work is fully acknowledged here.
+*/
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+*    Lesser General Public License for more details.
+*
+*    This package contains documentation from OpenGIS specifications.
+*    OpenGIS consortium's work is fully acknowledged here.
+*/
private static int getFractionDigitCount(final Category[] categories) {
+    int ndigits = 0;
+    final double EPS = 1E-6;
+    for (int i=0; i<categories.length; i++) {
+        final Category geophysics = categories[i].geophysics(true);
+        final Category samples    = categories[i].geophysics(false);
+        final double ln = XMath.log10((geophysics.maximum - geophysics.minimum)/
private static int getFractionDigitCount(final Category[] categories) {
+    int ndigits = 0;
+    final double EPS = 1E-6;
+    final int length=categories.length;
+    for (int i=0; i<length; i++) {
+        final Category geophysics = categories[i].geophysics(true);
+        final Category samples    = categories[i].geophysics(false);
+        final double ln = XMath.log10((geophysics.maximum - geophysics.minimum)/
+
+ +