sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1724476 [2/3] - in /sis/branches/JDK7: ./ core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/sql/ core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ core/sis-referencing/src/main/java/org/apache/sis/inter...
Date Wed, 13 Jan 2016 18:31:16 GMT
Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/AuthorityCodes.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/AuthorityCodes.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/AuthorityCodes.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/AuthorityCodes.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -149,18 +149,19 @@ final class AuthorityCodes extends Abstr
                 final Class<?> candidate = table.subTypes[i];
                 if (candidate.isAssignableFrom(type)) {
                     buffer.append(" WHERE (").append(table.typeColumn)
-                          .append(" LIKE '").append(table.typeNames[i]).append("%'");
+                          .append(" LIKE '").append(table.typeNames[i]).append("%')");
                     hasWhere = true;
                     tableType = candidate;
                     break;
                 }
             }
-            if (hasWhere) {
-                buffer.append(')');
-            }
         }
+        buffer.append(hasWhere ? " AND " : " WHERE ");
         final int conditionStart = buffer.length();
-        buffer.append(" ORDER BY ABS(DEPRECATED), ").append(table.codeColumn);
+        if (table.showColumn != null) {
+            buffer.append(table.showColumn).append("<>0 AND ");
+        }
+        buffer.append("DEPRECATED=0 ORDER BY ").append(table.codeColumn);
         sql[ALL] = factory.translator.apply(buffer.toString());
         /*
          * Build the SQL query for fetching the name of a single object for a given code.
@@ -172,7 +173,7 @@ final class AuthorityCodes extends Abstr
         if (table.nameColumn != null) {
             buffer.replace(columnNameStart, columnNameEnd, table.nameColumn);
         }
-        buffer.append(hasWhere ? " AND " : " WHERE ").append(table.codeColumn).append(" = ?");
+        buffer.append(table.codeColumn).append(" = ?");
         sql[ONE] = factory.translator.apply(buffer.toString());
         /*
          * Other information opportunistically computed from above search.

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGDataAccess.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -158,8 +158,9 @@ public class EPSGDataAccess extends Geod
 {
     /**
      * The namespace of EPSG names and codes. This namespace is needed by all {@code createFoo(String)} methods.
-     * The {@code EPSGDataAccess} constructor relies on the {@link #nameFactory} caching mechanism for giving us
-     * the same {@code NameSpace} instance than the one used by previous {@code EPSGDataAccess} instances, if any.
+     * The {@code EPSGDataAccess} constructor relies on the {@link EPSGFactory#nameFactory} caching mechanism
+     * for giving us the same {@code NameSpace} instance than the one used by previous {@code EPSGDataAccess}
+     * instances, if any.
      */
     private final NameSpace namespace;
 
@@ -261,6 +262,13 @@ public class EPSGDataAccess extends Geod
     private final Map<Integer,Class<?>> safetyGuard = new HashMap<>();
 
     /**
+     * {@code true} for disabling the logging of warnings when this factory creates deprecated objects.
+     * This flag should be always {@code false}, except during {@link Finder#find(IdentifiedObject)}
+     * execution since that method may temporarily creates deprecated objects which are later discarded.
+     */
+    private transient boolean quiet;
+
+    /**
      * The {@code ConcurrentAuthorityFactory} that supply caching for all {@code createFoo(String)} methods.
      */
     protected final EPSGFactory parent;
@@ -297,13 +305,13 @@ public class EPSGDataAccess extends Geod
      * @see EPSGFactory#newDataAccess(Connection, SQLTranslator)
      */
     protected EPSGDataAccess(final EPSGFactory parent, final Connection connection, final SQLTranslator translator) {
-        super(parent);
         ArgumentChecks.ensureNonNull("connection", connection);
         ArgumentChecks.ensureNonNull("translator", translator);
         this.parent     = parent;
         this.connection = connection;
         this.translator = translator;
-        this.namespace  = nameFactory.createNameSpace(nameFactory.createLocalName(null, Constants.IOGP), null);
+        this.namespace  = parent.nameFactory.createNameSpace(
+                          parent.nameFactory.createLocalName(null, Constants.IOGP), null);
     }
 
     /**
@@ -422,6 +430,16 @@ addURIs:    for (int i=0; ; i++) {
      * JDBC resources. If the set of codes is needed for a long time, their values should be copied in another
      * collection object.
      *
+     * <div class="section">Handling of deprecated objects</div>
+     * The collection returned by this method gives an enumeration of EPSG codes for valid objects only.
+     * The EPSG codes of deprecated objects are not included in iterations, computation of {@code Set.size()} value,
+     * {@code Set.toString()} result, <i>etc.</i> with one exception:
+     * a call to {@code Set.contains(…)} will return {@code true} if the given identifier exists
+     * for a deprecated object, even if that identifier does not show up in iterations.
+     *
+     * <p>An other point of view could be to said that the returned collection behaves as if the deprecated codes
+     * were included in the set but invisible.</p>
+     *
      * @param  type The spatial reference objects type (may be {@code Object.class}).
      * @return The set of authority codes for spatial reference objects of the given type (may be an empty set).
      * @throws FactoryException if access to the underlying database failed.
@@ -939,10 +957,12 @@ addURIs:    for (int i=0; ; i++) {
                 break;
             }
         }
-        LogRecord record = Messages.getResources(locale).getLogRecord(Level.WARNING, Messages.Keys.DeprecatedCode_3,
-                Constants.EPSG + DefaultNameSpace.DEFAULT_SEPARATOR + code, replacedBy, reason);
-        record.setLoggerName(Loggers.CRS_FACTORY);
-        Logging.log(EPSGDataAccess.class, method, record);
+        if (!quiet) {
+            LogRecord record = Messages.getResources(locale).getLogRecord(Level.WARNING, Messages.Keys.DeprecatedCode_3,
+                    Constants.EPSG + DefaultNameSpace.DEFAULT_SEPARATOR + code, replacedBy, reason);
+            record.setLoggerName(Loggers.CRS_FACTORY);
+            Logging.log(EPSGDataAccess.class, method, record);
+        }
         return Vocabulary.formatInternational(Vocabulary.Keys.SupersededBy_1, replacedBy);
     }
 
@@ -967,7 +987,7 @@ addURIs:    for (int i=0; ; i++) {
         final InternationalString edition = authority.getEdition();
         final String version = (edition != null) ? edition.toString() : null;
         if (name != null) {
-            gn = nameFactory.createGenericName(namespace, Constants.EPSG, name);
+            gn = parent.nameFactory.createGenericName(namespace, Constants.EPSG, name);
             properties.put("name", gn);
             properties.put(NamedIdentifier.CODE_KEY,      name);
             properties.put(NamedIdentifier.VERSION_KEY,   version);
@@ -1009,11 +1029,12 @@ addURIs:    for (int i=0; ; i++) {
                     if (naming != null) {
                         ns = namingSystems.get(naming);
                         if (ns == null) {
-                            ns = nameFactory.createNameSpace(nameFactory.createLocalName(null, naming), null);
+                            ns = parent.nameFactory.createNameSpace(
+                                 parent.nameFactory.createLocalName(null, naming), null);
                             namingSystems.put(naming, ns);
                         }
                     }
-                    aliases.add(nameFactory.createLocalName(ns, alias));
+                    aliases.add(parent.nameFactory.createLocalName(ns, alias));
                 }
             }
         }
@@ -1517,12 +1538,13 @@ addURIs:    for (int i=0; ; i++) {
                       " COORD_OP_METHOD_CODE," +
                       " TARGET_CRS_CODE" +
                 " FROM [Coordinate_Operation]" +
-               " WHERE TARGET_CRS_CODE = "       + BursaWolfInfo.TARGET_CRS +
+               " WHERE DEPRECATED=0" +
+                 " AND TARGET_CRS_CODE = "       + BursaWolfInfo.TARGET_CRS +
                  " AND COORD_OP_METHOD_CODE >= " + BursaWolfInfo.MIN_METHOD_CODE +
                  " AND COORD_OP_METHOD_CODE <= " + BursaWolfInfo.MAX_METHOD_CODE +
                  " AND SOURCE_CRS_CODE IN " +
                "(SELECT COORD_REF_SYS_CODE FROM [Coordinate Reference System] WHERE DATUM_CODE = ?)" +
-            " ORDER BY TARGET_CRS_CODE, ABS(DEPRECATED), COORD_OP_ACCURACY, COORD_OP_CODE DESC", code))
+            " ORDER BY TARGET_CRS_CODE, COORD_OP_ACCURACY, COORD_OP_CODE DESC", code))
         {
             while (result.next()) {
                 final BursaWolfInfo info = new BursaWolfInfo(
@@ -2766,6 +2788,20 @@ addURIs:    for (int i=0; ; i++) {
         }
 
         /**
+         * Searches for the given object with warnings for deprecations temporarily disabled.
+         */
+        @Override
+        public Set<IdentifiedObject> find(final IdentifiedObject object) throws FactoryException {
+            final boolean old = quiet;
+            quiet = true;
+            try {
+                return super.find(object);
+            } finally {
+                quiet = old;
+            }
+        }
+
+        /**
          * Returns a set of authority codes that <strong>may</strong> identify the same object than the specified one.
          * This implementation tries to get a smaller set than what {@link EPSGDataAccess#getAuthorityCodes()} would produce.
          * Deprecated objects must be last in iteration order.

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/EPSGFactory.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -64,6 +64,11 @@ public class EPSGFactory extends Concurr
     protected final DataSource dataSource;
 
     /**
+     * The factory to use for creating {@link org.opengis.util.GenericName} instances.
+     */
+    protected final NameFactory nameFactory;
+
+    /**
      * The factory to use for creating {@link org.opengis.referencing.datum.Datum} instances
      * from the properties read in the database.
      */
@@ -124,7 +129,7 @@ public class EPSGFactory extends Concurr
      * Those default values are implementation-specific and may change in any future SIS version.
      *
      * @param dataSource    The factory to use for creating {@link Connection}s to the EPSG database.
-     * @param nameFactory   The factory to use for creating authority codes as {@link GenericName} instances.
+     * @param nameFactory   The factory to use for creating {@link org.opengis.util.GenericName} instances.
      * @param datumFactory  The factory to use for creating {@link Datum} instances.
      * @param csFactory     The factory to use for creating {@link CoordinateSystem} instances.
      * @param crsFactory    The factory to use for creating {@link CoordinateReferenceSystem} instances.
@@ -144,7 +149,7 @@ public class EPSGFactory extends Concurr
                        final SQLTranslator              translator)
             throws FactoryException
     {
-        super(EPSGDataAccess.class, factory(NameFactory.class, nameFactory));
+        super(EPSGDataAccess.class);
         if (dataSource != null) {
             this.dataSource = dataSource;
         } else try {
@@ -155,6 +160,7 @@ public class EPSGFactory extends Concurr
         } catch (Exception e) {
             throw new UnavailableFactoryException(e.getLocalizedMessage(), e);
         }
+        this.nameFactory  = factory(NameFactory.class, nameFactory);
         this.datumFactory = factory(DatumFactory.class, datumFactory);
         this.csFactory    = factory(CSFactory.class, csFactory);
         this.crsFactory   = factory(CRSFactory.class, crsFactory);

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/TableInfo.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/TableInfo.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/TableInfo.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/sql/TableInfo.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -56,7 +56,8 @@ final class TableInfo {
                 new Class<?>[] { ProjectedCRS.class, GeographicCRS.class, GeocentricCRS.class,
                                  VerticalCRS.class,  CompoundCRS.class,   EngineeringCRS.class},
                 new String[]   {"projected",        "geographic",        "geocentric",
-                                "vertical",         "compound",          "engineering"}),
+                                "vertical",         "compound",          "engineering"},
+                "SHOW_CRS"),
 
         new TableInfo(CoordinateSystem.class,
                 "[Coordinate System]",
@@ -64,13 +65,15 @@ final class TableInfo {
                 "COORD_SYS_NAME",
                 "COORD_SYS_TYPE",
                 new Class<?>[] { CartesianCS.class, EllipsoidalCS.class, SphericalCS.class, VerticalCS.class},
-                new String[]   {"Cartesian",       "ellipsoidal",       "spherical",       "vertical"}),
-                               //Really upper-case C.
+                new String[]   {"Cartesian",       "ellipsoidal",       "spherical",       "vertical"},    //Really upper-case C.
+                null),
+
         new TableInfo(CoordinateSystemAxis.class,
                 "[Coordinate Axis] AS CA INNER JOIN [Coordinate Axis Name] AS CAN" +
                                  " ON CA.COORD_AXIS_NAME_CODE=CAN.COORD_AXIS_NAME_CODE",
                 "COORD_AXIS_CODE",
-                "COORD_AXIS_NAME"),
+                "COORD_AXIS_NAME",
+                null, null, null, null),
 
         new TableInfo(Datum.class,
                 "[Datum]",
@@ -78,17 +81,20 @@ final class TableInfo {
                 "DATUM_NAME",
                 "DATUM_TYPE",
                 new Class<?>[] { GeodeticDatum.class, VerticalDatum.class, EngineeringDatum.class},
-                new String[]   {"geodetic",          "vertical",          "engineering"}),
+                new String[]   {"geodetic",          "vertical",          "engineering"},
+                null),
 
         new TableInfo(Ellipsoid.class,
                 "[Ellipsoid]",
                 "ELLIPSOID_CODE",
-                "ELLIPSOID_NAME"),
+                "ELLIPSOID_NAME",
+                null, null, null, null),
 
         new TableInfo(PrimeMeridian.class,
                 "[Prime Meridian]",
                 "PRIME_MERIDIAN_CODE",
-                "PRIME_MERIDIAN_NAME"),
+                "PRIME_MERIDIAN_NAME",
+                null, null, null, null),
 
         new TableInfo(CoordinateOperation.class,
                 "[Coordinate_Operation]",
@@ -96,23 +102,27 @@ final class TableInfo {
                 "COORD_OP_NAME",
                 "COORD_OP_TYPE",
                 new Class<?>[] { Projection.class, Conversion.class, Transformation.class},
-                new String[]   {"conversion",     "conversion",     "transformation"}),
+                new String[]   {"conversion",     "conversion",     "transformation"},
+                "SHOW_OPERATION"),
                 // Note: Projection is handled in a special way.
 
         new TableInfo(OperationMethod.class,
                 "[Coordinate_Operation Method]",
                 "COORD_OP_METHOD_CODE",
-                "COORD_OP_METHOD_NAME"),
+                "COORD_OP_METHOD_NAME",
+                null, null, null, null),
 
         new TableInfo(ParameterDescriptor.class,
                 "[Coordinate_Operation Parameter]",
                 "PARAMETER_CODE",
-                "PARAMETER_NAME"),
+                "PARAMETER_NAME",
+                null, null, null, null),
 
         new TableInfo(Unit.class,
                 "[Unit of Measure]",
                 "UOM_CODE",
-                "UNIT_OF_MEAS_NAME")
+                "UNIT_OF_MEAS_NAME",
+                null, null, null, null),
     };
 
     /**
@@ -151,20 +161,17 @@ final class TableInfo {
     final String[] typeNames;
 
     /**
-     * Stores information about a specific table.
+     * The column that specify if the object should be shown, or {@code null} if none.
      */
-    private TableInfo(final Class<?> type, final String table,
-                      final String codeColumn, final String nameColumn)
-    {
-        this(type, table, codeColumn, nameColumn, null, null, null);
-    }
+    final String showColumn;
 
     /**
      * Stores information about a specific table.
      */
     private TableInfo(final Class<?> type,
                       final String table, final String codeColumn, final String nameColumn,
-                      final String typeColumn, final Class<?>[] subTypes, final String[] typeNames)
+                      final String typeColumn, final Class<?>[] subTypes, final String[] typeNames,
+                      final String showColumn)
     {
         this.type       = type;
         this.table      = table;
@@ -173,5 +180,6 @@ final class TableInfo {
         this.typeColumn = typeColumn;
         this.subTypes   = subTypes;
         this.typeNames  = typeNames;
+        this.showColumn = showColumn;
     }
 }

Propchange: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/InterpolatedTransform2D.java
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Wed Jan 13 18:31:16 2016
@@ -1 +1 @@
-text/plain
+text/plain;charset=UTF-8

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/FormulasTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/FormulasTest.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/FormulasTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/FormulasTest.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -17,6 +17,7 @@
 package org.apache.sis.internal.referencing;
 
 import org.apache.sis.internal.metadata.ReferencingServices;
+import org.apache.sis.measure.Longitude;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
@@ -28,15 +29,24 @@ import static org.junit.Assert.*;
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.4
- * @version 0.5
+ * @version 0.7
  * @module
  */
 public final strictfp class FormulasTest extends TestCase {
     /**
+     * Verifies the {@link Formulas#LONGITUDE_MAX} constant.
+     */
+    @Test
+    public void verifyLongitudeMax() {
+        assertTrue(Formulas.LONGITUDE_MAX > Longitude.MAX_VALUE);
+        assertTrue(StrictMath.ulp(Formulas.LONGITUDE_MAX) <= Formulas.ANGULAR_TOLERANCE);
+    }
+
+    /**
      * Verifies the {@link Formulas#JULIAN_YEAR_LENGTH} constant.
      */
     @Test
-    public void testConstants() {
+    public void verifyJulianYearLength() {
         assertEquals(StrictMath.round(365.25 * 24 * 60 * 60 * 1000), Formulas.JULIAN_YEAR_LENGTH);
     }
 

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/MapProjectionTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/MapProjectionTest.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/MapProjectionTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/MapProjectionTest.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -64,12 +64,12 @@ public final strictfp class MapProjectio
         assertParamEquals(null,                                   SEMI_MAJOR,          true,  it.next());
         assertParamEquals(null,                                   SEMI_MINOR,          true,  it.next());
         assertParamEquals("Latitude of 1st standard parallel",    STANDARD_PARALLEL_1, true,  it.next());
-        assertParamEquals("Latitude of natural origin",          "latitude_of_origin", false, it.next());
+        assertParamEquals("Latitude of natural origin",           LATITUDE_OF_ORIGIN,  false, it.next());
         assertParamEquals("Longitude of natural origin",          CENTRAL_MERIDIAN,    true,  it.next());
         assertParamEquals("False easting",                        FALSE_EASTING,       true,  it.next());
         assertParamEquals("False northing",                       FALSE_NORTHING,      true,  it.next());
         assertFalse(it.hasNext());
-        assertIsForcedToZero((ParameterDescriptor<?>) Equirectangular.PARAMETERS.descriptor("latitude_of_origin"));
+        assertIsForcedToZero((ParameterDescriptor<?>) Equirectangular.PARAMETERS.descriptor(LATITUDE_OF_ORIGIN));
     }
 
     /**
@@ -82,13 +82,13 @@ public final strictfp class MapProjectio
         assertParamEquals("Mercator (variant A)",          "Mercator_1SP",       true, Mercator1SP.PARAMETERS);
         assertParamEquals(null,                             SEMI_MAJOR,          true, it.next());
         assertParamEquals(null,                             SEMI_MINOR,          true, it.next());
-        assertParamEquals("Latitude of natural origin",    "latitude_of_origin", true, it.next());
+        assertParamEquals("Latitude of natural origin",     LATITUDE_OF_ORIGIN,  true, it.next());
         assertParamEquals("Longitude of natural origin",    CENTRAL_MERIDIAN,    true, it.next());
         assertParamEquals("Scale factor at natural origin", SCALE_FACTOR,        true, it.next());
         assertParamEquals("False easting",                  FALSE_EASTING,       true, it.next());
         assertParamEquals("False northing",                 FALSE_NORTHING,      true, it.next());
         assertFalse(it.hasNext());
-        assertIsForcedToZero((ParameterDescriptor<?>) Mercator1SP.PARAMETERS.descriptor("latitude_of_origin"));
+        assertIsForcedToZero((ParameterDescriptor<?>) Mercator1SP.PARAMETERS.descriptor(LATITUDE_OF_ORIGIN));
     }
 
     /**
@@ -102,13 +102,13 @@ public final strictfp class MapProjectio
         assertParamEquals(null,                                SEMI_MAJOR,           true,  it.next());
         assertParamEquals(null,                                SEMI_MINOR,           true,  it.next());
         assertParamEquals("Latitude of 1st standard parallel", STANDARD_PARALLEL_1,  true,  it.next());
-        assertParamEquals("Latitude of natural origin",        "latitude_of_origin",  false, it.next());
+        assertParamEquals("Latitude of natural origin",        LATITUDE_OF_ORIGIN,   false, it.next());
         assertParamEquals("Longitude of natural origin",       CENTRAL_MERIDIAN,     true,  it.next());
         assertParamEquals(null,                                SCALE_FACTOR,         false, it.next());
         assertParamEquals("False easting",                     FALSE_EASTING,        true,  it.next());
         assertParamEquals("False northing",                    FALSE_NORTHING,       true,  it.next());
         assertFalse(it.hasNext());
-        assertIsForcedToZero((ParameterDescriptor<?>) Mercator1SP.PARAMETERS.descriptor("latitude_of_origin"));
+        assertIsForcedToZero((ParameterDescriptor<?>) Mercator1SP.PARAMETERS.descriptor(LATITUDE_OF_ORIGIN));
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/CommonCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/CommonCRSTest.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/CommonCRSTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/CommonCRSTest.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -17,13 +17,14 @@
 package org.apache.sis.referencing;
 
 import java.util.Date;
-import org.opengis.test.Validators;
+import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.util.FactoryException;
 import org.opengis.referencing.crs.SingleCRS;
 import org.opengis.referencing.crs.TemporalCRS;
 import org.opengis.referencing.crs.VerticalCRS;
 import org.opengis.referencing.crs.GeographicCRS;
 import org.opengis.referencing.crs.GeocentricCRS;
+import org.opengis.referencing.crs.ProjectedCRS;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.CoordinateSystem;
 import org.opengis.referencing.cs.EllipsoidalCS;
@@ -33,6 +34,9 @@ import org.opengis.referencing.datum.Ver
 import org.apache.sis.internal.metadata.AxisNames;
 import org.apache.sis.internal.metadata.VerticalDatumTypes;
 import org.apache.sis.internal.util.Constants;
+
+// Test dependencies
+import org.opengis.test.Validators;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
@@ -47,7 +51,7 @@ import static org.apache.sis.test.TestUt
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @since   0.4
- * @version 0.5
+ * @version 0.7
  * @module
  */
 @DependsOn({
@@ -203,6 +207,23 @@ public final strictfp class CommonCRSTes
     }
 
     /**
+     * Tests {@link CommonCRS#UTM(double, double)}.
+     *
+     * @since 0.7
+     */
+    @Test
+    @DependsOnMethod("testGeographic")
+    public void testUTM() {
+        final ProjectedCRS crs = CommonCRS.WGS72.UTM(-45, -122);
+        assertEquals("name", "WGS 72 / UTM zone 10S", crs.getName().getCode());
+        final ParameterValueGroup pg = crs.getConversionFromBase().getParameterValues();
+        assertEquals(Constants.LATITUDE_OF_ORIGIN, -123, pg.parameter(Constants.CENTRAL_MERIDIAN).doubleValue(), STRICT);
+        assertEquals(Constants.FALSE_NORTHING, 10000000, pg.parameter(Constants.FALSE_NORTHING).doubleValue(),   STRICT);
+        assertSame("Expected a cached instance.", crs, CommonCRS.WGS72.UTM(-45, -122));
+        assertNotSame("Expected a new instance.", crs, CommonCRS.WGS72.UTM(+45, -122));
+    }
+
+    /**
      * Tests {@link CommonCRS#forCode(String, String, FactoryException)}.
      *
      * @throws FactoryException If a CRS can not be constructed.

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/StandardDefinitionsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/StandardDefinitionsTest.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/StandardDefinitionsTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/StandardDefinitionsTest.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -16,15 +16,22 @@
  */
 package org.apache.sis.referencing;
 
+import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.referencing.crs.GeographicCRS;
+import org.opengis.referencing.crs.ProjectedCRS;
 import org.opengis.referencing.crs.VerticalCRS;
 import org.opengis.referencing.cs.AxisDirection;
+import org.opengis.referencing.cs.CartesianCS;
 import org.opengis.referencing.cs.CoordinateSystemAxis;
 import org.opengis.referencing.cs.EllipsoidalCS;
 import org.opengis.referencing.datum.Ellipsoid;
 import org.opengis.referencing.datum.PrimeMeridian;
 import org.opengis.referencing.datum.GeodeticDatum;
 import org.opengis.referencing.datum.VerticalDatum;
+import org.apache.sis.metadata.iso.citation.Citations;
+import org.apache.sis.internal.util.Constants;
+
+// Test dependencies
 import org.apache.sis.test.mock.GeodeticDatumMock;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
@@ -32,8 +39,8 @@ import org.apache.sis.test.TestCase;
 import org.opengis.test.Validators;
 import org.apache.sis.referencing.crs.HardCodedCRS;
 import org.apache.sis.referencing.cs.HardCodedAxes;
+import org.apache.sis.referencing.cs.HardCodedCS;
 import org.apache.sis.referencing.datum.HardCodedDatum;
-import org.apache.sis.metadata.iso.citation.Citations;
 import org.junit.Test;
 
 import static org.junit.Assert.*;
@@ -48,10 +55,26 @@ import static org.junit.Assert.*;
  * @module
  */
 @DependsOn({
-    org.apache.sis.referencing.crs.DefaultGeographicCRSTest.class
+    org.apache.sis.referencing.crs.DefaultGeographicCRSTest.class,
+    org.apache.sis.internal.referencing.provider.TransverseMercatorTest.class
 })
 public final strictfp class StandardDefinitionsTest extends TestCase {
     /**
+     * Tests {@link StandardDefinitions#createUTM(int, GeographicCRS, double, boolean, CartesianCS)}.
+     *
+     * @since 0.7
+     */
+    @Test
+    @DependsOnMethod("testCreateGeographicCRS")
+    public void testCreateUTM() {
+        final ProjectedCRS crs = StandardDefinitions.createUTM(32610, HardCodedCRS.WGS84, 15, -122, HardCodedCS.PROJECTED);
+        assertEquals("name", "WGS 84 / UTM zone 10N", crs.getName().getCode());
+        final ParameterValueGroup pg = crs.getConversionFromBase().getParameterValues();
+        assertEquals(Constants.LATITUDE_OF_ORIGIN, -123, pg.parameter(Constants.CENTRAL_MERIDIAN).doubleValue(), STRICT);
+        assertEquals(Constants.FALSE_NORTHING,        0, pg.parameter(Constants.FALSE_NORTHING).doubleValue(),   STRICT);
+    }
+
+    /**
      * Compares the values created by {@code StandardDefinitions} against hard-coded constants.
      * This method tests the following methods:
      *
@@ -127,10 +150,12 @@ public final strictfp class StandardDefi
      */
     @Test
     public void testCreateAxis() {
-        for (final short code : new short[] {106, 107, 110, 114, 113}) {
+        for (final short code : new short[] {1, 2, 106, 107, 110, 114, 113}) {
             final CoordinateSystemAxis actual = StandardDefinitions.createAxis(code);
             Validators.validate(actual);
             switch (code) {
+                case   1: compare(HardCodedAxes.EASTING,                actual); break;
+                case   2: compare(HardCodedAxes.NORTHING,               actual); break;
                 case 106: compare(HardCodedAxes.GEODETIC_LATITUDE,      actual); break;
                 case 107: compare(HardCodedAxes.GEODETIC_LONGITUDE,     actual); break;
                 case 110: compare(HardCodedAxes.ELLIPSOIDAL_HEIGHT,     actual); break;

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/crs/DefaultProjectedCRSTest.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -29,7 +29,7 @@ import org.opengis.parameter.ParameterVa
 import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.referencing.CommonCRS;
 import org.apache.sis.referencing.cs.HardCodedCS;
-import org.apache.sis.referencing.GeodeticObjectBuilder;
+import org.apache.sis.internal.referencing.GeodeticObjectBuilder;
 import org.apache.sis.internal.util.Constants;
 import org.apache.sis.internal.system.Loggers;
 import org.apache.sis.io.wkt.Convention;

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/AuthorityFactoryProxyTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/AuthorityFactoryProxyTest.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/AuthorityFactoryProxyTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/AuthorityFactoryProxyTest.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -16,13 +16,11 @@
  */
 package org.apache.sis.referencing.factory;
 
-import org.opengis.util.NameFactory;
 import org.opengis.util.FactoryException;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.AuthorityFactory;
 import org.opengis.referencing.datum.GeodeticDatum;
 import org.opengis.referencing.crs.*;
-import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.referencing.datum.DefaultGeodeticDatum;
 import org.apache.sis.referencing.crs.DefaultGeographicCRS;
 import org.apache.sis.referencing.crs.DefaultProjectedCRS;
@@ -80,7 +78,7 @@ public final strictfp class AuthorityFac
      */
     @Test
     public void testCreateFromAPI() throws FactoryException {
-        final CRSAuthorityFactory factory = new CommonAuthorityFactory(DefaultFactories.forBuildin(NameFactory.class));
+        final CRSAuthorityFactory factory = new CommonAuthorityFactory();
         final CoordinateReferenceSystem expected = factory.createCoordinateReferenceSystem("83");
         AuthorityFactoryProxy<?> proxy;
         /*

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/CommonAuthorityFactoryTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/CommonAuthorityFactoryTest.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/CommonAuthorityFactoryTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/CommonAuthorityFactoryTest.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -17,16 +17,24 @@
 package org.apache.sis.referencing.factory;
 
 import java.util.Arrays;
-import org.opengis.util.NameFactory;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import javax.measure.unit.SI;
+import javax.measure.unit.NonSI;
 import org.opengis.util.FactoryException;
 import org.opengis.metadata.citation.Citation;
+import org.opengis.parameter.ParameterValueGroup;
+import org.opengis.referencing.NoSuchAuthorityCodeException;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
 import org.opengis.referencing.crs.EngineeringCRS;
 import org.opengis.referencing.crs.GeographicCRS;
+import org.opengis.referencing.crs.ProjectedCRS;
 import org.opengis.referencing.crs.VerticalCRS;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.datum.Datum;
-import org.apache.sis.internal.system.DefaultFactories;
+import org.apache.sis.internal.util.Constants;
+import org.apache.sis.internal.referencing.provider.TransverseMercator;
+import org.apache.sis.referencing.operation.transform.LinearTransform;
 import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.referencing.CommonCRS;
 import org.apache.sis.io.wkt.Convention;
@@ -35,9 +43,10 @@ import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.test.DependsOnMethod;
 import org.apache.sis.test.DependsOn;
 import org.apache.sis.test.TestCase;
+import org.junit.Ignore;
 import org.junit.Test;
 
-import static org.apache.sis.test.MetadataAssert.*;
+import static org.apache.sis.test.ReferencingAssert.*;
 
 
 /**
@@ -59,7 +68,7 @@ public final strictfp class CommonAuthor
      * Initializes the factory to test.
      */
     public CommonAuthorityFactoryTest() {
-        factory = new CommonAuthorityFactory(DefaultFactories.forBuildin(NameFactory.class));
+        factory = new CommonAuthorityFactory();
     }
 
     /**
@@ -71,23 +80,39 @@ public final strictfp class CommonAuthor
     public void testGetAuthorityCodes() throws FactoryException {
         assertTrue("getAuthorityCodes(Datum.class)",
                 factory.getAuthorityCodes(Datum.class).isEmpty());
-        assertSetEquals(Arrays.asList("1", "27", "83", "84", "88"),
+        assertSetEquals(Arrays.asList("CRS:1", "CRS:27", "CRS:83", "CRS:84", "CRS:88",
+                                      "AUTO2:42001", "AUTO2:42002", "AUTO2:42003", "AUTO2:42004", "AUTO2:42005"),
                 factory.getAuthorityCodes(CoordinateReferenceSystem.class));
-        assertSetEquals(Arrays.asList("27", "83", "84"),
+        assertSetEquals(Arrays.asList("AUTO2:42001", "AUTO2:42002", "AUTO2:42003", "AUTO2:42004", "AUTO2:42005"),
+                factory.getAuthorityCodes(ProjectedCRS.class));
+        assertSetEquals(Arrays.asList("CRS:27", "CRS:83", "CRS:84"),
                 factory.getAuthorityCodes(GeographicCRS.class));
-        assertSetEquals(Arrays.asList("88"),
+        assertSetEquals(Arrays.asList("CRS:88"),
                 factory.getAuthorityCodes(VerticalCRS.class));
-        assertSetEquals(Arrays.asList("1"),
+        assertSetEquals(Arrays.asList("CRS:1"),
                 factory.getAuthorityCodes(EngineeringCRS.class));
     }
 
     /**
+     * Tests {@link CommonAuthorityFactory#getDescriptionText(String)}.
+     *
+     * @throws FactoryException if an error occurred while creating a CRS.
+     */
+    @Test
+    @DependsOnMethod({"testCRS84", "testAuto42001"})
+    public void testDescription() throws FactoryException {
+        assertEquals("WGS 84",                factory.getDescriptionText("CRS:84").toString());
+        assertEquals("WGS 84 / Auto UTM",     factory.getDescriptionText("AUTO:42001").toString());
+        assertEquals("WGS 84 / UTM zone 10S", factory.getDescriptionText("AUTO:42001,-124,-10").toString());
+    }
+
+    /**
      * Checks the value returned by {@link CommonAuthorityFactory#getAuthority()}.
      */
     @Test
     public void testAuthority() {
         final Citation authority = factory.getAuthority();
-        assertTrue (Citations.identifierMatches(authority, "CRS"));
+        assertFalse(Citations.identifierMatches(authority, "CRS"));
         assertTrue (Citations.identifierMatches(authority, "OGC"));
         assertFalse(Citations.identifierMatches(authority, "OGP"));
         assertFalse(Citations.identifierMatches(authority, "EPSG"));
@@ -101,7 +126,6 @@ public final strictfp class CommonAuthor
      * @throws FactoryException if an error occurred while creating a CRS.
      */
     @Test
-    @DependsOnMethod("testAuthority")
     public void testCRS84() throws FactoryException {
         GeographicCRS crs = factory.createGeographicCRS("CRS:84");
         assertSame   (crs,  factory.createGeographicCRS("84"));
@@ -120,7 +144,6 @@ public final strictfp class CommonAuthor
      * @throws FactoryException if an error occurred while creating a CRS.
      */
     @Test
-    @DependsOnMethod("testAuthority")
     public void testCRS83() throws FactoryException {
         GeographicCRS crs = factory.createGeographicCRS("CRS:83");
         assertSame   (crs,  factory.createGeographicCRS("83"));
@@ -137,7 +160,6 @@ public final strictfp class CommonAuthor
      * @throws FactoryException if an error occurred while creating a CRS.
      */
     @Test
-    @DependsOnMethod("testAuthority")
     public void testCRS88() throws FactoryException {
         VerticalCRS crs = factory.createVerticalCRS("CRS:88");
         assertSame (crs,  factory.createVerticalCRS("88"));
@@ -152,16 +174,157 @@ public final strictfp class CommonAuthor
      * @throws FactoryException if an error occurred while creating a CRS.
      */
     @Test
-    @DependsOnMethod("testAuthority")
     public void testCRS1() throws FactoryException {
         EngineeringCRS crs = factory.createEngineeringCRS("CRS:1");
-        assertSame (crs,  factory.createEngineeringCRS("1"));
-        assertSame (crs,  factory.createEngineeringCRS("CRS1"));
-        assertSame (crs,  factory.createEngineeringCRS("CRS:CRS 1"));
+        assertSame    (crs,  factory.createEngineeringCRS("1"));
+        assertSame    (crs,  factory.createEngineeringCRS("CRS1"));
+        assertSame    (crs,  factory.createEngineeringCRS("CRS:CRS 1"));
         assertAxisDirectionsEqual("CS", crs.getCoordinateSystem(), AxisDirection.EAST, AxisDirection.SOUTH);
     }
 
     /**
+     * Tests {@link CommonAuthorityFactory#createProjectedCRS(String)} with the {@code "AUTO:42001"} code.
+     *
+     * @throws FactoryException if an error occurred while creating a CRS.
+     */
+    @Test
+    public void testAuto42001() throws FactoryException {
+        final ProjectedCRS crs = factory.createProjectedCRS("AUTO:42001,-123,0");
+        assertSame("With other coord.",   crs, factory.createProjectedCRS("AUTO : 42001, -122, 10 "));
+        assertSame("Omitting namespace.", crs, factory.createProjectedCRS(" 42001, -122 , 10 "));
+        assertSame("With explicit unit.", crs, factory.createProjectedCRS("AUTO2 :  42001, 1, -122 , 10 "));
+        assertSame("With explicit unit.", crs, factory.createProjectedCRS("AUTO1 :  42001, 9001, -122 , 10 "));
+        assertSame("Legacy namespace.",   crs, factory.createProjectedCRS("AUTO:42001,9001,-122,10"));
+        assertSame("When the given parameters match exactly the UTM central meridian and latitude of origin,"
+                + " the CRS created by AUTO:42002 should be the same than the CRS created by AUTO:42001.",
+                crs, factory.createProjectedCRS("AUTO2:42002,1,-123,0"));
+
+        assertEpsgNameAndIdentifierEqual("WGS 84 / UTM zone 10N", 32610, crs);
+        final ParameterValueGroup p = crs.getConversionFromBase().getParameterValues();
+        assertEquals(TransverseMercator.NAME, crs.getConversionFromBase().getMethod().getName().getCode());
+        assertAxisDirectionsEqual("CS", crs.getCoordinateSystem(), AxisDirection.EAST, AxisDirection.NORTH);
+        assertEquals(Constants.CENTRAL_MERIDIAN, -123, p.parameter(Constants.CENTRAL_MERIDIAN)  .doubleValue(), STRICT);
+        assertEquals(Constants.LATITUDE_OF_ORIGIN,  0, p.parameter(Constants.LATITUDE_OF_ORIGIN).doubleValue(), STRICT);
+        assertEquals(Constants.FALSE_NORTHING,      0, p.parameter(Constants.FALSE_NORTHING)    .doubleValue(), STRICT);
+        assertEquals("axis[0].unit", SI.METRE, crs.getCoordinateSystem().getAxis(0).getUnit());
+        try {
+            factory.createObject("AUTO:42001");
+            fail("Should not have accepted incomplete code.");
+        } catch (NoSuchAuthorityCodeException e) {
+            assertEquals("42001", e.getAuthorityCode());
+        }
+    }
+
+    /**
+     * Tests {@link CommonAuthorityFactory#createProjectedCRS(String)} with the same {@code "AUTO:42001"} code
+     * than {@link #testAuto42001()} except that axes are feet.
+     *
+     * @throws FactoryException if an error occurred while creating a CRS.
+     */
+    @Test
+    @DependsOnMethod("testAuto42001")
+    public void testAuto42001_foot() throws FactoryException {
+        final ProjectedCRS crs = factory.createProjectedCRS("AUTO2:42001, 0.3048, -123, 0");
+        assertSame("Legacy namespace.", crs, factory.createProjectedCRS("AUTO:42001,9002,-123,0"));
+        assertEquals("name", "WGS 84 / UTM zone 10N", crs.getName().getCode());
+        assertTrue("Expected no EPSG identifier because the axes are not in metres.", crs.getIdentifiers().isEmpty());
+        assertEquals("axis[0].unit", NonSI.FOOT, crs.getCoordinateSystem().getAxis(0).getUnit());
+    }
+
+    /**
+     * Tests {@link CommonAuthorityFactory#createProjectedCRS(String)} with the {@code "AUTO:42002"} code.
+     *
+     * @throws FactoryException if an error occurred while creating a CRS.
+     */
+    @Test
+    @DependsOnMethod("testAuto42001")
+    public void testAuto42002() throws FactoryException {
+        final ProjectedCRS crs = factory.createProjectedCRS("AUTO:42002,-122,10");
+        assertSame("Omitting namespace.", crs, factory.createProjectedCRS(" 42002, -122 , 10 "));
+        assertSame("With explicit unit.", crs, factory.createProjectedCRS("AUTO2 :  42002, 1, -122 , 10 "));
+        assertEquals("name", "Transverse Mercator", crs.getName().getCode());
+        assertTrue("Expected no EPSG identifier.", crs.getIdentifiers().isEmpty());
+
+        final ParameterValueGroup p = crs.getConversionFromBase().getParameterValues();
+        assertEquals(TransverseMercator.NAME, crs.getConversionFromBase().getMethod().getName().getCode());
+        assertAxisDirectionsEqual("CS", crs.getCoordinateSystem(), AxisDirection.EAST, AxisDirection.NORTH);
+        assertEquals(Constants.CENTRAL_MERIDIAN, -122, p.parameter(Constants.CENTRAL_MERIDIAN)  .doubleValue(), STRICT);
+        assertEquals(Constants.LATITUDE_OF_ORIGIN, 10, p.parameter(Constants.LATITUDE_OF_ORIGIN).doubleValue(), STRICT);
+        assertEquals(Constants.FALSE_NORTHING,      0, p.parameter(Constants.FALSE_NORTHING)    .doubleValue(), STRICT);
+    }
+
+    /**
+     * Tests {@link CommonAuthorityFactory#createProjectedCRS(String)} with the {@code "AUTO:42003"} code.
+     *
+     * @throws FactoryException if an error occurred while creating a CRS.
+     */
+    @Test
+    @DependsOnMethod("testAuto42001")
+    @Ignore("Pending the port of Orthographic projection.")
+    public void testAuto42003() throws FactoryException {
+        final ProjectedCRS crs = factory.createProjectedCRS("AUTO:42003,9001,10,45");
+        final ParameterValueGroup p = crs.getConversionFromBase().getParameterValues();
+        assertAxisDirectionsEqual("CS", crs.getCoordinateSystem(), AxisDirection.EAST, AxisDirection.NORTH);
+        assertEquals(Constants.CENTRAL_MERIDIAN,   10, p.parameter(Constants.CENTRAL_MERIDIAN)  .doubleValue(), STRICT);
+        assertEquals(Constants.LATITUDE_OF_ORIGIN, 45, p.parameter(Constants.LATITUDE_OF_ORIGIN).doubleValue(), STRICT);
+    }
+
+    /**
+     * Tests {@link CommonAuthorityFactory#createProjectedCRS(String)} with the {@code "AUTO:42004"} code.
+     *
+     * @throws FactoryException if an error occurred while creating a CRS.
+     */
+    @Test
+    @DependsOnMethod("testAuto42001")
+    public void testAuto42004() throws FactoryException {
+        final ProjectedCRS crs = factory.createProjectedCRS("AUTO2:42004,1,10,45");
+        final ParameterValueGroup p = crs.getConversionFromBase().getParameterValues();
+        assertAxisDirectionsEqual("CS", crs.getCoordinateSystem(), AxisDirection.EAST, AxisDirection.NORTH);
+        assertEquals(Constants.CENTRAL_MERIDIAN,   10, p.parameter(Constants.CENTRAL_MERIDIAN)   .doubleValue(), STRICT);
+        assertEquals(Constants.LATITUDE_OF_ORIGIN, 45, p.parameter(Constants.STANDARD_PARALLEL_1).doubleValue(), STRICT);
+        assertInstanceOf("Opportunistic check: in the special case of Equirectangular projection, "
+                + "SIS should have optimized the MathTransform as an affine transform.",
+                LinearTransform.class, crs.getConversionFromBase().getMathTransform());
+    }
+
+    /**
+     * Tests {@link CommonAuthorityFactory#createProjectedCRS(String)} with the {@code "AUTO:42005"} code.
+     *
+     * @throws FactoryException if an error occurred while creating a CRS.
+     */
+    @Test
+    @DependsOnMethod("testAuto42001")
+    @Ignore("Pending implementation of Mollweide projection.")
+    public void testAuto42005() throws FactoryException {
+        final ProjectedCRS crs = factory.createProjectedCRS("AUTO:42005,9001,10,45");
+        final ParameterValueGroup p = crs.getConversionFromBase().getParameterValues();
+        assertAxisDirectionsEqual("CS", crs.getCoordinateSystem(), AxisDirection.EAST, AxisDirection.NORTH);
+        assertEquals(Constants.CENTRAL_MERIDIAN,   10, p.parameter(Constants.CENTRAL_MERIDIAN)  .doubleValue(), STRICT);
+    }
+
+    /**
+     * Tests two {@code "AUTO:42004"} (Equirectangular projection) case built in such a way that the conversion
+     * from one to the other should be the conversion factor from metres to feet.
+     *
+     * This is an integration test.
+     *
+     * @throws FactoryException if an error occurred while creating a CRS.
+     * @throws NoninvertibleTransformException Should never happen.
+     */
+    @Test
+    @DependsOnMethod("testAuto42004")
+    public void testUnits() throws FactoryException, NoninvertibleTransformException {
+        AffineTransform tr1, tr2;
+        tr1 = (AffineTransform) factory.createProjectedCRS("AUTO:42004,9001,0,35").getConversionFromBase().getMathTransform();
+        tr2 = (AffineTransform) factory.createProjectedCRS("AUTO:42004,9002,0,35").getConversionFromBase().getMathTransform();
+        tr2 = tr2.createInverse();
+        tr2.concatenate(tr1);
+        assertEquals("Expected any kind of scale.", 0, tr2.getType() & ~AffineTransform.TYPE_MASK_SCALE);
+        assertEquals("Expected the conversion factor from foot to metre.", 0.3048, tr2.getScaleX(), 1E-9);
+        assertEquals("Expected the conversion factor from foot to metre.", 0.3048, tr2.getScaleY(), 1E-9);
+    }
+
+    /**
      * Tests the WKT formatting. The main purpose of this test is to ensure that
      * the authority name is "CRS" and not "Web Map Service CRS".
      *

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/IdentifiedObjectFinderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/IdentifiedObjectFinderTest.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/IdentifiedObjectFinderTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/IdentifiedObjectFinderTest.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -17,13 +17,11 @@
 package org.apache.sis.referencing.factory;
 
 import java.util.Collections;
-import org.opengis.util.NameFactory;
 import org.opengis.util.FactoryException;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.crs.CRSAuthorityFactory;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
 import org.opengis.referencing.crs.GeographicCRS;
-import org.apache.sis.internal.system.DefaultFactories;
 import org.apache.sis.referencing.crs.DefaultGeographicCRS;
 
 // Test imports
@@ -55,7 +53,7 @@ public final strictfp class IdentifiedOb
      * Initializes the factory to test.
      */
     public IdentifiedObjectFinderTest() {
-        factory = new CommonAuthorityFactory(DefaultFactories.forBuildin(NameFactory.class));
+        factory = new CommonAuthorityFactory();
     }
 
     /**
@@ -117,7 +115,7 @@ public final strictfp class IdentifiedOb
         private final GeodeticAuthorityFactory factory;
 
         public Cached(final GeodeticAuthorityFactory factory) {
-            super(GeodeticAuthorityFactory.class, factory.nameFactory);
+            super(GeodeticAuthorityFactory.class);
             this.factory = factory;
         }
 

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGFactoryTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGFactoryTest.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGFactoryTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/factory/sql/EPSGFactoryTest.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -23,14 +23,18 @@ import java.util.Iterator;
 import java.util.Collections;
 import javax.measure.unit.Unit;
 import org.opengis.metadata.extent.GeographicBoundingBox;
+import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.referencing.IdentifiedObject;
 import org.opengis.referencing.NoSuchAuthorityCodeException;
 import org.opengis.referencing.crs.*;
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.CoordinateSystem;
+import org.opengis.referencing.cs.CoordinateSystemAxis;
 import org.opengis.referencing.datum.Datum;
+import org.opengis.referencing.datum.Ellipsoid;
 import org.opengis.referencing.datum.GeodeticDatum;
+import org.opengis.referencing.datum.PrimeMeridian;
 import org.opengis.referencing.datum.VerticalDatum;
 import org.opengis.referencing.operation.Conversion;
 import org.opengis.referencing.operation.Transformation;
@@ -558,6 +562,30 @@ public final strictfp class EPSGFactoryT
     public void testAuthorityCodes() throws FactoryException {
         assumeNotNull(factory);
         /*
+         * Most basic objects.
+         * Note: the numbers in 'size() >= x' checks were determined from the content of EPSG dataset version 7.9.
+         */
+        final Set<String> axes = factory.getAuthorityCodes(CoordinateSystemAxis.class);
+        assertFalse("Axes not found.",              axes.isEmpty());
+        assertTrue ("Shall contain Geocentric X.",  axes.contains("115"));
+
+        final Set<String> coordinateSystems = factory.getAuthorityCodes(CoordinateSystem.class);
+        assertFalse("Coordinate systems not found.",  coordinateSystems.isEmpty());
+        assertTrue ("Shall contain ellipsoidal CS.",  coordinateSystems.contains("6422"));
+
+        final Set<String> primeMeridians = factory.getAuthorityCodes(PrimeMeridian.class);
+        assertFalse("Prime meridian not found.",  primeMeridians.isEmpty());
+        assertTrue ("Check size() consistency.",  primeMeridians.size() >= 14);
+        assertTrue ("Shall contain Greenwich.",   primeMeridians.contains("8901"));
+        assertTrue ("Shall contain Paris.",       primeMeridians.contains("8903"));
+
+        final Set<String> ellipsoids = factory.getAuthorityCodes(Ellipsoid.class);
+        assertFalse("Ellipsoid not found.",       ellipsoids.isEmpty());
+        assertTrue ("Check size() consistency.",  ellipsoids.size() >= 49);
+        assertTrue ("Shall contain WGS84.",       ellipsoids.contains("7030"));
+        assertTrue ("Shall contain GRS 1980.",    ellipsoids.contains("7019"));
+
+        /*
          * DATUM - The amount of datum is not too large (612 in EPSG 7.9), so execution time should be reasonable
          *         for most tests even if a method call causes scanning of the whole Datum table. We nevertheless
          *         limit such tests to the VerticalDatum (unless EXTENSIVE is true), which is a smaller set.
@@ -575,14 +603,14 @@ public final strictfp class EPSGFactoryT
 
         final Set<String> verticalDatum = factory.getAuthorityCodes(VerticalDatum.class);
         assertFalse("Vertical datum not found.",                    verticalDatum.isEmpty());
-        assertTrue ("Check size() consistency.",                    verticalDatum.size() > 0);          // Cause a scanning of the full table.
+        assertTrue ("Check size() consistency.",                    verticalDatum.size() >= 124);       // Cause a scanning of the full table.
         assertFalse("Shall not contain WGS84.",                     verticalDatum.contains("6326"));
         assertTrue ("Shall contain Mean Sea Level (MSL).",          verticalDatum.contains("5100"));
         assertFalse("Vertical datum should be a subset of datum.",  verticalDatum.containsAll(datum));  // Iteration should stop at the first mismatch.
         assertTrue ("Vertical datum should be a subset of datum.",  datum.containsAll(verticalDatum));  // Iteration should over a small set (vertical datum).
 
         if (RUN_EXTENSIVE_TESTS) {
-            assertTrue ("Check size() consistency.",                    geodeticDatum.size() > 0);
+            assertTrue ("Check size() consistency.",                    geodeticDatum.size() >= 445);
             assertTrue ("Geodetic datum should be a subset of datum.",  datum.size() > geodeticDatum.size());
             assertTrue ("Vertical datum should be a subset of datum.",  datum.size() > verticalDatum.size());
             assertTrue ("Geodetic datum should be a subset of datum.",  datum.containsAll(geodeticDatum));
@@ -597,7 +625,7 @@ public final strictfp class EPSGFactoryT
         assertTrue  ("Shall contain WGS84.",           crs.contains("4326"));
         assertTrue  ("Shall contain World Mercator.",  crs.contains("3395"));
         if (RUN_EXTENSIVE_TESTS) {
-            assertTrue  ("Check size() consistency.",  crs.size() > 0);         // Cause a scanning of the full table.
+            assertTrue  ("Check size() consistency.",  crs.size() >= 4175);      // Cause a scanning of the full table.
             assertEquals("Check size() consistency.",  crs.size(), crs.size());
         }
 
@@ -606,7 +634,7 @@ public final strictfp class EPSGFactoryT
         assertTrue ("Shall contain WGS84.",              geographicCRS.contains("4326"));
         assertFalse("Shall not contain projected CRS.",  geographicCRS.contains("3395"));
         if (RUN_EXTENSIVE_TESTS) {
-            assertTrue ("Check size() consistency.",                  geographicCRS.size() > 0);
+            assertTrue ("Check size() consistency.",                  geographicCRS.size() >= 468);
             assertTrue ("Geographic CRS should be a subset of CRS.",  geographicCRS.size() < crs.size());
             assertFalse("Geographic CRS should be a subset of CRS.",  geographicCRS.containsAll(crs));
             assertTrue ("Geographic CRS should be a subset of CRS.",  crs.containsAll(geographicCRS));
@@ -617,7 +645,7 @@ public final strictfp class EPSGFactoryT
         assertFalse("Shall not contain geographic CRS.",  projectedCRS.contains("4326"));
         assertTrue ("Shall contain World Mercator.",      projectedCRS.contains("3395"));
         if (RUN_EXTENSIVE_TESTS) {
-            assertTrue ("Check size() consistency.",                 projectedCRS.size() > 0);
+            assertTrue ("Check size() consistency.",                 projectedCRS.size() >= 3441);
             assertTrue ("Projected CRS should be a subset of CRS.",  projectedCRS.size() < crs.size());
             assertFalse("Projected CRS should be a subset of CRS.",  projectedCRS.containsAll(crs));
             assertTrue ("Projected CRS should be a subset of CRS.",  crs.containsAll(projectedCRS));
@@ -628,16 +656,22 @@ public final strictfp class EPSGFactoryT
          * COORDINATE OPERATIONS - There is thousands of operations, so we avoid all tests that may require
          *                         an iteration over the full table unless EXTENSIVE is true.
          */
-        final Set<String> operations      = factory.getAuthorityCodes(SingleOperation.class);
-        final Set<String> conversions     = factory.getAuthorityCodes(Conversion     .class);
-        final Set<String> projections     = factory.getAuthorityCodes(Projection     .class);
-        final Set<String> transformations = factory.getAuthorityCodes(Transformation .class);
+        final Set<String> methods         = factory.getAuthorityCodes(OperationMethod    .class);
+        final Set<String> parameters      = factory.getAuthorityCodes(ParameterDescriptor.class);
+        final Set<String> operations      = factory.getAuthorityCodes(SingleOperation    .class);
+        final Set<String> conversions     = factory.getAuthorityCodes(Conversion         .class);
+        final Set<String> projections     = factory.getAuthorityCodes(Projection         .class);
+        final Set<String> transformations = factory.getAuthorityCodes(Transformation     .class);
 
+        assertFalse("Methods not found.",          methods        .isEmpty());
+        assertFalse("Parameters not found.",       parameters     .isEmpty());
         assertFalse("Operations not found.",       operations     .isEmpty());
         assertFalse("Conversions not found.",      conversions    .isEmpty());
         assertFalse("Projections not found.",      projections    .isEmpty());
         assertFalse("Transformations not found.",  transformations.isEmpty());
 
+        assertTrue ("Shall contain “Mercator 1SP”",                    methods.contains("9804"));
+        assertTrue ("Shall contain “Scale factor”",                 parameters.contains("8805"));
         assertTrue ("Shall contain “ED50 to WGS 84 (1)”",           operations.contains("1133"));
         assertFalse("Shall not contain “ED50 to WGS 84 (1)”",      conversions.contains("1133"));
         assertFalse("Shall not contain “ED50 to WGS 84 (1)”",      projections.contains("1133"));
@@ -898,7 +932,7 @@ public final strictfp class EPSGFactoryT
         /*
          * Scan the database for searching the CRS.
          */
-        finder.setSearchDomain(IdentifiedObjectFinder.Domain.VALID_DATASET);
+        finder.setSearchDomain(IdentifiedObjectFinder.Domain.ALL_DATASET);
         final IdentifiedObject found = finder.findSingleton(crs);
         assertNotNull("With full scan allowed, the CRS should be found.", found);
         assertEpsgNameAndIdentifierEqual("WGS 84", 4326, found);

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -97,7 +97,7 @@ strictfp class MapProjectionTestCase ext
     {
         final Parameters parameters = parameters(provider, ellipse);
         if (centralMeridian  != 0) parameters.parameter(Constants.CENTRAL_MERIDIAN)   .setValue(centralMeridian, NonSI.DEGREE_ANGLE);
-        if (latitudeOfOrigin != 0) parameters.parameter("latitude_of_origin")         .setValue(latitudeOfOrigin);
+        if (latitudeOfOrigin != 0) parameters.parameter(Constants.LATITUDE_OF_ORIGIN) .setValue(latitudeOfOrigin);
         if (standardParallel != 0) parameters.parameter(Constants.STANDARD_PARALLEL_1).setValue(standardParallel);
         if (scaleFactor      != 1) parameters.parameter(Constants.SCALE_FACTOR)       .setValue(scaleFactor);
         if (falseEasting     != 0) parameters.parameter(Constants.FALSE_EASTING)      .setValue(falseEasting);

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -138,6 +138,7 @@ import org.junit.BeforeClass;
     org.apache.sis.internal.referencing.provider.NTv2Test.class,
     org.apache.sis.internal.referencing.provider.NADCONTest.class,
     org.apache.sis.internal.referencing.provider.MapProjectionTest.class,
+    org.apache.sis.internal.referencing.provider.TransverseMercatorTest.class,
     org.apache.sis.internal.referencing.provider.AllProvidersTest.class,
     org.apache.sis.referencing.operation.transform.InterpolatedTransformTest.class,
     org.apache.sis.referencing.operation.transform.InterpolatedGeocentricTransformTest.class,

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractMap.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractMap.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractMap.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/AbstractMap.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -374,6 +374,29 @@ public abstract class AbstractMap<K,V> i
                 final EntryIterator<K,V> it = entryIterator();
                 return (it != null) ? new Keys<>(it) : Collections.<K>emptyIterator();
             }
+
+            /** Overridden for the same reason than {@link AbstractMap#equals(Object). */
+            @Override public boolean equals(final Object object) {
+                if (object == this) {
+                    return true;
+                }
+                if (!(object instanceof Set<?>)) {
+                    return false;
+                }
+                final Set<?> that = (Set<?>) object;
+                final EntryIterator<K,V> it = entryIterator();
+                if (it == null) {
+                    return that.isEmpty();
+                }
+                int size = 0;
+                while (it.next()) {
+                    if (!that.contains(it.getKey())) {
+                        return false;
+                    }
+                    size++;
+                }
+                return size == that.size();
+            }
         };
     }
 
@@ -433,6 +456,29 @@ public abstract class AbstractMap<K,V> i
                 final EntryIterator<K,V> it = entryIterator();
                 return (it != null) ? new Entries<>(it) : Collections.<Entry<K,V>>emptyIterator();
             }
+
+            /** Overridden for the same reason than {@link AbstractMap#equals(Object). */
+            @Override public boolean equals(final Object object) {
+                if (object == this) {
+                    return true;
+                }
+                if (!(object instanceof Set<?>)) {
+                    return false;
+                }
+                final Set<?> that = (Set<?>) object;
+                final EntryIterator<K,V> it = entryIterator();
+                if (it == null) {
+                    return that.isEmpty();
+                }
+                int size = 0;
+                while (it.next()) {
+                    if (!that.contains(it.getEntry())) {
+                        return false;
+                    }
+                    size++;
+                }
+                return size == that.size();
+            }
         };
     }
 
@@ -543,27 +589,27 @@ public abstract class AbstractMap<K,V> i
         if (object == this) {
             return true;
         }
-        if (object instanceof Map) {
-            final Map<?,?> map = (Map<?,?>) object;
-            final EntryIterator<K,V> it = entryIterator();
-            if (it == null) {
-                return map.isEmpty();
-            }
-            /*
-             * We do not check if map.size() == size() because in some Apache SIS implementations,
-             * the size() method have to scan through all map entries. We presume that if the maps
-             * are not equal, we will find a mismatched entry soon anyway.
-             */
-            int size = 0;
-            while (it.next()) {
-                if (!it.getValue().equals(map.get(it.getKey()))) {
-                    return false;
-                }
-                size++;
+        if (!(object instanceof Map<?,?>)) {
+            return false;
+        }
+        final Map<?,?> that = (Map<?,?>) object;
+        final EntryIterator<K,V> it = entryIterator();
+        if (it == null) {
+            return that.isEmpty();
+        }
+        /*
+         * We do not check if map.size() == size() because in some Apache SIS implementations,
+         * the size() method have to scan through all map entries. We presume that if the maps
+         * are not equal, we will find a mismatched entry soon anyway.
+         */
+        int size = 0;
+        while (it.next()) {
+            if (!it.getValue().equals(that.get(it.getKey()))) {
+                return false;
             }
-            return size == map.size();
+            size++;
         }
-        return false;
+        return size == that.size();
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Constants.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Constants.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Constants.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Constants.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -111,6 +111,11 @@ public final class Constants extends Sta
     public static final String CENTRAL_MERIDIAN = "central_meridian";
 
     /**
+     * The OGC parameter name for the latitude of origin.
+     */
+    public static final String LATITUDE_OF_ORIGIN = "latitude_of_origin";
+
+    /**
      * The NetCDF parameter name for the standard parallels.
      */
     public static final String STANDARD_PARALLEL = "standard_parallel";
@@ -179,6 +184,21 @@ public final class Constants extends Sta
     public static final short EPSG_B0 = 8639;
 
     /**
+     * The EPSG code for metres.
+     */
+    public static final short EPSG_METRE = 9001;
+
+    /**
+     * The EPSG code for degrees when used in parameters.
+     */
+    public static final short EPSG_PARAM_DEGREES = 9102;
+
+    /**
+     * The EPSG code for degrees when used in axes.
+     */
+    public static final short EPSG_AXIS_DEGREES = 9122;
+
+    /**
      * Do not allow instantiation of this class.
      */
     private Constants() {

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/Longitude.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/Longitude.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/Longitude.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/Longitude.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -110,6 +110,8 @@ public final class Longitude extends Ang
      *   <li>±0 are returned unchanged (i.e. the sign of negative and positive zero is preserved)</li>
      * </ul>
      *
+     * Note that the given value should not be greater than 4×10⁸ degrees if a centimetric precision is desired.
+     *
      * @param  λ The longitude value in decimal degrees.
      * @return The given value normalized to the [-180 … 180)° range, or NaN if the given value was NaN of infinite.
      *

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/Units.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -531,6 +531,7 @@ public final class Units extends Static
      *       <tr><td style="width: 40px"><b>Code</b></td><td><b>Unit</b></td></tr>
      *       <tr><td>9001</td><td>metre</td></tr>
      *       <tr><td>9002</td><td>foot</td></tr>
+     *       <tr><td>9003</td><td>US survey foot</td></tr>
      *       <tr><td>9030</td><td>nautical mile</td></tr>
      *       <tr><td>9036</td><td>kilometre</td></tr>
      *     </table></td>
@@ -560,15 +561,17 @@ public final class Units extends Static
      */
     public static Unit<?> valueOfEPSG(final int code) {
         switch (code) {
+            case Constants.EPSG_PARAM_DEGREES:  // Fall through
+            case Constants.EPSG_AXIS_DEGREES:   return NonSI.DEGREE_ANGLE;
+            case Constants.EPSG_METRE:          return SI.METRE;
+
             case 1029: return       YEAR;
             case 1040: return SI   .SECOND;
-            case 9001: return SI   .METRE;
             case 9002: return NonSI.FOOT;
+            case 9003: return NonSI.FOOT_SURVEY_US;
             case 9030: return NonSI.NAUTICAL_MILE;
             case 9036: return SI   .KILOMETRE;
             case 9101: return SI   .RADIAN;
-            case 9122: // Fall through
-            case 9102: return NonSI.DEGREE_ANGLE;
             case 9103: return NonSI.MINUTE_ANGLE;
             case 9104: return NonSI.SECOND_ANGLE;
             case 9105: return NonSI.GRADE;
@@ -605,8 +608,8 @@ public final class Units extends Static
      */
     public static Integer getEpsgCode(final Unit<?> unit, final boolean inAxis) {
         Integer code = UnitsMap.EPSG_CODES.get(unit);
-        if (inAxis && code != null && code == 9102) {
-            code = UnitsMap.I9122;
+        if (inAxis && code != null && code == Constants.EPSG_PARAM_DEGREES) {
+            code = UnitsMap.EPSG_AXIS_DEGREES;
         }
         return code;
     }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitsMap.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitsMap.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitsMap.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitsMap.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -24,6 +24,7 @@ import javax.measure.unit.SI;
 import javax.measure.unit.NonSI;
 import javax.measure.unit.Unit;
 import javax.measure.quantity.Quantity;
+import org.apache.sis.internal.util.Constants;
 import org.apache.sis.util.Static;
 
 import static org.apache.sis.measure.Units.*;
@@ -49,7 +50,7 @@ final class UnitsMap extends Static {
      * The 9122 integer, used as an alternative code for the degrees unit.
      * See {@link Units#getEpsgCode(Unit, boolean)} for more information.
      */
-    static final Integer I9122 = 9122;
+    static final Integer EPSG_AXIS_DEGREES = (int) Constants.EPSG_AXIS_DEGREES;
 
     /**
      * EPSG codes of some units. This map is the reverse of {@link Units#valueOfEPSG(int)}.

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/CharSequences.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -576,7 +576,7 @@ search:     for (; fromIndex <= toIndex;
      *
      * <p>Special cases:</p>
      * <ul>
-     *   <li>If {@code toIndex} is lower than {@code toIndex},
+     *   <li>If {@code fromIndex} is lower than {@code toIndex},
      *       then this method unconditionally returns {@code toIndex}.</li>
      *   <li>If the given range contains only space characters and the character at {@code fromIndex}
      *       is the low surrogate of a valid supplementary code point, then this method returns

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/IntegerList.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/IntegerList.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/IntegerList.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/collection/IntegerList.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -450,6 +450,9 @@ public class IntegerList extends Abstrac
 
     /**
      * Invokes {@link #trimToSize()} before serialization in order to make the stream more compact.
+     *
+     * @param  out The output stream where to serialize this list.
+     * @throws IOException If an I/O error occurred while writing.
      */
     private void writeObject(final ObjectOutputStream out) throws IOException {
         trimToSize();

Modified: sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/SQLInvalidRecordNumberForDirectAccessException.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/SQLInvalidRecordNumberForDirectAccessException.java?rev=1724476&r1=1724475&r2=1724476&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/SQLInvalidRecordNumberForDirectAccessException.java [iso-8859-1] (original)
+++ sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/SQLInvalidRecordNumberForDirectAccessException.java [UTF-8] Wed Jan 13 18:31:16 2016
@@ -1,65 +1,65 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.sis.internal.shapefile;
-
-import java.sql.SQLNonTransientException;
-
-
-/**
- * Thrown when a record number is invalid to do a direct access in a Shapefile or a DBase III file.
- *
- * @author  Marc Le Bihan
- * @version 0.7
- * @since   0.7
- * @module
- */
-public class SQLInvalidRecordNumberForDirectAccessException extends SQLNonTransientException {
-    /** Serial UID. */
-    private static final long serialVersionUID = 6828362742568015813L;
-    
-    /** Wrong record number. */
-    private int wrongRecordNumber;
-
-    /**
-     * Construct an exception.
-     * @param number Wrong record number value.
-     * @param message Message of the exception.
-     */
-    public SQLInvalidRecordNumberForDirectAccessException(int number, String message) {
-        super(message);
-        this.wrongRecordNumber = number;
-    }
-
-    /**
-     * Construct an exception.
-     * @param number Wrong record number value.
-     * @param message Message of the exception.
-     * @param cause Root cause of the exception.
-     */
-    public SQLInvalidRecordNumberForDirectAccessException(int number, String message, Throwable cause) {
-        super(message, cause);
-        this.wrongRecordNumber = number;
-    }
-    
-    /**
-     * Returns the wrong record number value.
-     * @return Record number.
-     */
-    public int getWrongRecordNumber() {
-        return this.wrongRecordNumber;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.shapefile;
+
+import java.sql.SQLNonTransientException;
+
+
+/**
+ * Thrown when a record number is invalid to do a direct access in a Shapefile or a DBase III file.
+ *
+ * @author  Marc Le Bihan
+ * @version 0.7
+ * @since   0.7
+ * @module
+ */
+public class SQLInvalidRecordNumberForDirectAccessException extends SQLNonTransientException {
+    /** Serial UID. */
+    private static final long serialVersionUID = 6828362742568015813L;
+    
+    /** Wrong record number. */
+    private int wrongRecordNumber;
+
+    /**
+     * Construct an exception.
+     * @param number Wrong record number value.
+     * @param message Message of the exception.
+     */
+    public SQLInvalidRecordNumberForDirectAccessException(int number, String message) {
+        super(message);
+        this.wrongRecordNumber = number;
+    }
+
+    /**
+     * Construct an exception.
+     * @param number Wrong record number value.
+     * @param message Message of the exception.
+     * @param cause Root cause of the exception.
+     */
+    public SQLInvalidRecordNumberForDirectAccessException(int number, String message, Throwable cause) {
+        super(message, cause);
+        this.wrongRecordNumber = number;
+    }
+    
+    /**
+     * Returns the wrong record number value.
+     * @return Record number.
+     */
+    public int getWrongRecordNumber() {
+        return this.wrongRecordNumber;
+    }
+}

Propchange: sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/SQLInvalidRecordNumberForDirectAccessException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK7/storage/sis-shapefile/src/main/java/org/apache/sis/internal/shapefile/SQLInvalidRecordNumberForDirectAccessException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8



Mime
View raw message