This is an automated email from the ASF dual-hosted git repository.

jsorel pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git


The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
     new d4c39d7  CoordinateSystem : avoid testing coordinate system axis when 
creating transform when they are identical
d4c39d7 is described below

commit d4c39d7f0ceeb55cdcb6a99e2caa16d693462a46
Author: jsorel <[email protected]>
AuthorDate: Fri Jan 11 13:12:51 2019 +0100

    CoordinateSystem : avoid testing coordinate system axis when creating 
transform when they are identical
---
 .../src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java
 
b/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java
index b8a00a3..94f01e9 100644
--- 
a/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java
+++ 
b/core/sis-referencing/src/main/java/org/apache/sis/referencing/cs/CoordinateSystems.java
@@ -281,6 +281,9 @@ public final class CoordinateSystems extends Static {
         if (!Classes.implementSameInterfaces(sourceCS.getClass(), 
targetCS.getClass(), CoordinateSystem.class)) {
             throw new 
IllegalArgumentException(Resources.format(Resources.Keys.IncompatibleCoordinateSystemTypes));
         }
+        if (sourceCS.equals(targetCS)) {
+            return Matrices.createIdentity(sourceCS.getDimension() + 1);
+        }
         final AxisDirection[] srcAxes = getAxisDirections(sourceCS);
         final AxisDirection[] dstAxes = getAxisDirections(targetCS);
         final MatrixSIS matrix = Matrices.createTransform(srcAxes, dstAxes);

Reply via email to