sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1802073 [1/2] - in /sis/branches/JDK7: ./ core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/ core/sis-referencing/src/main/java/org/apache/sis/internal/re...
Date Sun, 16 Jul 2017 15:39:07 GMT
Author: desruisseaux
Date: Sun Jul 16 15:39:06 2017
New Revision: 1802073

URL: http://svn.apache.org/viewvc?rev=1802073&view=rev
Log:
Merge from JDK8 branch the SIS-364 fix and the work on the optional Proj.4 bridge.

Added:
    sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4Factory.java
      - copied, changed from r1802070, sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4Factory.java
    sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4Parser.java
      - copied unchanged from r1802070, sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4Parser.java
    sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Transform.java
      - copied unchanged from r1802070, sis/branches/JDK8/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Transform.java
    sis/branches/JDK7/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/Proj4FactoryTest.java
      - copied unchanged from r1802070, sis/branches/JDK8/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/Proj4FactoryTest.java
    sis/branches/JDK7/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/Proj4ParserTest.java
      - copied unchanged from r1802070, sis/branches/JDK8/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/Proj4ParserTest.java
    sis/branches/JDK7/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/Proj4Test.java
      - copied unchanged from r1802070, sis/branches/JDK8/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/Proj4Test.java
Removed:
    sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Axis.java
    sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/CRS.java
    sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/EPSGFactory.java
    sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Operation.java
    sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/OperationFactory.java
    sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/PJObject.java
    sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Parameter.java
    sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/ParameterGroup.java
    sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/ReferencingFactory.java
    sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/ResourcesLoader.java
    sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/TransformFactory.java
    sis/branches/JDK7/storage/sis-gdal/src/main/resources/org/
    sis/branches/JDK7/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/EPSGFactoryTest.java
Modified:
    sis/branches/JDK7/   (props changed)
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbridgedMolodensky.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/CoordinateFrameRotation3D.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/FranceGeocentricInterpolation.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricAffineBetweenGeographic.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricToGeographic.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricTranslation3D.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicToGeocentric.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LongitudeRotation.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MolodenskyInterpolation.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PositionVector7Param3D.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationFinderTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationRegistryTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactoryTest.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/OS.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/util/Constants.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
    sis/branches/JDK7/ide-project/NetBeans/build.xml
    sis/branches/JDK7/storage/sis-gdal/pom.xml
    sis/branches/JDK7/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.c
    sis/branches/JDK7/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.h
    sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/PJ.java
    sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4.java
    sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/package-info.java
    sis/branches/JDK7/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/PJTest.java
    sis/branches/JDK7/storage/sis-gdal/src/test/java/org/apache/sis/test/suite/GDALTestSuite.java

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jul 16 15:39:06 2017
@@ -1,5 +1,5 @@
 /sis/branches/Android:1430670-1480699
 /sis/branches/JDK6:1394913-1508480
-/sis/branches/JDK8:1584960-1801831
+/sis/branches/JDK8:1584960-1802070
 /sis/branches/JDK9:1773327-1789983
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/AxisDirections.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -247,6 +247,21 @@ public final class AxisDirections extend
     }
 
     /**
+     * Returns {@code true} if the specified direction is cardinal direction.
+     * Cardinal directions are {@code NORTH}, {@code SOUTH}, {@code EAST} and {@code WEST}.
+     *
+     * @param  dir  the direction to test, or {@code null}.
+     * @return {@code true} if the given direction is a cardinal direction.
+     *
+     * @since 0.8
+     */
+    public static boolean isCardinal(final AxisDirection dir) {
+        if (dir == null) return false;
+        final int n  = dir.ordinal() - NORTH.ordinal();
+        return n >= 0 && n < COMPASS_COUNT && (n & 3) == 0;
+    }
+
+    /**
      * Returns {@code true} if the specified direction is an inter-cardinal direction.
      * Inter-cardinal directions are {@code NORTH_EAST}, {@code SOUTH_SOUTH_EAST}, etc.
      *

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/ServicesForUtility.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -174,7 +174,7 @@ public final class ServicesForUtility ex
                 alternateTitle = key;
                 break;
             }
-            case "Proj4": {
+            case Constants.PROJ4: {
                 title = "Proj.4";
                 break;
             }

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -361,7 +361,7 @@ public final class Citations extends Sta
      *
      * @since 0.4
      */
-    public static final IdentifierSpace<String> PROJ4 = new CitationConstant.Authority<>("Proj4");
+    public static final IdentifierSpace<String> PROJ4 = new CitationConstant.Authority<>(Constants.PROJ4);
 
     /**
      * The authority for identifiers of objects defined by MapInfo.

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbridgedMolodensky.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbridgedMolodensky.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbridgedMolodensky.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbridgedMolodensky.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -70,7 +70,6 @@ public final class AbridgedMolodensky ex
     /**
      * Constructs a new provider.
      */
-    @SuppressWarnings("ThisEscapedInObjectConstruction")
     public AbridgedMolodensky() {
         this(3, 3, new AbridgedMolodensky[4]);
         redimensioned[0] = new AbridgedMolodensky(2, 2, redimensioned);

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -122,7 +122,6 @@ 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/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/CoordinateFrameRotation3D.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/CoordinateFrameRotation3D.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/CoordinateFrameRotation3D.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/CoordinateFrameRotation3D.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -56,7 +56,6 @@ public final class CoordinateFrameRotati
     /**
      * Constructs the provider.
      */
-    @SuppressWarnings("ThisEscapedInObjectConstruction")
     public CoordinateFrameRotation3D() {
         this(3, 3, new GeocentricAffineBetweenGeographic[4]);
         redimensioned[0] = new CoordinateFrameRotation2D(      redimensioned);

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/FranceGeocentricInterpolation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/FranceGeocentricInterpolation.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/FranceGeocentricInterpolation.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/FranceGeocentricInterpolation.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -169,7 +169,6 @@ public class FranceGeocentricInterpolati
     /**
      * Constructs a provider.
      */
-    @SuppressWarnings("ThisEscapedInObjectConstruction")
     public FranceGeocentricInterpolation() {
         this(2, 2, PARAMETERS, new FranceGeocentricInterpolation[4]);
         redimensioned[0] = this;

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricAffineBetweenGeographic.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricAffineBetweenGeographic.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricAffineBetweenGeographic.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricAffineBetweenGeographic.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -62,6 +62,8 @@ public abstract class GeocentricAffineBe
      * Furthermore it would not solve the case where the number of input dimensions is different than the number of
      * output dimensions. We can not afford to have wrong default values since it would confuse our interpretation
      * of user's parameters in {@link #createMathTransform(MathTransformFactory, ParameterValueGroup)}.</p>
+     *
+     * @see GeographicToGeocentric#DIMENSION
      */
     public static final ParameterDescriptor<Integer> DIMENSION;
 

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricToGeographic.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricToGeographic.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricToGeographic.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricToGeographic.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -24,6 +24,7 @@ import org.opengis.referencing.operation
 import org.opengis.referencing.operation.NoninvertibleTransformException;
 import org.opengis.util.FactoryException;
 import org.apache.sis.metadata.iso.citation.Citations;
+import org.apache.sis.parameter.Parameters;
 
 
 /**
@@ -31,14 +32,14 @@ import org.apache.sis.metadata.iso.citat
  * This provider creates transforms from geocentric to geographic coordinate reference systems.
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
- * @version 0.7
+ * @version 0.8
  *
  * @see GeographicToGeocentric
  *
  * @since 0.7
  * @module
  */
-public final class GeocentricToGeographic extends AbstractProvider {
+public final class GeocentricToGeographic extends GeodeticOperation {
     /**
      * Serial number for inter-operability with different versions.
      */
@@ -47,7 +48,7 @@ public final class GeocentricToGeographi
     /**
      * The OGC name used for this operation method.
      */
-    static final String NAME = "Geocentric_To_Ellipsoid";
+    public static final String NAME = "Geocentric_To_Ellipsoid";
 
     /**
      * The group of all parameters expected by this coordinate operation.
@@ -56,7 +57,7 @@ public final class GeocentricToGeographi
     static {
         PARAMETERS = builder()
                 .addName(Citations.OGC, NAME)
-                .createGroupForMapProjection();
+                .createGroupForMapProjection(GeographicToGeocentric.DIMENSION);
                 // Not really a map projection, but we leverage the same axis parameters.
     }
 
@@ -64,7 +65,19 @@ public final class GeocentricToGeographi
      * Constructs a provider for the 3-dimensional case.
      */
     public GeocentricToGeographic() {
-        super(3, 3, PARAMETERS);
+        this(3, new GeocentricToGeographic[4]);
+        redimensioned[2] = new GeocentricToGeographic(2, redimensioned);
+        redimensioned[3] = this;
+    }
+
+    /**
+     * Constructs a provider for the given dimensions.
+     *
+     * @param targetDimensions  number of dimensions in the target CRS of this operation method.
+     * @param redimensioned     providers for all combinations between 2D and 3D cases.
+     */
+    private GeocentricToGeographic(int targetDimensions, GeodeticOperation[] redimensioned) {
+        super(3, targetDimensions, PARAMETERS, redimensioned);
     }
 
     /**
@@ -89,6 +102,16 @@ public final class GeocentricToGeographi
     }
 
     /**
+     * Specifies that the inverse of this operation is a different kind of operation.
+     *
+     * @return {@code false}.
+     */
+    @Override
+    public boolean isInvertible() {
+        return false;
+    }
+
+    /**
      * Creates a transform from the specified group of parameter values.
      *
      * @param  factory  the factory to use for creating the transform.
@@ -100,7 +123,7 @@ public final class GeocentricToGeographi
     public MathTransform createMathTransform(final MathTransformFactory factory, final ParameterValueGroup values)
             throws FactoryException
     {
-        MathTransform tr = GeographicToGeocentric.create(factory, values);
+        MathTransform tr = GeographicToGeocentric.create(factory, Parameters.castOrWrap(values));
         try {
             tr = tr.inverse();
         } catch (NoninvertibleTransformException e) {

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricTranslation3D.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricTranslation3D.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricTranslation3D.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricTranslation3D.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -51,7 +51,6 @@ public final class GeocentricTranslation
     /**
      * Constructs the provider.
      */
-    @SuppressWarnings("ThisEscapedInObjectConstruction")
     public GeocentricTranslation3D() {
         this(3, 3, new GeocentricAffineBetweenGeographic[4]);
         redimensioned[0] = new GeocentricTranslation2D(      redimensioned);

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicOffsets.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -77,7 +77,6 @@ public class GeographicOffsets extends G
     /**
      * Constructs a provider with default parameters.
      */
-    @SuppressWarnings("ThisEscapedInObjectConstruction")
     public GeographicOffsets() {
         super(3, 3, PARAMETERS, new GeographicOffsets[4]);
         redimensioned[0] = new GeographicOffsets2D(redimensioned);

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicToGeocentric.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicToGeocentric.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicToGeocentric.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeographicToGeocentric.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -19,9 +19,10 @@ package org.apache.sis.internal.referenc
 import javax.measure.Unit;
 import javax.measure.quantity.Length;
 import org.opengis.util.FactoryException;
+import org.opengis.parameter.ParameterValue;
 import org.opengis.parameter.ParameterValueGroup;
+import org.opengis.parameter.ParameterDescriptor;
 import org.opengis.parameter.ParameterDescriptorGroup;
-import org.opengis.parameter.ParameterValue;
 import org.opengis.referencing.cs.CartesianCS;
 import org.opengis.referencing.cs.EllipsoidalCS;
 import org.opengis.referencing.operation.Conversion;
@@ -30,6 +31,8 @@ import org.opengis.referencing.operation
 import org.apache.sis.referencing.operation.transform.EllipsoidToCentricTransform;
 import org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory;
 import org.apache.sis.metadata.iso.citation.Citations;
+import org.apache.sis.parameter.ParameterBuilder;
+import org.apache.sis.parameter.Parameters;
 import org.apache.sis.internal.util.Constants;
 
 
@@ -45,28 +48,43 @@ import org.apache.sis.internal.util.Cons
  * @since 0.7
  * @module
  */
-public final class GeographicToGeocentric extends AbstractProvider {
+public final class GeographicToGeocentric extends GeodeticOperation {
     /**
      * Serial number for inter-operability with different versions.
      */
     private static final long serialVersionUID = -5690807111952562344L;
 
     /**
-     * The OGC name used for this operation method. The OGC name is preferred to the EPSG name
-     * because it allows to distinguish between the forward and the inverse conversion.
+     * The OGC name used for this operation method. The OGC name is preferred to the EPSG name in Apache SIS
+     * implementation because it allows to distinguish between the forward and the inverse conversion.
      */
-    static final String NAME = "Ellipsoid_To_Geocentric";
+    public static final String NAME = "Ellipsoid_To_Geocentric";
+
+    /**
+     * An Apache SIS specific parameter for the number of dimensions (2 or 3).
+     * This parameter is practically the same than {@link GeocentricAffineBetweenGeographic#DIMENSION} except:
+     *
+     * <ul>
+     *   <li>The code space is {@code "SIS"} instead than {@code "OGC"} since this parameter is not defined in OGC 01-009.</li>
+     *   <li>The default number of dimensions is 3 instead of unspecified.</li>
+     * </ul>
+     *
+     * @see GeocentricAffineBetweenGeographic#DIMENSION
+     */
+    public static final ParameterDescriptor<Integer> DIMENSION;
 
     /**
      * The group of all parameters expected by this coordinate operation.
      */
     public static final ParameterDescriptorGroup PARAMETERS;
     static {
-        PARAMETERS = builder()
+        final ParameterBuilder builder = builder();
+        DIMENSION = builder.addName(Citations.SIS, "dim").setRequired(false).createBounded(Integer.class, 2, 3, 3);
+        PARAMETERS = builder
                 .addIdentifier("9602")
                 .addName("Geographic/geocentric conversions")
                 .addName(Citations.OGC, NAME)
-                .createGroupForMapProjection();
+                .createGroupForMapProjection(DIMENSION);
                 // Not really a map projection, but we leverage the same axis parameters.
     }
 
@@ -74,7 +92,19 @@ public final class GeographicToGeocentri
      * Constructs a provider for the 3-dimensional case.
      */
     public GeographicToGeocentric() {
-        super(3, 3, PARAMETERS);
+        this(3, new GeographicToGeocentric[4]);
+        redimensioned[1] = new GeographicToGeocentric(2, redimensioned);
+        redimensioned[3] = this;
+    }
+
+    /**
+     * Constructs a provider for the given dimensions.
+     *
+     * @param sourceDimensions  number of dimensions in the source CRS of this operation method.
+     * @param redimensioned     providers for all combinations between 2D and 3D cases.
+     */
+    private GeographicToGeocentric(int sourceDimensions, GeodeticOperation[] redimensioned) {
+        super(sourceDimensions, 3, PARAMETERS, redimensioned);
     }
 
     /**
@@ -121,6 +151,16 @@ public final class GeographicToGeocentri
     }
 
     /**
+     * Specifies that the inverse of this operation is a different kind of operation.
+     *
+     * @return {@code false}.
+     */
+    @Override
+    public boolean isInvertible() {
+        return false;
+    }
+
+    /**
      * Creates a transform from the specified group of parameter values.
      *
      * @param  factory  the factory to use for creating the transform.
@@ -132,20 +172,20 @@ public final class GeographicToGeocentri
     public MathTransform createMathTransform(final MathTransformFactory factory, final ParameterValueGroup values)
             throws FactoryException
     {
-        return create(factory, values);
+        return create(factory, Parameters.castOrWrap(values));
     }
 
     /**
      * Implementation of {@link #createMathTransform(MathTransformFactory, ParameterValueGroup)}
      * shared with {@link GeocentricToGeographic}.
      */
-    static MathTransform create(final MathTransformFactory factory, final ParameterValueGroup values)
+    static MathTransform create(final MathTransformFactory factory, final Parameters values)
             throws FactoryException
     {
         final ParameterValue<?> semiMajor = values.parameter(Constants.SEMI_MAJOR);
         final Unit<Length> unit = semiMajor.getUnit().asType(Length.class);
         return EllipsoidToCentricTransform.createGeodeticConversion(factory, semiMajor.doubleValue(),
-                values.parameter(Constants.SEMI_MINOR).doubleValue(unit), unit, true,
+                values.parameter(Constants.SEMI_MINOR).doubleValue(unit), unit, values.intValue(DIMENSION) >= 3,
                 EllipsoidToCentricTransform.TargetType.CARTESIAN);
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LongitudeRotation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LongitudeRotation.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LongitudeRotation.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LongitudeRotation.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -65,7 +65,6 @@ public final class LongitudeRotation ext
     /**
      * Constructs a provider with default parameters.
      */
-    @SuppressWarnings("ThisEscapedInObjectConstruction")
     public LongitudeRotation() {
         this(2, 2, new LongitudeRotation[4]);
         redimensioned[0] = this;

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -133,7 +133,6 @@ public final class Molodensky extends Ge
     /**
      * Constructs a new provider.
      */
-    @SuppressWarnings("ThisEscapedInObjectConstruction")
     public Molodensky() {
         this(3, 3, new Molodensky[4]);
         redimensioned[0] = new Molodensky(2, 2, redimensioned);

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MolodenskyInterpolation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MolodenskyInterpolation.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MolodenskyInterpolation.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MolodenskyInterpolation.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -54,7 +54,6 @@ public final class MolodenskyInterpolati
     /**
      * Constructs a provider.
      */
-    @SuppressWarnings("ThisEscapedInObjectConstruction")
     public MolodenskyInterpolation() {
         super(2, 2, builder().setCodeSpace(null, Constants.SIS).addName("Molodensky interpolation")
                         .createGroupWithSameParameters(PARAMETERS), new MolodenskyInterpolation[4]);

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PositionVector7Param3D.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PositionVector7Param3D.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PositionVector7Param3D.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PositionVector7Param3D.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -54,7 +54,6 @@ public final class PositionVector7Param3
     /**
      * Constructs the provider.
      */
-    @SuppressWarnings("ThisEscapedInObjectConstruction")
     public PositionVector7Param3D() {
         this(3, 3, new GeocentricAffineBetweenGeographic[4]);
         redimensioned[0] = new PositionVector7Param2D(      redimensioned);

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -687,7 +687,8 @@ public class ParameterFormat extends Tab
                 /*
                  * Writes the values, each on its own line, together with their unit of measurement.
                  */
-                table.setCellAlignment(TableAppender.ALIGN_RIGHT);
+                final byte alignment = Number.class.isAssignableFrom(valueClass) ? TableAppender.ALIGN_RIGHT : TableAppender.ALIGN_LEFT;
+                table.setCellAlignment(alignment);
                 final int length = row.values.size();
                 for (int i=0; i<length; i++) {
                     Object value = row.values.get(i);
@@ -705,7 +706,7 @@ public class ParameterFormat extends Tab
                                 table.append(ditto);
                                 nextColumn(table);
                             }
-                            table.setCellAlignment(TableAppender.ALIGN_RIGHT);
+                            table.setCellAlignment(alignment);
                         }
                         /*
                          * Format the value followed by the unit of measure, or followed by spaces if there is no unit

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/factory/GeodeticAuthorityFactory.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -63,7 +63,7 @@ import org.apache.sis.util.Debug;
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Johann Sorel (Geomatys)
- * @version 0.7
+ * @version 0.8
  * @since   0.7
  * @module
  */
@@ -1237,8 +1237,10 @@ public abstract class GeodeticAuthorityF
      * @param  code  the code to trim.
      * @return the code with the namespace part removed if that part matched one of the values given by
      *         {@link #getCodeSpaces()}.
+     *
+     * @since 0.8
      */
-    final String trimNamespace(final String code) {
+    protected final String trimNamespace(final String code) {
         int s = code.indexOf(DefaultNameSpace.DEFAULT_SEPARATOR);
         if (s >= 0) {
             final int end   = CharSequences.skipTrailingWhitespaces(code, 0, s);

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationFinder.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -118,8 +118,8 @@ public class CoordinateOperationFinder e
      * The accuracy threshold (in metres) for allowing the use of Molodensky approximation instead than the
      * Geocentric Translation method. The accuracy of datum shifts with Molodensky approximation is about 5
      * or 10 metres. However for this constant, we are not interested in absolute accuracy but rather in the
-     * difference between Molodensky and Geocentric Translation methods, which is much lower. We nevertheless
-     * use a relatively high threshold as a conservative approach.
+     * difference between Molodensky and Geocentric Translation methods, which is much lower (less than 1 m).
+     * We nevertheless use a relatively high threshold as a conservative approach.
      *
      * @see #desiredAccuracy
      */
@@ -501,8 +501,8 @@ public class CoordinateOperationFinder e
             if (parameters == null) {
                 parameters = TensorParameters.WKT1.createValueGroup(properties(Constants.AFFINE), datumShift);
                 final CoordinateSystem normalized = CommonCRS.WGS84.geocentric().getCoordinateSystem();
-                before = mtFactory.createCoordinateSystemChange(sourceCS, normalized);
-                after  = mtFactory.createCoordinateSystemChange(normalized, targetCS);
+                before = mtFactory.createCoordinateSystemChange(sourceCS, normalized, sourceDatum.getEllipsoid());
+                after  = mtFactory.createCoordinateSystemChange(normalized, targetCS, targetDatum.getEllipsoid());
                 context.setSource(normalized);
                 context.setTarget(normalized);
             }
@@ -522,7 +522,13 @@ public class CoordinateOperationFinder e
                 parameters = TensorParameters.WKT1.createValueGroup(properties(Constants.AFFINE));      // Initialized to identity.
                 parameters.parameter(Constants.NUM_COL).setValue(targetDim + 1);
                 parameters.parameter(Constants.NUM_ROW).setValue(targetDim + 1);
-                before = mtFactory.createCoordinateSystemChange(sourceCS, targetCS);
+                /*
+                 * createCoordinateSystemChange(…) needs the ellipsoid associated to the ellipsoidal coordinate system,
+                 * if any. If none or both coordinate systems are ellipsoidal, then the ellipsoid will be ignored (see
+                 * createCoordinateSystemChange(…) javadoc for the rational) so it does not matter which one we pick.
+                 */
+                before = mtFactory.createCoordinateSystemChange(sourceCS, targetCS,
+                        (sourceCS instanceof EllipsoidalCS ? sourceDatum : targetDatum).getEllipsoid());
                 context.setSource(targetCS);
             }
         }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/TransverseMercator.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -628,7 +628,7 @@ public class TransverseMercator extends
             final double tanφ = sinφ / cosφ;
             final double B    = cosφ * sinλ;
             /*
-             * Using Snyder's equation for calculating y, instead of the one used in Proj4.
+             * Using Snyder's equation for calculating y, instead of the one used in Proj.4.
              * Potential problems when y and x = 90 degrees, but behaves ok in tests.
              */
             if (dstPts != null) {

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -42,6 +42,7 @@ import org.opengis.parameter.InvalidPara
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
 import org.opengis.referencing.cs.CoordinateSystem;
 import org.opengis.referencing.cs.EllipsoidalCS;
+import org.opengis.referencing.cs.CartesianCS;
 import org.opengis.referencing.datum.Ellipsoid;
 import org.opengis.referencing.operation.Matrix;
 import org.opengis.referencing.operation.MathTransform;
@@ -61,6 +62,8 @@ import org.apache.sis.internal.referenci
 import org.apache.sis.internal.referencing.provider.AbstractProvider;
 import org.apache.sis.internal.referencing.provider.VerticalOffset;
 import org.apache.sis.internal.referencing.provider.Providers;
+import org.apache.sis.internal.referencing.provider.GeographicToGeocentric;
+import org.apache.sis.internal.referencing.provider.GeocentricToGeographic;
 import org.apache.sis.internal.referencing.Resources;
 import org.apache.sis.internal.system.Loggers;
 import org.apache.sis.metadata.iso.citation.Citations;
@@ -1210,13 +1213,71 @@ public class DefaultMathTransformFactory
      * @return a conversion from the given source to the given target coordinate system.
      * @throws FactoryException if the conversion can not be created.
      *
+     * @deprecated Replaced by {@link #createCoordinateSystemChange(CoordinateSystem, CoordinateSystem, Ellipsoid)}
+     *
      * @since 0.7
      */
+    @Deprecated
     public MathTransform createCoordinateSystemChange(final CoordinateSystem source, final CoordinateSystem target)
             throws FactoryException
     {
+        return createCoordinateSystemChange(source, target, null);
+    }
+
+    /**
+     * Creates a math transform that represent a change of coordinate system. If exactly one argument is
+     * an {@linkplain org.apache.sis.referencing.cs.DefaultEllipsoidalCS ellipsoidal coordinate systems},
+     * then the {@code ellipsoid} argument is mandatory. In all other cases (including the case where both
+     * coordinate systems are ellipsoidal), the ellipsoid argument is ignored and can be {@code null}.
+     *
+     * <div class="note"><b>Design note:</b>
+     * this method does not accept separated ellipsoid arguments for {@code source} and {@code target} because
+     * this method should not be used for datum shifts. If the two given coordinate systems are ellipsoidal,
+     * then they are assumed to use the same ellipsoid. If different ellipsoids are desired, then a
+     * {@linkplain #createParameterizedTransform parameterized transform} like <cite>"Molodensky"</cite>,
+     * <cite>"Geocentric translations"</cite>, <cite>"Coordinate Frame Rotation"</cite> or
+     * <cite>"Position Vector transformation"</cite> should be used instead.</div>
+     *
+     * @param  source     the source coordinate system.
+     * @param  target     the target coordinate system.
+     * @param  ellipsoid  the ellipsoid of {@code EllipsoidalCS}, or {@code null} if none.
+     * @return a conversion from the given source to the given target coordinate system.
+     * @throws FactoryException if the conversion can not be created.
+     *
+     * @since 0.8
+     */
+    public MathTransform createCoordinateSystemChange(final CoordinateSystem source, final CoordinateSystem target,
+            final Ellipsoid ellipsoid) throws FactoryException
+    {
         ArgumentChecks.ensureNonNull("source", source);
         ArgumentChecks.ensureNonNull("target", target);
+        if (ellipsoid != null) {
+            final boolean isEllipsoidalSource = (source instanceof EllipsoidalCS);
+            if (isEllipsoidalSource != (target instanceof EllipsoidalCS)) {
+                /*
+                 * For now we support only conversion between EllipsoidalCS and CartesianCS.
+                 * But future Apache SIS versions could add support for conversions between
+                 * EllipsoidalCS and SphericalCS or other coordinate systems.
+                 */
+                if ((isEllipsoidalSource ? target : source) instanceof CartesianCS) {
+                    final Context context = new Context();
+                    final EllipsoidalCS cs;
+                    final String operation;
+                    if (isEllipsoidalSource) {
+                        operation = GeographicToGeocentric.NAME;
+                        context.setSource(cs = (EllipsoidalCS) source, ellipsoid);
+                        context.setTarget(target);
+                    } else {
+                        operation = GeocentricToGeographic.NAME;
+                        context.setSource(source);
+                        context.setTarget(cs = (EllipsoidalCS) target, ellipsoid);
+                    }
+                    final ParameterValueGroup pg = getDefaultParameters(operation);
+                    if (cs.getDimension() < 3) pg.parameter("dim").setValue(2);       // Apache SIS specific parameter.
+                    return createParameterizedTransform(pg, context);
+                }
+            }
+        }
         return CoordinateSystemTransform.create(this, source, target);
         // No need to use unique(…) here.
     }

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/internal/metadata/AxisDirectionsTest.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -110,6 +110,34 @@ public final strictfp class AxisDirectio
     }
 
     /**
+     * Tests {@link AxisDirections#isCardinal(AxisDirection)}.
+     *
+     * @since 0.8
+     */
+    @Test
+    public void testIsCardinal() {
+        assertTrue (AxisDirections.isCardinal(NORTH));
+        assertFalse(AxisDirections.isCardinal(NORTH_NORTH_EAST));
+        assertFalse(AxisDirections.isCardinal(NORTH_EAST));
+        assertFalse(AxisDirections.isCardinal(EAST_NORTH_EAST));
+        assertTrue (AxisDirections.isCardinal(EAST));
+        assertFalse(AxisDirections.isCardinal(EAST_SOUTH_EAST));
+        assertFalse(AxisDirections.isCardinal(SOUTH_EAST));
+        assertFalse(AxisDirections.isCardinal(SOUTH_SOUTH_EAST));
+        assertTrue (AxisDirections.isCardinal(SOUTH));
+        assertFalse(AxisDirections.isCardinal(SOUTH_SOUTH_WEST));
+        assertFalse(AxisDirections.isCardinal(SOUTH_WEST));
+        assertFalse(AxisDirections.isCardinal(WEST_SOUTH_WEST));
+        assertTrue (AxisDirections.isCardinal(WEST));
+        assertFalse(AxisDirections.isCardinal(WEST_NORTH_WEST));
+        assertFalse(AxisDirections.isCardinal(NORTH_WEST));
+        assertFalse(AxisDirections.isCardinal(NORTH_NORTH_WEST));
+        assertFalse(AxisDirections.isCardinal(UP));
+        assertFalse(AxisDirections.isCardinal(FUTURE));
+        assertFalse(AxisDirections.isCardinal(OTHER));
+    }
+
+    /**
      * Tests {@link AxisDirections#isIntercardinal(AxisDirection)}.
      */
     @Test

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationFinderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationFinderTest.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationFinderTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationFinderTest.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -67,6 +67,7 @@ import static org.apache.sis.test.Assert
 
 /**
  * Tests {@link CoordinateOperationFinder}.
+ * Contrarily to {@link CoordinateOperationRegistryTest}, tests in this class are run without EPSG geodetic dataset.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @version 0.8
@@ -103,7 +104,7 @@ public final strictfp class CoordinateOp
     /**
      * The instance on which to execute the tests.
      */
-    private CoordinateOperationFinder inference;
+    private CoordinateOperationFinder finder;
 
     /**
      * Creates a new test case.
@@ -111,7 +112,7 @@ public final strictfp class CoordinateOp
      * @throws FactoryException if an error occurred while initializing the finder to test.
      */
     public CoordinateOperationFinderTest() throws FactoryException {
-        inference = new CoordinateOperationFinder(null, factory, null);
+        finder = new CoordinateOperationFinder(null, factory, null);
     }
 
     /**
@@ -184,13 +185,13 @@ public final strictfp class CoordinateOp
      * Implementation of {@link #testIdentityTransform()} using the given CRS.
      */
     private void testIdentityTransform(final CoordinateReferenceSystem crs) throws FactoryException {
-        final CoordinateOperation operation = inference.createOperation(crs, crs);
+        final CoordinateOperation operation = finder.createOperation(crs, crs);
         assertSame      ("sourceCRS",  crs, operation.getSourceCRS());
         assertSame      ("targetCRS",  crs, operation.getTargetCRS());
         assertTrue      ("isIdentity", operation.getMathTransform().isIdentity());
         assertTrue      ("accuracy",   operation.getCoordinateOperationAccuracy().isEmpty());
         assertInstanceOf("operation",  Conversion.class, operation);
-        inference = new CoordinateOperationFinder(null, factory, null);        // Reset for next call.
+        finder = new CoordinateOperationFinder(null, factory, null);        // Reset for next call.
     }
 
     /**
@@ -265,7 +266,7 @@ public final strictfp class CoordinateOp
             final GeographicCRS sourceCRS, final GeographicCRS targetCRS)
             throws ParseException, FactoryException, TransformException
     {
-        final CoordinateOperation operation = inference.createOperation(sourceCRS, targetCRS);
+        final CoordinateOperation operation = finder.createOperation(sourceCRS, targetCRS);
         assertSame      ("sourceCRS",  sourceCRS,            operation.getSourceCRS());
         assertSame      ("targetCRS",  targetCRS,            operation.getTargetCRS());
         assertFalse     ("isIdentity",                       operation.getMathTransform().isIdentity());
@@ -325,7 +326,7 @@ public final strictfp class CoordinateOp
                 "  Id[“EPSG”, “4807”]]");
 
         final GeographicCRS       targetCRS = CommonCRS.WGS84.geographic();
-        final CoordinateOperation operation = inference.createOperation(sourceCRS, targetCRS);
+        final CoordinateOperation operation = finder.createOperation(sourceCRS, targetCRS);
 
         assertSame      ("sourceCRS",  sourceCRS,            operation.getSourceCRS());
         assertSame      ("targetCRS",  targetCRS,            operation.getTargetCRS());
@@ -371,7 +372,7 @@ public final strictfp class CoordinateOp
                 "    Unit[“kilometre”, 1000]]");
 
         final GeocentricCRS       targetCRS = CommonCRS.WGS84.geocentric();
-        final CoordinateOperation operation = inference.createOperation(sourceCRS, targetCRS);
+        final CoordinateOperation operation = finder.createOperation(sourceCRS, targetCRS);
 
         assertSame      ("sourceCRS",  sourceCRS,            operation.getSourceCRS());
         assertSame      ("targetCRS",  targetCRS,            operation.getTargetCRS());
@@ -425,7 +426,7 @@ public final strictfp class CoordinateOp
                 "    Axis[“y”, NORTH],\n" +
                 "    Unit[“US survey foot”, 0.304800609601219]]");
 
-        final CoordinateOperation operation = inference.createOperation(sourceCRS, targetCRS);
+        final CoordinateOperation operation = finder.createOperation(sourceCRS, targetCRS);
         assertSame      ("sourceCRS", sourceCRS,        operation.getSourceCRS());
         assertSame      ("targetCRS", targetCRS,        operation.getTargetCRS());
         assertEquals    ("name",      "TM",             operation.getName().getCode());
@@ -453,6 +454,72 @@ public final strictfp class CoordinateOp
     }
 
     /**
+     * Tests a datum shift applied as a position vector transformation in geocentric domain.
+     * This test does not use the the EPSG geodetic dataset.
+     *
+     * @throws ParseException if a CRS used in this test can not be parsed.
+     * @throws FactoryException if the operation can not be created.
+     * @throws TransformException if an error occurred while converting the test points.
+     *
+     * @see DefaultCoordinateOperationFactoryTest#testPositionVectorTransformation()
+     * @see <a href="https://issues.apache.org/jira/browse/SIS-364">SIS-364</a>
+     *
+     * @since 0.8
+     */
+    @Test
+    @DependsOnMethod("testGeographicToProjected")
+    public void testPositionVectorTransformation() throws ParseException, FactoryException, TransformException {
+        final CoordinateReferenceSystem sourceCRS = CommonCRS.WGS84.geographic();
+        final CoordinateReferenceSystem targetCRS = parse(AGD66());
+        final CoordinateOperation operation = finder.createOperation(sourceCRS, targetCRS);
+        transform  = operation.getMathTransform();
+        tolerance  = LINEAR_TOLERANCE;
+        λDimension = new int[] {0};
+        verifyTransform(expectedAGD66(true), expectedAGD66(false));
+        validate();
+    }
+
+    /**
+     * Returns test coordinates for a transformation between {@link #AGD66()} and WGS84.
+     * We use this method for ensuring that {@link #testPositionVectorTransformation()}
+     * and {@link DefaultCoordinateOperationFactoryTest#testPositionVectorTransformation()}
+     * use the same data, as specified in {@link #AGD66()} contract.
+     *
+     * @param  WGS84  {@code true} for the WGS84 input, or {@code false} for the AGD66 output.
+     */
+    static double[] expectedAGD66(final boolean WGS84) {
+        return WGS84 ? new double[] {-37.84, 114.0} : new double[] {763850.64, 5807560.94};
+    }
+
+    /**
+     * Returns the WKT for a CRS using the Australian Geodetic Datum 1966. This method returns a WKT 1 string
+     * with a {@code TOWGS84} element that should help Apache SIS to produce the same result regardless if an
+     * EPSG geodetic dataset is used or not.
+     *
+     * @see <a href="https://issues.apache.org/jira/browse/SIS-364">SIS-364</a>
+     */
+    static String AGD66() {
+        return "PROJCS[“AGD66 / AMG zone 49”,"
+                + "GEOGCS[“AGD66”, "
+                +   "DATUM[“Australian_Geodetic_Datum_1966”, "
+                +     "SPHEROID[“Australian National Spheroid”,6378160, 298.25, AUTHORITY[“EPSG”,“7003”]],"
+                +     "TOWGS84[-117.808,-51.536,137.784,0.303,0.446,0.234,-0.29], AUTHORITY[“EPSG”,“6202”]],"
+                +     "PRIMEM[“Greenwich”, 0, AUTHORITY[“EPSG”,“8901”]],"
+                +     "UNIT[“degree”, 0.0174532925199433, AUTHORITY[“EPSG”,“9122”]],"
+                +   "AUTHORITY[“EPSG”,“4202”]],"
+                +   "PROJECTION[“Transverse_Mercator”],"
+                +   "PARAMETER[“latitude_of_origin”, 0],"
+                +   "PARAMETER[“central_meridian”, 111],"
+                +   "PARAMETER[“scale_factor”, 0.9996],"
+                +   "PARAMETER[“false_easting”, 500000],"
+                +   "PARAMETER[“false_northing”, 10000000],"
+                +   "UNIT[“metre”,1,AUTHORITY[“EPSG”,“9001”]],"
+                +   "AXIS[“Easting”,EAST],"
+                +   "AXIS[“Northing”,NORTH],"
+                + "AUTHORITY[“EPSG”,“20249”]]";
+    }
+
+    /**
      * Tests that an exception is thrown on attempt to grab a transformation between incompatible vertical CRS.
      *
      * @throws FactoryException if an exception other than the expected one occurred.
@@ -463,7 +530,7 @@ public final strictfp class CoordinateOp
         final VerticalCRS sourceCRS = CommonCRS.Vertical.NAVD88.crs();
         final VerticalCRS targetCRS = CommonCRS.Vertical.MEAN_SEA_LEVEL.crs();
         try {
-            inference.createOperation(sourceCRS, targetCRS);
+            finder.createOperation(sourceCRS, targetCRS);
             fail("The operation should have failed.");
         } catch (OperationNotFoundException e) {
             final String message = e.getMessage();
@@ -485,7 +552,7 @@ public final strictfp class CoordinateOp
     public void testTemporalConversion() throws FactoryException, TransformException {
         final TemporalCRS sourceCRS = CommonCRS.Temporal.UNIX.crs();
         final TemporalCRS targetCRS = CommonCRS.Temporal.MODIFIED_JULIAN.crs();
-        final CoordinateOperation operation = inference.createOperation(sourceCRS, targetCRS);
+        final CoordinateOperation operation = finder.createOperation(sourceCRS, targetCRS);
         assertSame      ("sourceCRS", sourceCRS,        operation.getSourceCRS());
         assertSame      ("targetCRS", targetCRS,        operation.getTargetCRS());
         assertEquals    ("name",      "Axis changes",   operation.getName().getCode());
@@ -524,7 +591,7 @@ public final strictfp class CoordinateOp
         // NOTE: make sure that the 'sourceCRS' below is not equal to any other 'sourceCRS' created in this class.
         final CompoundCRS   sourceCRS = compound("Test4D", CommonCRS.WGS84.geographic3D(), CommonCRS.Temporal.UNIX.crs());
         final GeographicCRS targetCRS = CommonCRS.WGS84.geographic();
-        final CoordinateOperation operation = inference.createOperation(sourceCRS, targetCRS);
+        final CoordinateOperation operation = finder.createOperation(sourceCRS, targetCRS);
         assertSame      ("sourceCRS", sourceCRS,        operation.getSourceCRS());
         assertSame      ("targetCRS", targetCRS,        operation.getTargetCRS());
 
@@ -561,7 +628,7 @@ public final strictfp class CoordinateOp
     public void testGeographic3D_to_2D() throws FactoryException, TransformException {
         final GeographicCRS sourceCRS = CommonCRS.WGS84.geographic3D();
         final GeographicCRS targetCRS = CommonCRS.WGS84.geographic();
-        final CoordinateOperation operation = inference.createOperation(sourceCRS, targetCRS);
+        final CoordinateOperation operation = finder.createOperation(sourceCRS, targetCRS);
         assertSame      ("sourceCRS", sourceCRS,        operation.getSourceCRS());
         assertSame      ("targetCRS", targetCRS,        operation.getTargetCRS());
         assertEquals    ("name",      "Axis changes",   operation.getName().getCode());
@@ -604,7 +671,7 @@ public final strictfp class CoordinateOp
     public void testGeographic2D_to_3D() throws FactoryException, TransformException {
         final GeographicCRS sourceCRS = CommonCRS.WGS84.geographic();
         final GeographicCRS targetCRS = CommonCRS.WGS84.geographic3D();
-        final CoordinateOperation operation = inference.createOperation(sourceCRS, targetCRS);
+        final CoordinateOperation operation = finder.createOperation(sourceCRS, targetCRS);
         assertSame      ("sourceCRS", sourceCRS,        operation.getSourceCRS());
         assertSame      ("targetCRS", targetCRS,        operation.getTargetCRS());
         assertEquals    ("name",      "Axis changes",   operation.getName().getCode());
@@ -648,7 +715,7 @@ public final strictfp class CoordinateOp
     public void testGeographic3D_to_EllipsoidalHeight() throws FactoryException, TransformException {
         final CoordinateReferenceSystem sourceCRS = CommonCRS.WGS84.geographic3D();
         final CoordinateReferenceSystem targetCRS = HardCodedCRS.ELLIPSOIDAL_HEIGHT_cm;
-        final CoordinateOperation operation = inference.createOperation(sourceCRS, targetCRS);
+        final CoordinateOperation operation = finder.createOperation(sourceCRS, targetCRS);
         assertSame      ("sourceCRS", sourceCRS,        operation.getSourceCRS());
         assertSame      ("targetCRS", targetCRS,        operation.getTargetCRS());
         assertEquals    ("name",      "Axis changes",   operation.getName().getCode());
@@ -688,7 +755,7 @@ public final strictfp class CoordinateOp
         // NOTE: make sure that the 'sourceCRS' below is not equal to any other 'sourceCRS' created in this class.
         final CompoundCRS sourceCRS = compound("Test4D", CommonCRS.WGS84.geographic3D(), CommonCRS.Temporal.JULIAN.crs());
         final VerticalCRS targetCRS = CommonCRS.Vertical.ELLIPSOIDAL.crs();
-        final CoordinateOperation operation = inference.createOperation(sourceCRS, targetCRS);
+        final CoordinateOperation operation = finder.createOperation(sourceCRS, targetCRS);
         assertSame      ("sourceCRS", sourceCRS,        operation.getSourceCRS());
         assertSame      ("targetCRS", targetCRS,        operation.getTargetCRS());
         assertEquals    ("name",      "Axis changes",   operation.getName().getCode());
@@ -750,7 +817,7 @@ public final strictfp class CoordinateOp
         sourceCRS = compound("Mercator 3D", sourceCRS, CommonCRS.Vertical.ELLIPSOIDAL.crs());
         sourceCRS = compound("Mercator 4D", sourceCRS, CommonCRS.Temporal.MODIFIED_JULIAN.crs());
 
-        final CoordinateOperation operation = inference.createOperation(sourceCRS, targetCRS);
+        final CoordinateOperation operation = finder.createOperation(sourceCRS, targetCRS);
         assertSame("sourceCRS", sourceCRS, operation.getSourceCRS());
         assertSame("targetCRS", targetCRS, operation.getTargetCRS());
 
@@ -793,7 +860,7 @@ public final strictfp class CoordinateOp
         // NOTE: make sure that the 'sourceCRS' below is not equal to any other 'sourceCRS' created in this class.
         final CompoundCRS sourceCRS = compound("Test3D", CommonCRS.WGS84.geographic(),   CommonCRS.Temporal.UNIX.crs());
         final CompoundCRS targetCRS = compound("Test4D", CommonCRS.WGS84.geographic3D(), CommonCRS.Temporal.MODIFIED_JULIAN.crs());
-        final CoordinateOperation operation = inference.createOperation(sourceCRS, targetCRS);
+        final CoordinateOperation operation = finder.createOperation(sourceCRS, targetCRS);
         assertSame      ("sourceCRS", sourceCRS, operation.getSourceCRS());
         assertSame      ("targetCRS", targetCRS, operation.getTargetCRS());
         assertInstanceOf("operation", ConcatenatedOperation.class, operation);
@@ -843,7 +910,7 @@ public final strictfp class CoordinateOp
                     0,   0,   1
                 })), HardCodedCS.DISPLAY);
 
-        final CoordinateOperation operation = inference.createOperation(sourceCRS, targetCRS);
+        final CoordinateOperation operation = finder.createOperation(sourceCRS, targetCRS);
         assertSame("sourceCRS", sourceCRS, operation.getSourceCRS());
         assertSame("targetCRS", targetCRS, operation.getTargetCRS());
 

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationRegistryTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationRegistryTest.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationRegistryTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/CoordinateOperationRegistryTest.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -49,9 +49,11 @@ import static org.junit.Assume.*;
 
 
 /**
- * Tests {@link CoordinateOperationRegistry}.
- * This class tests the following operations:
+ * Tests {@link CoordinateOperationRegistry} using the EPSG geodetic dataset.
+ * If no EPSG geodetic dataset is available in the running environment, then tests are skipped.
+ * For tests without the need of an EPSG database, see {@link CoordinateOperationFinderTest}.
  *
+ * <p>This class tests the following operations:</p>
  * <ul>
  *   <li><cite>"NTF (Paris) to WGS 84 (1)"</cite> operation (EPSG:8094), which implies a longitude rotation
  *       followed by a geocentric translation in the geographic domain.</li>

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactoryTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactoryTest.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactoryTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactoryTest.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -32,6 +32,7 @@ import org.apache.sis.internal.util.Cons
 import org.apache.sis.geometry.DirectPosition2D;
 import org.apache.sis.io.wkt.WKTFormat;
 import org.apache.sis.referencing.CRS;
+import org.apache.sis.referencing.CommonCRS;
 
 // Test dependencies
 import org.apache.sis.referencing.operation.transform.MathTransformTestCase;
@@ -45,10 +46,17 @@ import static org.apache.sis.test.Refere
 
 
 /**
- * Tests {@link DefaultCoordinateOperationFactory}.
+ * Tests {@link DefaultCoordinateOperationFactory}, with or without EPSG geodetic dataset.
+ *
+ * <p><b>Relationship with other tests:</b></p>
+ * <ul>
+ *   <li>{@link CoordinateOperationRegistryTest} requires an EPSG geodetic dataset (otherwise tests are skipped).</li>
+ *   <li>{@link CoordinateOperationFinderTest} do not use any EPSG geodetic dataset.</li>
+ *   <li>{@code DefaultCoordinateOperationFactoryTest} is a mix of both.</li>
+ * </ul>
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.7
+ * @version 0.8
  * @since   0.7
  * @module
  */
@@ -314,4 +322,32 @@ public final strictfp class DefaultCoord
         assertEquals("Easting should be unchanged", sourcePt.getX(),  targetPt.getX(), STRICT);
         assertEquals("Expected 27 km shift", 27476, targetPt.getY() - sourcePt.getY(), tolerance);
     }
+
+    /**
+     * Tests a datum shift applied as a position vector transformation in geocentric domain.  This method performs
+     * the same test than {@link CoordinateOperationFinderTest#testPositionVectorTransformation()} except that the
+     * EPSG geodetic dataset may be used. The result however should be the same because of the {@code TOWGS84}
+     * parameter in the WKT used for the test.
+     *
+     * @throws ParseException if a CRS used in this test can not be parsed.
+     * @throws FactoryException if the operation can not be created.
+     * @throws TransformException if an error occurred while converting the test points.
+     *
+     * @see CoordinateOperationFinderTest#testPositionVectorTransformation()
+     * @see <a href="https://issues.apache.org/jira/browse/SIS-364">SIS-364</a>
+     *
+     * @since 0.8
+     */
+    @Test
+    public void testPositionVectorTransformation() throws ParseException, FactoryException, TransformException {
+        final CoordinateReferenceSystem sourceCRS = CommonCRS.WGS84.geographic();
+        final CoordinateReferenceSystem targetCRS = parse(CoordinateOperationFinderTest.AGD66());
+        final CoordinateOperation operation = factory.createOperation(sourceCRS, targetCRS);
+        transform  = operation.getMathTransform();
+        tolerance  = Formulas.LINEAR_TOLERANCE;
+        λDimension = new int[] {0};
+        verifyTransform(CoordinateOperationFinderTest.expectedAGD66(true),
+                        CoordinateOperationFinderTest.expectedAGD66(false));
+        validate();
+    }
 }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/OS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/OS.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/OS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/OS.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -78,12 +78,29 @@ public enum OS {
     }
 
     /**
+     * Returns the name value of {@code "os.name"} property, or {@code null} if the security manager
+     * does not allow us to access this information.
+     *
+     * <div class="note"><b>Note:</b> {@code uname} is an Unix command providing the same information.</div>
+     *
+     * @return the operation system name, or {@code null} if this information is not available.
+     */
+    public static String uname() {
+        try {
+            return System.getProperty("os.name");
+        } catch (SecurityException e) {
+            Logging.recoverableException(Logging.getLogger(Loggers.SYSTEM), OS.class, "uname", e);
+            return null;
+        }
+    }
+
+    /**
      * Returns the operating system SIS is currently on.
      *
      * @return the operation system.
      */
     public static OS current() {
-        final String name = System.getProperty("os.name");
+        final String name = uname();
         if (name != null) {
             if (name.contains("Windows")) return WINDOWS;
             if (name.contains("Mac OS"))  return MAC_OS;
@@ -144,6 +161,6 @@ public enum OS {
                 return tmp.toString();
             }
         }
-        throw new UnsatisfiedLinkError(Errors.format(Errors.Keys.NativeInterfacesNotFound_2, System.getProperty("os.name"), name));
+        throw new UnsatisfiedLinkError(Errors.format(Errors.Keys.NativeInterfacesNotFound_2, uname(), name));
     }
 }

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=1802073&r1=1802072&r2=1802073&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] Sun Jul 16 15:39:06 2017
@@ -71,6 +71,12 @@ public final class Constants extends Sta
     public static final String SIS = "SIS";
 
     /**
+     * The {@value} code space. The project name is {@code "Proj.4"}, but this constant omits
+     * the dot because this name is used as a codes pace and we want to avoid risk of confusion.
+     */
+    public static final String PROJ4 = "Proj4";
+
+    /**
      * The {@value} code space.
      */
     public static final String CRS = "CRS";

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] Sun Jul 16 15:39:06 2017
@@ -906,6 +906,16 @@ public final class Errors extends Indexe
         public static final short UnsupportedArgumentValue_1 = 170;
 
         /**
+         * Axes with “{0}” direction are not supported by this operation.
+         */
+        public static final short UnsupportedAxisDirection_1 = 177;
+
+        /**
+         * The “{0}” coordinate system is not supported by this operation.
+         */
+        public static final short UnsupportedCoordinateSystem_1 = 178;
+
+        /**
          * The “{0}” datum is not supported by this operation.
          */
         public static final short UnsupportedDatum_1 = 168;

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] Sun Jul 16 15:39:06 2017
@@ -196,6 +196,8 @@ UnsupportedImplementation_1       = Can
 UnsupportedInterpolation_1        = The \u201c{0}\u201d interpolation is unsupported.
 UnsupportedOperation_1            = The \u2018{0}\u2019 operation is unsupported.
 UnsupportedArgumentValue_1        = The \u201c{0}\u201d argument value is unsupported.
+UnsupportedAxisDirection_1        = Axes with \u201c{0}\u201d direction are not supported by this operation.
+UnsupportedCoordinateSystem_1     = The \u201c{0}\u201d coordinate system is not supported by this operation.
 UnsupportedDatum_1                = The \u201c{0}\u201d datum is not supported by this operation.
 UnsupportedType_1                 = The \u2018{0}\u2019 type is not supported in this context.
 ValueAlreadyDefined_1             = A value is already defined for \u201c{0}\u201d.

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] Sun Jul 16 15:39:06 2017
@@ -192,6 +192,8 @@ UnsupportedImplementation_1       = Cett
 UnsupportedInterpolation_1        = L\u2019interpolation \u201c{0}\u201d n\u2019est pas support\u00e9e.
 UnsupportedOperation_1            = L\u2019op\u00e9ration \u2018{0}\u2019 n\u2019est pas support\u00e9e.
 UnsupportedArgumentValue_1        = La valeur d\u2019argument \u00ab\u202f{0}\u202f\u00bb n\u2019est pas support\u00e9e.
+UnsupportedAxisDirection_1        = Les axes de direction \u00ab\u202f{0}\u202f\u00bb ne sont pas support\u00e9s par cette op\u00e9ration.
+UnsupportedCoordinateSystem_1     = Le syst\u00e8me de coordonn\u00e9es \u00ab\u202f{0}\u202f\u00bb n\u2019est pas support\u00e9 par cette op\u00e9ration.
 UnsupportedDatum_1                = Le r\u00e9f\u00e9rentiel \u00ab\u202f{0}\u202f\u00bb n\u2019est pas support\u00e9 par cette op\u00e9ration.
 UnsupportedType_1                 = Le type \u2018{0}\u2019 n\u2019est pas support\u00e9 dans ce contexte.
 ValueAlreadyDefined_1             = Une valeur est d\u00e9j\u00e0 d\u00e9finie pour \u00ab\u202f{0}\u202f\u00bb.

Modified: sis/branches/JDK7/ide-project/NetBeans/build.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/ide-project/NetBeans/build.xml?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/ide-project/NetBeans/build.xml (original)
+++ sis/branches/JDK7/ide-project/NetBeans/build.xml Sun Jul 16 15:39:06 2017
@@ -74,7 +74,6 @@
         <include name="**/*.properties"/>
       </fileset>
       <fileset dir="${project.root}/storage/sis-gdal/src/main/resources">
-        <include name="**/*.txt"/>
         <include name="**/*.dll"/>
         <include name="**/*.so"/>
       </fileset>

Modified: sis/branches/JDK7/storage/sis-gdal/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-gdal/pom.xml?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-gdal/pom.xml (original)
+++ sis/branches/JDK7/storage/sis-gdal/pom.xml Sun Jul 16 15:39:06 2017
@@ -100,6 +100,20 @@ Referencing services from Proj4 through
       <artifactId>sis-referencing</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.sis.core</groupId>
+      <artifactId>sis-metadata</artifactId>
+      <version>${project.version}</version>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.sis.core</groupId>
+      <artifactId>sis-referencing</artifactId>
+      <version>${project.version}</version>
+      <type>test-jar</type>
+      <scope>test</scope>
+    </dependency>
   </dependencies>
 
 </project>

Modified: sis/branches/JDK7/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.c
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.c?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.c [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.c [UTF-8] Sun Jul 16 15:39:06 2017
@@ -49,7 +49,7 @@ PJ *getPJ(JNIEnv *env, jobject object)
  * \param  class - The class from which this method has been invoked.
  * \return The Proj4 release number, or NULL.
  */
-JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_getVersion
+JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_getRelease
   (JNIEnv *env, jclass class)
 {
     const char *desc = pj_get_release();
@@ -99,7 +99,7 @@ JNIEXPORT jlong JNICALL Java_org_apache_
  * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
  * \return The definition string.
  */
-JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_getDefinition
+JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_getCode
   (JNIEnv *env, jobject object)
 {
     PJ *pj = getPJ(env, object);
@@ -122,7 +122,7 @@ JNIEXPORT jstring JNICALL Java_org_apach
  * \param  object - The Java object wrapping the PJ structure (not allowed to be NULL).
  * \return The description associated to the PJ structure.
  */
-JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_toString
+JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_getName
   (JNIEnv *env, jobject object)
 {
     PJ *pj = getPJ(env, object);

Modified: sis/branches/JDK7/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.h
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.h?rev=1802073&r1=1802072&r2=1802073&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.h [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-gdal/src/main/c/org_apache_sis_storage_gdal_PJ.h [UTF-8] Sun Jul 16 15:39:06 2017
@@ -27,18 +27,26 @@ JNIEXPORT jlong JNICALL Java_org_apache_
 
 /*
  * Class:     org_apache_sis_storage_gdal_PJ
- * Method:    getVersion
+ * Method:    getRelease
  * Signature: ()Ljava/lang/String;
  */
-JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_getVersion
+JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_getRelease
   (JNIEnv *, jclass);
 
 /*
  * Class:     org_apache_sis_storage_gdal_PJ
- * Method:    getDefinition
+ * Method:    getCode
  * Signature: ()Ljava/lang/String;
  */
-JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_getDefinition
+JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_getCode
+  (JNIEnv *, jobject);
+
+/*
+ * Class:     org_apache_sis_storage_gdal_PJ
+ * Method:    getName
+ * Signature: ()Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_getName
   (JNIEnv *, jobject);
 
 /*
@@ -114,14 +122,6 @@ JNIEXPORT jstring JNICALL Java_org_apach
   (JNIEnv *, jobject);
 
 /*
- * Class:     org_apache_sis_storage_gdal_PJ
- * Method:    toString
- * Signature: ()Ljava/lang/String;
- */
-JNIEXPORT jstring JNICALL Java_org_apache_sis_storage_gdal_PJ_toString
-  (JNIEnv *, jobject);
-
-/*
  * Class:     org_apache_sis_storage_gdal_PJ
  * Method:    finalize
  * Signature: ()V



Mime
View raw message