sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1692168 [1/3] - in /sis/branches/JDK6: ./ application/sis-console/src/main/java/org/apache/sis/console/ core/sis-feature/src/main/java/org/apache/sis/feature/ core/sis-feature/src/test/java/org/apache/sis/feature/ core/sis-metadata/src/mai...
Date Tue, 21 Jul 2015 16:41:14 GMT
Author: desruisseaux
Date: Tue Jul 21 16:41:12 2015
New Revision: 1692168

URL: http://svn.apache.org/r1692168
Log:
Merge the compiler warning fixes and implementation of Polar Stereographic projection from the JDK7 branch.

Added:
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractStereographic.java
      - copied unchanged from r1692163, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractStereographic.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/ObliqueStereographic.java
      - copied unchanged from r1692163, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/ObliqueStereographic.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicA.java
      - copied unchanged from r1692163, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicA.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicB.java
      - copied unchanged from r1692163, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicB.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicC.java
      - copied unchanged from r1692163, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicC.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicNorth.java
      - copied unchanged from r1692163, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicNorth.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicSouth.java
      - copied unchanged from r1692163, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicSouth.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java
      - copied unchanged from r1692163, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercatorSouth.java
      - copied unchanged from r1692163, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercatorSouth.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ConformalProjection.java
      - copied unchanged from r1692163, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ConformalProjection.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/PolarStereographic.java
      - copied, changed from r1692163, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/PolarStereographic.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java
      - copied, changed from r1692163, sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ConformalProjectionTest.java
      - copied unchanged from r1692163, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ConformalProjectionTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/PolarStereographicTest.java
      - copied unchanged from r1692163, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/PolarStereographicTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ProjectionResultComparator.java
      - copied, changed from r1692163, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ProjectionResultComparator.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/TransverseMercatorTest.java
      - copied unchanged from r1692163, sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/TransverseMercatorTest.java
Removed:
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/AbstractLambertConformal.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Assertions.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/AbstractLambertConformalTest.java
Modified:
    sis/branches/JDK6/   (props changed)
    sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/SubCommand.java
    sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java
    sis/branches/JDK6/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAttributeTypeTest.java
    sis/branches/JDK6/core/sis-feature/src/test/java/org/apache/sis/feature/MultiValuedAttributeTest.java
    sis/branches/JDK6/core/sis-feature/src/test/java/org/apache/sis/feature/SingletonAttributeTest.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_AggregateInformation.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java
    sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractMercator.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Equirectangular.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal1SP.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal2SP.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalMichigan.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalWest.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MercatorSpherical.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PseudoMercator.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/Parameters.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/UninitializedParameter.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCompoundCS.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Solver.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConformal.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/NormalizedProjection.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/AbstractLinearTransform.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ConcatenatedTransform.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/ContextualParameters.java
    sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CopyTransform.java
    sis/branches/JDK6/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/MapProjectionTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/EquirectangularTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/LambertConformalTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorMethodComparison.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/NoOp.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/NormalizedProjectionTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateDomain.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/CoordinateDomainTest.java
    sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/StringConverter.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/converter/SystemConverter.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/IdentifierMapWithSpecialCases.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Boolean.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Integer.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/GO_Integer64.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gco/PropertyType.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/jaxb/gml/TimeInstant.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/system/DelayedRunnable.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/system/OS.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/internal/system/SystemListener.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/io/AppendableWriter.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/measure/AngleFormat.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/Locales.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/iso/DefaultScopedName.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/util/logging/DualLogger.java
    sis/branches/JDK6/core/sis-utility/src/main/java/org/apache/sis/xml/NilReason.java
    sis/branches/JDK6/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java
    sis/branches/JDK6/storage/sis-netcdf/src/main/java/org/apache/sis/internal/netcdf/ucar/DecoderWrapper.java
    sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/ChannelDecoderTest.java
    sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/GridGeometryInfoTest.java
    sis/branches/JDK6/storage/sis-netcdf/src/test/java/org/apache/sis/internal/netcdf/impl/VariableInfoTest.java
    sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/MimeTypeDetector.java
    sis/branches/JDK6/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/xml/XMLStoreProvider.java

Propchange: sis/branches/JDK6/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jul 21 16:41:12 2015
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
-/sis/branches/JDK7:1394913-1690762
-/sis/branches/JDK8:1584960-1690754
+/sis/branches/JDK7:1394913-1692163
+/sis/branches/JDK8:1584960-1692159
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/SubCommand.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/SubCommand.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/SubCommand.java [UTF-8] (original)
+++ sis/branches/JDK6/application/sis-console/src/main/java/org/apache/sis/console/SubCommand.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -202,6 +202,7 @@ abstract class SubCommand {
             console = System.console();
             colors = (value != null) ? Option.COLORS.parseBoolean(value) : (console != null) && X364.isAnsiSupported();
         } catch (RuntimeException e) {
+            @SuppressWarnings("null") // 'option' has been assigned in 'get' argument.
             final String name = option.name().toLowerCase(Locale.US);
             throw new InvalidOptionException(Errors.format(Errors.Keys.IllegalOptionValue_2, name, value), name);
         }

Modified: sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-feature/src/main/java/org/apache/sis/feature/AbstractIdentifiedType.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -165,6 +165,7 @@ public class AbstractIdentifiedType impl
      * @param  identification The name and other information to be given to this identified type.
      * @throws IllegalArgumentException if a property has an invalid value.
      */
+    @SuppressWarnings("OverridableMethodCallDuringObjectConstruction")
     protected AbstractIdentifiedType(final Map<String,?> identification) throws IllegalArgumentException {
         ensureNonNull("identification", identification);
         Object value = identification.get(NAME_KEY);

Modified: sis/branches/JDK6/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAttributeTypeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAttributeTypeTest.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAttributeTypeTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-feature/src/test/java/org/apache/sis/feature/DefaultAttributeTypeTest.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -151,6 +151,7 @@ public final strictfp class DefaultAttri
      * Tests attribute comparison.
      */
     @Test
+    @SuppressWarnings("ObjectEqualsNull")
     public void testEquals() {
         final Map<String,Object> identification = new HashMap<String,Object>(4);
         final DefaultAttributeType<Integer> a1 = population(identification);

Modified: sis/branches/JDK6/core/sis-feature/src/test/java/org/apache/sis/feature/MultiValuedAttributeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-feature/src/test/java/org/apache/sis/feature/MultiValuedAttributeTest.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-feature/src/test/java/org/apache/sis/feature/MultiValuedAttributeTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-feature/src/test/java/org/apache/sis/feature/MultiValuedAttributeTest.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -124,6 +124,7 @@ public final strictfp class MultiValuedA
      */
     @Test
     @DependsOnMethod("testValue")
+    @SuppressWarnings("ObjectEqualsNull")
     public void testEquals() {
         final AbstractAttribute<Integer> a1 = population();
         final AbstractAttribute<Integer> a2 = population();

Modified: sis/branches/JDK6/core/sis-feature/src/test/java/org/apache/sis/feature/SingletonAttributeTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-feature/src/test/java/org/apache/sis/feature/SingletonAttributeTest.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-feature/src/test/java/org/apache/sis/feature/SingletonAttributeTest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-feature/src/test/java/org/apache/sis/feature/SingletonAttributeTest.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -130,6 +130,7 @@ public final strictfp class SingletonAtt
      */
     @Test
     @DependsOnMethod("testValue")
+    @SuppressWarnings("ObjectEqualsNull")
     public void testEquals() {
         final AbstractAttribute<Integer> a1 = population();
         final AbstractAttribute<Integer> a2 = population();

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_AggregateInformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_AggregateInformation.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_AggregateInformation.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/jaxb/metadata/MD_AggregateInformation.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -32,6 +32,7 @@ import org.apache.sis.internal.jaxb.gco.
  * @version 0.3
  * @module
  */
+@SuppressWarnings("deprecation")
 public final class MD_AggregateInformation extends
         PropertyType<MD_AggregateInformation, AggregateInformation>
 {

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/LegacyPropertyAdapter.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -22,7 +22,6 @@ import java.util.Collections;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
 import org.apache.sis.metadata.AbstractMetadata;
-import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.internal.jaxb.Context;
 import org.apache.sis.util.resources.Messages;
 import org.apache.sis.util.ArgumentChecks;

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/MetadataUtilities.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -20,7 +20,6 @@ import java.util.Date;
 import org.apache.sis.xml.NilReason;
 import org.apache.sis.util.Static;
 import org.apache.sis.util.resources.Errors;
-import org.apache.sis.metadata.iso.ISOMetadata;
 import org.apache.sis.metadata.InvalidMetadataException;
 import org.apache.sis.internal.jaxb.PrimitiveTypeProperties;
 import org.apache.sis.internal.jaxb.Context;
@@ -71,6 +70,7 @@ public final class MetadataUtilities ext
      * @return The given value as a primitive type.
      * @throws InvalidMetadataException if the given value is nil.
      */
+    @SuppressWarnings("NumberEquality")
     public static boolean getInclusion(final Boolean value) throws InvalidMetadataException {
         if (value == null) {
             return true;
@@ -78,7 +78,7 @@ public final class MetadataUtilities ext
         final boolean p = value;
         // (value == Boolean.FALSE) is an optimization for a common case avoiding PrimitiveTypeProperties check.
         // DO NOT REPLACE BY 'equals' OR 'booleanValue()' - the exact reference value matter.
-        if (p || value == Boolean.FALSE || !(PrimitiveTypeProperties.property(value) instanceof NilReason)) {
+        if (p || (value == Boolean.FALSE) || !(PrimitiveTypeProperties.property(value) instanceof NilReason)) {
             return p;
         }
         throw new InvalidMetadataException(Errors.format(Errors.Keys.MissingValueForProperty_1, "inclusion"));

Modified: sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/FormattableObject.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -142,6 +142,7 @@ public abstract class FormattableObject
      * <p>This is a convenience method for debugging purpose and for console applications.</p>
      */
     @Debug
+    @SuppressWarnings("UseOfSystemOutOrSystemErr")
     public void print() {
         final Console console = System.console();
         final PrintWriter out = (console != null) ? console.writer() : null;

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractMercator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractMercator.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractMercator.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractMercator.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -59,6 +59,7 @@ class AbstractMercator extends MapProjec
      *
      * @throws ArrayStoreException if a {@code descriptors} element is not an instance of {@link ParameterDescriptor}.
      */
+    @SuppressWarnings("SuspiciousToArrayCall")
     static ParameterDescriptor<?>[] toArray(List<GeneralParameterDescriptor> descriptors) {
         descriptors = descriptors.subList(2, descriptors.size());
         return descriptors.toArray(new ParameterDescriptor<?>[descriptors.size()]);  // Intentional array subtype.
@@ -87,7 +88,7 @@ class AbstractMercator extends MapProjec
      * @return The map projection created from the given parameter values.
      */
     @Override
-    protected final NormalizedProjection createProjection(final Parameters parameters) {
+    protected NormalizedProjection createProjection(final Parameters parameters) {
         return new Mercator(this, parameters);
     }
 }

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractProvider.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -128,10 +128,7 @@ abstract class AbstractProvider extends
      * where the default value should be the value of another parameter instead than 0°.
      */
     static ParameterDescriptor<Double> createMandatoryLatitude(final ParameterBuilder builder) {
-        return builder.createBounded(MeasurementRange.create(
-                Latitude.MIN_VALUE, true,
-                Latitude.MAX_VALUE, true,
-                NonSI.DEGREE_ANGLE), null);
+        return builder.createBounded(Latitude.MIN_VALUE, Latitude.MAX_VALUE, Double.NaN, NonSI.DEGREE_ANGLE);
     }
 
     /**
@@ -148,10 +145,7 @@ abstract class AbstractProvider extends
      * Creates a descriptor for a longitude parameter in degrees with a default value of 0°.
      */
     static ParameterDescriptor<Double> createLongitude(final ParameterBuilder builder) {
-        return builder.createBounded(MeasurementRange.create(
-                Longitude.MIN_VALUE, true,
-                Longitude.MAX_VALUE, true,
-                NonSI.DEGREE_ANGLE), 0.0);
+        return builder.createBounded(Longitude.MIN_VALUE, Longitude.MAX_VALUE, 0.0, NonSI.DEGREE_ANGLE);
     }
 
     /**

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -120,6 +120,7 @@ public final class Affine extends Abstra
      *
      * @see org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory
      */
+    @SuppressWarnings("ThisEscapedInObjectConstruction")
     public Affine() {
         super(IDENTIFICATION_EPSG, EPSG_DIMENSION, EPSG_DIMENSION, new Descriptor(IDENTIFICATION_EPSG,
                 Arrays.copyOfRange( // Discards param 0 and 1, take only the ones in index range [2…7].

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Equirectangular.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Equirectangular.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Equirectangular.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Equirectangular.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -100,7 +100,7 @@ public final class Equirectangular exten
      * The operation parameter descriptor for the <cite>Longitude of natural origin</cite> (λ₀) parameter value.
      * Valid values range is [-180 … 180]° and default value is 0°.
      */
-    public static final ParameterDescriptor<Double> CENTRAL_MERIDIAN;
+    public static final ParameterDescriptor<Double> LONGITUDE_OF_ORIGIN;
 
     /**
      * The operation parameter descriptor for the <cite>False easting</cite> (FE) parameter value.
@@ -130,7 +130,7 @@ public final class Equirectangular exten
                 .addName(Citations.GEOTIFF, "ProjStdParallel1")
                 .addName(Citations.PROJ4,   "lat_ts"), false);
 
-        CENTRAL_MERIDIAN = createLongitude(builder
+        LONGITUDE_OF_ORIGIN = createLongitude(builder
                 .addIdentifier("8802")
                 .addName("Longitude of natural origin")
                 .addName(Citations.OGC,     Constants.CENTRAL_MERIDIAN)
@@ -189,7 +189,7 @@ public final class Equirectangular exten
             .createGroupForMapProjection(
                     STANDARD_PARALLEL,
                     LATITUDE_OF_ORIGIN,     // Not formally an Equirectangular parameter.
-                    CENTRAL_MERIDIAN,
+                    LONGITUDE_OF_ORIGIN,
                     FALSE_EASTING,
                     FALSE_NORTHING);
     }
@@ -250,7 +250,7 @@ public final class Equirectangular exten
         final ContextualParameters context = new ContextualParameters(this);
         double a  = getAndStore(p, context, MapProjection.SEMI_MAJOR);
         double b  = getAndStore(p, context, MapProjection.SEMI_MINOR);
-        double λ0 = getAndStore(p, context, CENTRAL_MERIDIAN);
+        double λ0 = getAndStore(p, context, LONGITUDE_OF_ORIGIN);
         double φ0 = getAndStore(p, context, LATITUDE_OF_ORIGIN);
         double φ1 = getAndStore(p, context, STANDARD_PARALLEL);
         double fe = getAndStore(p, context, FALSE_EASTING);

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal1SP.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal1SP.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal1SP.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal1SP.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -46,7 +46,7 @@ public final class LambertConformal1SP e
 
     /**
      * The operation parameter descriptor for the <cite>Latitude of natural origin</cite> (φ₀) parameter value.
-     * Valid values range is [-90 … 90]° and default value is 0°.
+     * Valid values range is [-90 … 90]°. There is no default value.
      */
     public static final ParameterDescriptor<Double> LATITUDE_OF_ORIGIN;
 
@@ -54,7 +54,7 @@ public final class LambertConformal1SP e
      * The operation parameter descriptor for the <cite>Longitude of natural origin</cite> (λ₀) parameter value.
      * Valid values range is [-180 … 180]° and default value is 0°.
      */
-    public static final ParameterDescriptor<Double> CENTRAL_MERIDIAN = Mercator1SP.CENTRAL_MERIDIAN;
+    public static final ParameterDescriptor<Double> LONGITUDE_OF_ORIGIN = Mercator1SP.LONGITUDE_OF_ORIGIN;
 
     /**
      * The operation parameter descriptor for the <cite>Scale factor at natural origin</cite> (k₀) parameter value.
@@ -65,7 +65,7 @@ public final class LambertConformal1SP e
     /**
      * The group of all parameters expected by this coordinate operation.
      */
-    static final ParameterDescriptorGroup PARAMETERS;
+    private static final ParameterDescriptorGroup PARAMETERS;
     static {
         final ParameterBuilder builder = builder();
 
@@ -80,7 +80,7 @@ public final class LambertConformal1SP e
             .addIdentifier(Citations.GEOTIFF, "9")
             .createGroupForMapProjection(
                     LATITUDE_OF_ORIGIN,
-                    CENTRAL_MERIDIAN,
+                    LONGITUDE_OF_ORIGIN,
                     SCALE_FACTOR,
                     FALSE_EASTING,
                     FALSE_NORTHING);

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal2SP.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal2SP.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal2SP.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal2SP.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -105,7 +105,7 @@ public final class LambertConformal2SP e
          * NetCDF:  longitude_of_central_meridian
          * GeoTIFF: FalseOriginLong
          */
-        LONGITUDE_OF_FALSE_ORIGIN = createLongitude(exceptEPSG(LambertConformal1SP.CENTRAL_MERIDIAN, builder
+        LONGITUDE_OF_FALSE_ORIGIN = createLongitude(exceptEPSG(LambertConformal1SP.LONGITUDE_OF_ORIGIN, builder
                 .addIdentifier("8822")
                 .addName("Longitude of false origin"))
                 .rename(Citations.NETCDF, "longitude_of_central_meridian")

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalMichigan.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalMichigan.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalMichigan.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalMichigan.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -50,7 +50,7 @@ public final class LambertConformalMichi
     /**
      * The group of all parameters expected by this coordinate operation.
      */
-    static final ParameterDescriptorGroup PARAMETERS;
+    private static final ParameterDescriptorGroup PARAMETERS;
     static {
         final ParameterBuilder builder = builder();
         SCALE_FACTOR = builder

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalWest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalWest.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalWest.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformalWest.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -52,12 +52,19 @@ public final class LambertConformalWest
     public static final String IDENTIFIER = "9826";
 
     /**
+     * The operation parameter descriptor for the <cite>False easting</cite> (FE) parameter value.
+     * In the case of West Orientated projection, despite its EPSG name this parameter is actually
+     * <cite>False westing</cite> (FW)
+     */
+    static final ParameterDescriptor<Double> FALSE_WESTING;
+
+    /**
      * The group of all parameters expected by this coordinate operation.
      */
-    static final ParameterDescriptorGroup PARAMETERS;
+    private static final ParameterDescriptorGroup PARAMETERS;
     static {
         final ParameterBuilder builder = builder();
-        final ParameterDescriptor<?> falseEasting = createShift(builder
+        FALSE_WESTING = createShift(builder
                 .addNamesAndIdentifiers(LambertConformal1SP.FALSE_EASTING)
                 .setRemarks(Messages.formatInternational(Messages.Keys.MisnamedParameter_1, "False westing")));
 
@@ -66,9 +73,9 @@ public final class LambertConformalWest
             .addName("Lambert Conic Conformal (West Orientated)")
             .createGroupForMapProjection(
                     LambertConformal1SP.LATITUDE_OF_ORIGIN,
-                    LambertConformal1SP.CENTRAL_MERIDIAN,
+                    LambertConformal1SP.LONGITUDE_OF_ORIGIN,
                     LambertConformal1SP.SCALE_FACTOR,
-                    falseEasting,
+                                        FALSE_WESTING,
                     LambertConformal1SP.FALSE_NORTHING);
     }
 

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -213,6 +213,26 @@ public abstract class MapProjection exte
     }
 
     /**
+     * Copies all names and identifiers, but using the given authority as the primary name.
+     * This is a convenience method for defining the parameters of an ESRI-specific projection
+     * using the EPSG parameters as template.
+     */
+    static ParameterBuilder addNamesAndIdentifiers(final Citation authority,
+            final ParameterDescriptor<Double> source, final ParameterBuilder builder)
+    {
+        builder.addName(sameNameAs(authority, source)).addName(source.getName());
+        for (final GenericName alias : source.getAlias()) {
+            if (((Identifier) alias).getAuthority() != authority) {
+                builder.addName(alias);
+            }
+        }
+        for (final Identifier id : source.getIdentifiers()) {
+            builder.addIdentifier(id);
+        }
+        return builder;
+    }
+
+    /**
      * Copies all names except the EPSG one from the given parameter into the builder.
      * The EPSG name is presumed the first name and identifier (this is not verified).
      */
@@ -224,6 +244,16 @@ public abstract class MapProjection exte
     }
 
     /**
+     * Returns the same parameter than the given one, except that the primary name is the ESRI name
+     * instead than the EPSG one.
+     */
+    @SuppressWarnings("unchecked")
+    static ParameterDescriptor<Double> forESRI(final ParameterDescriptor<Double> source, final ParameterBuilder builder) {
+        return addNamesAndIdentifiers(Citations.ESRI, source, builder).createBounded((MeasurementRange<Double>)
+                ((DefaultParameterDescriptor<Double>) source).getValueDomain(), source.getDefaultValue());
+    }
+
+    /**
      * Creates a remarks for parameters that are not formally EPSG parameter.
      *
      * @param origin The name of the projection for where the parameter is formally used.

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -52,7 +52,7 @@ public final class Mercator1SP extends A
      * The operation parameter descriptor for the <cite>Longitude of natural origin</cite> (λ₀) parameter value.
      * Valid values range is [-180 … 180]° and default value is 0°.
      */
-    public static final ParameterDescriptor<Double> CENTRAL_MERIDIAN;
+    public static final ParameterDescriptor<Double> LONGITUDE_OF_ORIGIN;
 
     /**
      * The operation parameter descriptor for the <cite>Scale factor at natural origin</cite> (k₀) parameter value.
@@ -70,7 +70,7 @@ public final class Mercator1SP extends A
                 .rename(Citations.GEOTIFF, "NatOriginLat")
                 .setRemarks(Equirectangular.LATITUDE_OF_ORIGIN.getRemarks()), 0.0);
 
-        CENTRAL_MERIDIAN = createLongitude(builder.addNamesAndIdentifiers(Equirectangular.CENTRAL_MERIDIAN)
+        LONGITUDE_OF_ORIGIN = createLongitude(builder.addNamesAndIdentifiers(Equirectangular.LONGITUDE_OF_ORIGIN)
                 .rename(Citations.GEOTIFF, "NatOriginLong"));
 
         SCALE_FACTOR = createScale(builder
@@ -93,7 +93,7 @@ public final class Mercator1SP extends A
             .addIdentifier(Citations.MAP_INFO, "10")    // MapInfo names this projection "Mercator".
             .createGroupForMapProjection(
                     LATITUDE_OF_ORIGIN,
-                    CENTRAL_MERIDIAN,
+                    LONGITUDE_OF_ORIGIN,
                     SCALE_FACTOR,
                     FALSE_EASTING,
                     FALSE_NORTHING);

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -57,8 +57,8 @@ public final class Mercator2SP extends A
      * The operation parameter descriptor for the <cite>Scale factor</cite> (not necessarily at natural origin)
      * parameter value. Valid values range is (0 … ∞) and default value is 1.
      *
-     * <p>This parameter is used by {@link Mercator1SP} and is not formally a parameter of {@link Mercator2SP}
-     * projections. Nevertheless we declare it is as an optional parameter because it is sometime used in Well
+     * <p>This parameter is used by {@link Mercator1SP} and is not formally a parameter of {@code Mercator2SP}
+     * projection. Nevertheless we declare it is as an optional parameter because it is sometime used in Well
      * Known Text (WKT). However it shall be interpreted as a <cite>Scale factor at the standard parallel</cite>
      * rather than at the natural origin.</p>
      */
@@ -104,7 +104,7 @@ public final class Mercator2SP extends A
             .createGroupForMapProjection(
                     STANDARD_PARALLEL,
                     latitudeOfOrigin,       // Not formally a Mercator2SP parameter.
-                    Mercator1SP.CENTRAL_MERIDIAN,
+                    Mercator1SP.LONGITUDE_OF_ORIGIN,
                     SCALE_FACTOR,           // Not formally a Mercator2SP parameter.
                     FALSE_EASTING,
                     FALSE_NORTHING);

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MercatorSpherical.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MercatorSpherical.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MercatorSpherical.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MercatorSpherical.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -69,7 +69,7 @@ public final class MercatorSpherical ext
             .addDeprecatedName("Mercator (1SP) (Spherical)", "Mercator (Spherical)")  // Prior to EPSG version 7.6
             .createGroupForMapProjection(
                     Mercator1SP.LATITUDE_OF_ORIGIN,
-                    Mercator1SP.CENTRAL_MERIDIAN,
+                    Mercator1SP.LONGITUDE_OF_ORIGIN,
                     scaleFactor,
                     FALSE_EASTING,
                     FALSE_NORTHING);

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PseudoMercator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PseudoMercator.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PseudoMercator.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PseudoMercator.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -44,7 +44,7 @@ public final class PseudoMercator extend
     /**
      * The group of all parameters expected by this coordinate operation.
      */
-    static final ParameterDescriptorGroup PARAMETERS;
+    private static final ParameterDescriptorGroup PARAMETERS;
     static {
         final ParameterBuilder builder = builder();
         PARAMETERS = builder

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -92,7 +92,7 @@ public class RegionalMercator extends Ab
             .addName("Mercator (variant C)")
             .createGroupForMapProjection(
                     Mercator2SP.STANDARD_PARALLEL,
-                    Mercator1SP.CENTRAL_MERIDIAN,
+                    Mercator1SP.LONGITUDE_OF_ORIGIN,    // Really "natural origin", not "false origin".
                     LATITUDE_OF_FALSE_ORIGIN,
                     EASTING_AT_FALSE_ORIGIN,
                     NORTHING_AT_FALSE_ORIGIN);

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -970,6 +970,7 @@ public class ParameterFormat extends Tab
     /**
      * Writes the given object to the console using a shared instance of {@code ParameterFormat}.
      */
+    @SuppressWarnings("UseOfSystemOutOrSystemErr")
     static void print(final Object object) {
         final Console console = System.console();
         final Appendable out = (console != null) ? console.writer() : System.out;

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/Parameters.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/Parameters.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/Parameters.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/Parameters.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -141,6 +141,7 @@ public abstract class Parameters impleme
     }
 
     /** Wrappers used as a fallback by {@link Parameters#castOrWrap(ParameterValueGroup)}. */
+    @SuppressWarnings("CloneDoesntCallSuperClone")
     private static final class Wrapper extends Parameters implements Serializable {
         private static final long serialVersionUID = -5491790565456920471L;
         private final ParameterValueGroup delegate;
@@ -302,11 +303,9 @@ public abstract class Parameters impleme
             final Identifier group = descriptor.getName();
             if (group != null) {    // Paranoiac check (should never be null)
                 final Citation authority = group.getAuthority();
-                if (authority != null) {
-                    final String name = IdentifiedObjects.getName(source, group.getAuthority());
-                    if (name != null) {
-                        return name;
-                    }
+                final String name = IdentifiedObjects.getName(source, authority);
+                if (name != null || authority == null) {
+                    return name;
                 }
             }
         }

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/UninitializedParameter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/UninitializedParameter.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/UninitializedParameter.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/parameter/UninitializedParameter.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -33,6 +33,7 @@ import org.apache.sis.referencing.Identi
  * @version 0.4
  * @module
  */
+@SuppressWarnings("CloneInNonCloneableClass")
 final class UninitializedParameter implements GeneralParameterValue, Serializable { // Intentionally non-Cloneable.
     /**
      * For cross-version serialization compatibility.

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultCompoundCRS.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -235,6 +235,7 @@ public class DefaultCompoundCRS extends
      * <p><strong>WARNING:</strong> this method is invoked by constructors <em>before</em>
      * the {@linkplain #components} field is set. Do not use this field in this method.</p>
      */
+    @SuppressWarnings("SuspiciousToArrayCall")
     private List<? extends CoordinateReferenceSystem> copy(List<? extends CoordinateReferenceSystem> components) {
         if (computeSingleCRS(components)) {
             components = singles; // Shares the same list.

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/AbstractCS.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -164,6 +164,7 @@ public class AbstractCS extends Abstract
      * @param properties The properties to be given to the identified object.
      * @param axes       The sequence of axes.
      */
+    @SuppressWarnings("OverridableMethodCallDuringObjectConstruction")
     public AbstractCS(final Map<String,?> properties, CoordinateSystemAxis... axes) {
         super(properties);
         ensureNonNull("axes", axes);

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCompoundCS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCompoundCS.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCompoundCS.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/DefaultCompoundCS.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -145,6 +145,7 @@ public class DefaultCompoundCS extends A
     /**
      * Returns all axes in the given sequence of components.
      */
+    @SuppressWarnings("ForLoopReplaceableByForEach")
     private static CoordinateSystemAxis[] getAxes(final CoordinateSystem[] components) {
         int count = 0;
         for (int i=0; i<components.length; i++) {

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Solver.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Solver.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Solver.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Solver.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -37,6 +37,7 @@ import org.apache.sis.util.ArraysExt;
  * @version 0.4
  * @module
  */
+@SuppressWarnings("CloneInNonCloneableClass")
 final class Solver implements Matrix { // Not Cloneable, despite the clone() method.
     /**
      * The size of the (i, j, s) tuples used internally by {@link #solve(Matrix, Matrix, double[], int, int)}

Modified: sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConformal.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConformal.java?rev=1692168&r1=1692167&r2=1692168&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConformal.java [UTF-8] (original)
+++ sis/branches/JDK6/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/LambertConformal.java [UTF-8] Tue Jul 21 16:41:12 2015
@@ -18,9 +18,11 @@ package org.apache.sis.referencing.opera
 
 import java.util.Map;
 import java.util.EnumMap;
+import org.opengis.util.FactoryException;
 import org.opengis.parameter.ParameterValueGroup;
 import org.opengis.parameter.ParameterDescriptor;
-import org.opengis.parameter.ParameterDescriptorGroup;
+import org.opengis.referencing.operation.MathTransform;
+import org.opengis.referencing.operation.MathTransformFactory;
 import org.opengis.referencing.operation.OperationMethod;
 import org.opengis.referencing.operation.Matrix;
 import org.apache.sis.measure.Latitude;
@@ -64,23 +66,39 @@ import static org.apache.sis.math.MathFu
  * @version 0.6
  * @module
  */
-public class LambertConformal extends AbstractLambertConformal {
+public class LambertConformal extends ConformalProjection {
     /**
      * For cross-version compatibility.
      */
     private static final long serialVersionUID = 2067358524298002016L;
 
     /**
-     * Codes for special kinds of Lambert projection. We do not provide such codes in public API because
-     * they duplicate the functionality of {@link OperationMethod} instances. We use them only for convenience.
+     * Codes for variants of Lambert Conical Conformal projection. Those variants modify the way the projections are
+     * constructed (e.g. in the way parameters are interpreted), but formulas are basically the same after construction.
+     * Those variants are not exactly the same than variants 1SP and 2SP used by EPSG, but they are closely related.
      *
-     * <p>Codes for SP1 case must be odd, and codes for SP2 case must be even.</p>
+     * <p>We do not provide such codes in public API because they duplicate the functionality of
+     * {@link OperationMethod} instances. We use them only for constructors convenience.</p>
      *
-     * @see #getType(ParameterDescriptorGroup)
+     * <p><b>CONVENTION:</b> Codes for SP1 case must be odd, and codes for SP2 case must be even.
+     *
+     * @see #getVariant(OperationMethod)
      */
-    private static final byte SP1  = 1,   SP2      = 2,
-                              WEST = 3,   BELGIUM  = 4,
-                                          MICHIGAN = 6;
+    private static final byte SP1  = 1,  WEST    = 3,                   // Must be odd
+                              SP2  = 2,  BELGIUM = 4,  MICHIGAN = 6;    // Must be even
+
+    /**
+     * Returns the type of the projection based on the name and identifier of the given operation method.
+     * If this method can not identify the type, then the parameters should be considered as a 2SP case.
+     */
+    private static byte getVariant(final OperationMethod method) {
+        if (identMatch(method, "(?i).*\\bBelgium\\b.*",  LambertConformalBelgium .IDENTIFIER)) return BELGIUM;
+        if (identMatch(method, "(?i).*\\bMichigan\\b.*", LambertConformalMichigan.IDENTIFIER)) return MICHIGAN;
+        if (identMatch(method, "(?i).*\\bWest\\b.*",     LambertConformalWest    .IDENTIFIER)) return WEST;
+        if (identMatch(method, "(?i).*\\b2SP\\b.*",      LambertConformal2SP     .IDENTIFIER)) return SP2;
+        if (identMatch(method, "(?i).*\\b1SP\\b.*",      LambertConformal1SP     .IDENTIFIER)) return SP1;
+        return 0; // Unidentified case, to be considered as 2SP.
+    }
 
     /**
      * Constant for the Belgium 2SP case. This is 29.2985 seconds, given here in radians.
@@ -91,17 +109,27 @@ public class LambertConformal extends Ab
      * Internal coefficients for computation, depending only on values of standards parallels.
      * This is defined as {@literal n = (ln m₁ – ln m₂) / (ln t₁ – ln t₂)} in §1.3.1.1 of
      * IOGP Publication 373-7-2 – Geomatics Guidance Note number 7, part 2 – April 2015.
+     *
+     * <p><b>Note:</b></p>
+     * <ul>
+     *   <li>If φ1 = -φ2, then the cone become a cylinder and this {@code n} value become 0.
+     *       This is limiting case is the Mercator projection, but we can not compare with this class
+     *       because {@code n=0} causes indetermination like 0 × ∞ in the equations of this class.</li>
+     *   <li>If φ1 = φ2 = ±90°, then this {@code n} value become ±1. The formulas in the transform and
+     *       inverse transform methods become basically the same than the ones in {@link PolarStereographic},
+     *       (de)normalization matrices contain NaN values.</li>
+     * </ul>
      */
     final double n;
 
     /**
-     * Returns the (<var>role</var> → <var>parameter</var>) associations for a Lambert projection of the given type.
+     * Returns the (<var>role</var> → <var>parameter</var>) associations for a Lambert projection of the given variant.
      *
-     * @param  type One of {@link #SP1}, {@link #SP2}, {@link #WEST}, {@link #BELGIUM} and {@link #MICHIGAN} constants.
+     * @param  variant One of {@link #SP1}, {@link #SP2}, {@link #WEST}, {@link #BELGIUM} and {@link #MICHIGAN} constants.
      * @return The roles map to give to super-class constructor.
      */
     @SuppressWarnings("fallthrough")
-    private static Map<ParameterRole, ParameterDescriptor<Double>> roles(final byte type) {
+    private static Map<ParameterRole, ParameterDescriptor<Double>> roles(final byte variant) {
         final EnumMap<ParameterRole, ParameterDescriptor<Double>> roles =
                 new EnumMap<ParameterRole, ParameterDescriptor<Double>>(ParameterRole.class);
         /*
@@ -110,7 +138,7 @@ public class LambertConformal extends Ab
          */
         ParameterDescriptor<Double> scaleFactor = LambertConformal1SP.SCALE_FACTOR;
         ParameterRole eastingDirection = ParameterRole.FALSE_EASTING;
-        switch (type) {
+        switch (variant) {
             case WEST: {
                 /*
                  * For "Lambert Conic Conformal (West Orientated)" projection, the "false easting" parameter is
@@ -122,7 +150,7 @@ public class LambertConformal extends Ab
             case SP1: {
                 roles.put(eastingDirection,               LambertConformal1SP.FALSE_EASTING);
                 roles.put(ParameterRole.FALSE_NORTHING,   LambertConformal1SP.FALSE_NORTHING);
-                roles.put(ParameterRole.CENTRAL_MERIDIAN, LambertConformal1SP.CENTRAL_MERIDIAN);
+                roles.put(ParameterRole.CENTRAL_MERIDIAN, LambertConformal1SP.LONGITUDE_OF_ORIGIN);
                 break;
             }
             case MICHIGAN: {
@@ -136,7 +164,7 @@ public class LambertConformal extends Ab
                 roles.put(ParameterRole.CENTRAL_MERIDIAN, LambertConformal2SP.LONGITUDE_OF_FALSE_ORIGIN);
                 break;
             }
-            default: throw new AssertionError(type);
+            default: throw new AssertionError(variant);
         }
         roles.put(ParameterRole.SCALE_FACTOR, scaleFactor);
         return roles;
@@ -158,7 +186,7 @@ public class LambertConformal extends Ab
      * @param parameters The parameter values of the projection to create.
      */
     public LambertConformal(final OperationMethod method, final Parameters parameters) {
-        this(method, parameters, getType(parameters.getDescriptor()));
+        this(method, parameters, getVariant(method));
     }
 
     /**
@@ -178,6 +206,11 @@ public class LambertConformal extends Ab
         double φ1 = getAndStore(parameters, LambertConformal2SP.STANDARD_PARALLEL_1, φ0);
         double φ2 = getAndStore(parameters, LambertConformal2SP.STANDARD_PARALLEL_2, φ1);
         if (abs(φ1 + φ2) < Formulas.ANGULAR_TOLERANCE) {
+            /*
+             * We can not allow that because if φ1 = -φ2, then n = 0 and the equations
+             * in this class break down with indetermination like 0 × ∞.
+             * The caller should use the Mercator projection instead for such cases.
+             */
             throw new IllegalArgumentException(Errors.format(Errors.Keys.LatitudesAreOpposite_2,
                     new Latitude(φ1), new Latitude(φ2)));
         }
@@ -247,13 +280,17 @@ public class LambertConformal extends Ab
             F.negate();
         }
         /*
-         * Compute  r = a⋅F⋅tⁿ  from EPSG notes where (in our case) a=1 and t is our 'expOfNorthing' function.
-         * Note that Snyder calls this term "ρ0".
+         * Compute the radius of the parallel of latitude of the false origin.
+         * This is related to the "ρ0" term in Snyder. From EPG guide:
+         *
+         *    r = a⋅F⋅tⁿ     where (in our case) a=1 and t is our 'expOfNorthing' function.
+         *
+         * EPSG uses this term in the computation of  y = FN + rF – r⋅cos(θ).
          */
-        final DoubleDouble r0 = new DoubleDouble();    // Initialized to zero.
+        final DoubleDouble rF = new DoubleDouble();    // Initialized to zero.
         if (φ0 != copySign(PI/2, -n)) {    // For avoiding the rounding error documented in expOfNorthing(+π/2).
-            r0.value = pow(expOfNorthing(φ0, excentricity*sin(φ0)), n);
-            r0.multiply(F);
+            rF.value = pow(expOfNorthing(φ0, excentricity*sin(φ0)), n);
+            rF.multiply(F);
         }
         /*
          * At this point, all parameters have been processed. Now store
@@ -281,7 +318,7 @@ public class LambertConformal extends Ab
         final MatrixSIS denormalize = context.getMatrix(false);
         denormalize.convertBefore(0, F, null);
         F.negate();
-        denormalize.convertBefore(1, F, r0);
+        denormalize.convertBefore(1, F, rF);
     }
 
     /**
@@ -293,16 +330,24 @@ public class LambertConformal extends Ab
     }
 
     /**
-     * Returns the type of the projection based on the name and identifier of the given parameter group.
-     * If this method can not identify the type, then the parameters should be considered as a 2SP case.
+     * Returns the sequence of <cite>normalization</cite> → {@code this} → <cite>denormalization</cite> transforms
+     * as a whole. The transform returned by this method except (<var>longitude</var>, <var>latitude</var>)
+     * coordinates in <em>degrees</em> and returns (<var>x</var>,<var>y</var>) coordinates in <em>metres</em>.
+     *
+     * <p>The non-linear part of the returned transform will be {@code this} transform, except if the ellipsoid
+     * is spherical. In the later case, {@code this} transform will be replaced by a simplified implementation.</p>
+     *
+     * @param  factory The factory to use for creating the transform.
+     * @return The map projection from (λ,φ) to (<var>x</var>,<var>y</var>) coordinates.
+     * @throws FactoryException if an error occurred while creating a transform.
      */
-    private static byte getType(final ParameterDescriptorGroup parameters) {
-        if (identMatch(parameters, "(?i).*\\bBelgium\\b.*",  LambertConformalBelgium .IDENTIFIER)) return BELGIUM;
-        if (identMatch(parameters, "(?i).*\\bMichigan\\b.*", LambertConformalMichigan.IDENTIFIER)) return MICHIGAN;
-        if (identMatch(parameters, "(?i).*\\bWest\\b.*",     LambertConformalWest    .IDENTIFIER)) return WEST;
-        if (identMatch(parameters, "(?i).*\\b2SP\\b.*",      LambertConformal2SP     .IDENTIFIER)) return SP2;
-        if (identMatch(parameters, "(?i).*\\b1SP\\b.*",      LambertConformal1SP     .IDENTIFIER)) return SP1;
-        return 0; // Unidentified case, to be considered as 2SP.
+    @Override
+    public MathTransform createMapProjection(final MathTransformFactory factory) throws FactoryException {
+        LambertConformal kernel = this;
+        if (excentricity == 0) {
+            kernel = new Spherical(this);
+        }
+        return context.completeTransform(factory, kernel);
     }
 
     /**
@@ -348,9 +393,8 @@ public class LambertConformal extends Ab
     }
 
     /**
-     * Converts the specified (θ,φ) coordinate (units in radians) and stores the result in {@code dstPts}
-     * (linear distance on a unit sphere). In addition, opportunistically computes the projection derivative
-     * if {@code derivate} is {@code true}.
+     * Converts the specified (θ,φ) coordinate (units in radians) and stores the result in {@code dstPts}.
+     * In addition, opportunistically computes the projection derivative if {@code derivate} is {@code true}.
      *
      * @return The matrix of the projection derivative at the given source position,
      *         or {@code null} if the {@code derivate} argument is {@code false}.
@@ -366,27 +410,27 @@ public class LambertConformal extends Ab
          * the first non-linear one moved to the "normalize" affine transform, and the linear operations
          * applied after the last non-linear one moved to the "denormalize" affine transform.
          */
-        final double θ    = srcPts[srcOff];         // θ = λ⋅n
-        final double φ    = srcPts[srcOff + 1];     // Sign may be reversed
+        final double θ    = srcPts[srcOff  ];     // θ = λ⋅n
+        final double φ    = srcPts[srcOff+1];     // Sign may be reversed
         final double absφ = abs(φ);
         final double sinθ = sin(θ);
         final double cosθ = cos(θ);
         final double sinφ;
-        final double r;     // From EPSG guide. Note that Snyder p. 108 calls this term "ρ".
+        final double ρ;     // EPSG guide uses "r", but we keep the symbol from Snyder p. 108 for consistency with PolarStereographic.
         if (absφ < PI/2) {
             sinφ = sin(φ);
-            r = pow(expOfNorthing(φ, excentricity*sinφ), n);
+            ρ = pow(expOfNorthing(φ, excentricity*sinφ), n);
         } else if (absφ < PI/2 + ANGULAR_TOLERANCE) {
             sinφ = 1;
-            r = (φ*n >= 0) ? POSITIVE_INFINITY : 0;
+            ρ = (φ*n >= 0) ? POSITIVE_INFINITY : 0;
         } else {
-            r = sinφ = NaN;
+            ρ = sinφ = NaN;
         }
-        final double x = r * sinθ;
-        final double y = r * cosθ;
+        final double x = ρ * sinθ;
+        final double y = ρ * cosθ;
         if (dstPts != null) {
-            dstPts[dstOff    ] = x;
-            dstPts[dstOff + 1] = y;
+            dstPts[dstOff  ] = x;
+            dstPts[dstOff+1] = y;
         }
         if (!derivate) {
             return null;
@@ -396,17 +440,16 @@ public class LambertConformal extends Ab
         //
         final double dρ;
         if (sinφ != 1) {
-            dρ = n * dy_dφ(sinφ, cos(φ)) * r;
+            dρ = n * dy_dφ(sinφ, cos(φ)) * ρ;
         } else {
-            dρ = r;
+            dρ = ρ;
         }
         return new Matrix2(y, dρ*sinθ,      // ∂x/∂λ , ∂x/∂φ
                           -x, dρ*cosθ);     // ∂y/∂λ , ∂y/∂φ
     }
 
     /**
-     * Transforms the specified (<var>x</var>,<var>y</var>) coordinates
-     * and stores the result in {@code dstPts} (angles in radians).
+     * Transforms the specified (<var>x</var>,<var>y</var>) coordinates and stores the (θ,φ) result in {@code dstPts}.
      *
      * @throws ProjectionException if the point can not be converted.
      */
@@ -415,15 +458,15 @@ public class LambertConformal extends Ab
                                     final double[] dstPts, final int dstOff)
             throws ProjectionException
     {
-        final double x = srcPts[srcOff    ];
-        final double y = srcPts[srcOff + 1];
+        final double x = srcPts[srcOff  ];
+        final double y = srcPts[srcOff+1];
         /*
          * NOTE: If some equation terms seem missing (e.g. "y = ρ0 - y"), this is because the linear operations
          * applied before the first non-linear one moved to the inverse of the "denormalize" transform, and the
          * linear operations applied after the last non-linear one moved to the inverse of the "normalize" transform.
          */
-        dstPts[dstOff  ] = atan2(x, y);  // Really (x,y), not (y,x)
-        dstPts[dstOff+1] = φ(pow(hypot(x, y), -1/n));
+        dstPts[dstOff  ] = atan2(x, y);                 // Really (x,y), not (y,x)
+        dstPts[dstOff+1] = -φ(pow(hypot(x, y), 1/n));   // Equivalent to φ(pow(hypot(x,y), -1/n)) but more accurate for n>0.
     }
 
 
@@ -478,40 +521,36 @@ public class LambertConformal extends Ab
                                 final double[] dstPts, final int dstOff,
                                 final boolean derivate) throws ProjectionException
         {
-            final double θ    = srcPts[srcOff];         // θ = λ⋅n
-            final double φ    = srcPts[srcOff + 1];     // Sign may be reversed
+            final double θ    = srcPts[srcOff  ];       // θ = λ⋅n
+            final double φ    = srcPts[srcOff+1];       // Sign may be reversed
             final double absφ = abs(φ);
             final double sinθ = sin(θ);
             final double cosθ = cos(θ);
-            final double r;   // Snyder p. 108 calls this term "ρ", but we use "r" for consistency with EPSG guide.
+            final double ρ;   // EPSG guide uses "r", but we keep the symbol from Snyder p. 108 for consistency with PolarStereographic.
             if (absφ < PI/2) {
-                r = pow(tan(PI/4 + 0.5*φ), n);
+                ρ = pow(tan(PI/4 + 0.5*φ), n);
             } else if (absφ < PI/2 + ANGULAR_TOLERANCE) {
-                r = (φ*n >= 0) ? POSITIVE_INFINITY : 0;
+                ρ = (φ*n >= 0) ? POSITIVE_INFINITY : 0;
             } else {
-                r = NaN;
+                ρ = NaN;
             }
-            final double x = r * sinθ;
-            final double y = r * cosθ;
-            Matrix derivative = null;
-            if (derivate) {
-                final double dρ;
-                if (absφ < PI/2) {
-                    dρ = n*r / cos(φ);
-                } else {
-                    dρ = NaN;
-                }
-                derivative = new Matrix2(y, dρ*sinθ,    // ∂x/∂λ , ∂x/∂φ
-                                        -x, dρ*cosθ);   // ∂y/∂λ , ∂y/∂φ
-            }
-            // Following part is common to all spherical projections: verify, store and return.
-            assert Assertions.checkDerivative(derivative, super.transform(srcPts, srcOff, dstPts, dstOff, derivate))
-                && Assertions.checkTransform(dstPts, dstOff, x, y);     // dstPts = result from ellipsoidal formulas.
+            final double x = ρ * sinθ;
+            final double y = ρ * cosθ;
             if (dstPts != null) {
-                dstPts[dstOff    ] = x;
-                dstPts[dstOff + 1] = y;
+                dstPts[dstOff  ] = x;
+                dstPts[dstOff+1] = y;
+            }
+            if (!derivate) {
+                return null;
+            }
+            final double dρ;
+            if (absφ < PI/2) {
+                dρ = n*ρ / cos(φ);
+            } else {
+                dρ = NaN;
             }
-            return derivative;
+            return new Matrix2(y, dρ*sinθ,    // ∂x/∂λ , ∂x/∂φ
+                              -x, dρ*cosθ);   // ∂y/∂λ , ∂y/∂φ
         }
 
         /**
@@ -525,24 +564,8 @@ public class LambertConformal extends Ab
             double x = srcPts[srcOff  ];
             double y = srcPts[srcOff+1];
             final double ρ = hypot(x, y);
-            x = atan2(x, y);  // Really (x,y), not (y,x)
-            y = 2*atan(pow(1/ρ, -1/n)) - PI/2;
-            assert checkInverseTransform(srcPts, srcOff, dstPts, dstOff, x, y);
-            dstPts[dstOff    ] = x;
-            dstPts[dstOff + 1] = y;
-        }
-
-        /**
-         * Computes using ellipsoidal formulas and compare with the
-         * result from spherical formulas. Used in assertions only.
-         */
-        private boolean checkInverseTransform(final double[] srcPts, final int srcOff,
-                                              final double[] dstPts, final int dstOff,
-                                              final double θ, final double φ)
-                throws ProjectionException
-        {
-            super.inverseTransform(srcPts, srcOff, dstPts, dstOff);
-            return Assertions.checkInverseTransform(dstPts, dstOff, θ, φ);
+            dstPts[dstOff  ] = atan2(x, y);  // Really (x,y), not (y,x);
+            dstPts[dstOff+1] = PI/2 - 2*atan(pow(1/ρ, 1/n));
         }
     }
 



Mime
View raw message