sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1738661 - in /sis/branches/JDK8/core: sis-metadata/src/main/java/org/apache/sis/io/wkt/ sis-referencing/src/main/java/org/apache/sis/referencing/operation/ sis-referencing/src/test/java/org/apache/sis/referencing/operation/
Date Mon, 11 Apr 2016 22:52:39 GMT
Author: desruisseaux
Date: Mon Apr 11 22:52:39 2016
New Revision: 1738661

URL: http://svn.apache.org/viewvc?rev=1738661&view=rev
Log:
Simplify the pseudo-WKT representation of ConcatenatedOperation.

Modified:
    sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperationTest.java

Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1738661&r1=1738660&r2=1738661&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
[UTF-8] Mon Apr 11 22:52:39 2016
@@ -53,6 +53,7 @@ import org.opengis.referencing.crs.Compo
 import org.opengis.referencing.cs.CoordinateSystemAxis;
 import org.opengis.referencing.operation.OperationMethod;
 import org.opengis.referencing.operation.CoordinateOperation;
+import org.opengis.referencing.operation.ConcatenatedOperation;
 import org.opengis.referencing.operation.MathTransform;
 import org.opengis.util.ControlledVocabulary;
 
@@ -764,8 +765,8 @@ public class Formatter implements Locali
             } else {
                 filterID = (parent != null);
                 if (object instanceof CoordinateOperation) {
-                    showOthers  = true;
-                    showRemarks = true;
+                    showOthers  = !(parent instanceof ConcatenatedOperation);
+                    showRemarks = showOthers;
                 } else if (object instanceof ReferenceSystem) {
                     showOthers  = (parent == null);
                     showRemarks = (parent == null) || (getEnclosingElement(2) instanceof
CoordinateOperation);

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java?rev=1738661&r1=1738660&r2=1738661&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
[UTF-8] Mon Apr 11 22:52:39 2016
@@ -871,14 +871,9 @@ check:      for (int isTarget=0; ; isTar
         final FormattableObject enclosing = formatter.getEnclosingElement(1);
         final boolean isSubOperation = (enclosing instanceof PassThroughOperation);
         final boolean isComponent    = (enclosing instanceof ConcatenatedOperation);
-        final boolean isConcatenated =      (this instanceof ConcatenatedOperation);
-        if (!isSubOperation) {
-            if (!isComponent) {
-                append(formatter, getSourceCRS(), WKTKeywords.SourceCRS);
-            }
-            if (!isConcatenated) {
-                append(formatter, getTargetCRS(), WKTKeywords.TargetCRS);
-            }
+        if (!isSubOperation && !isComponent) {
+            append(formatter, getSourceCRS(), WKTKeywords.SourceCRS);
+            append(formatter, getTargetCRS(), WKTKeywords.TargetCRS);
         }
         final OperationMethod method = getMethod();
         if (method != null) {
@@ -900,7 +895,7 @@ check:      for (int isTarget=0; ; isTar
                 formatter.indent(-1);
             }
         }
-        if (!isSubOperation && !isConcatenated) {
+        if (!isSubOperation && !(this instanceof ConcatenatedOperation)) {
             append(formatter, getInterpolationCRS(), WKTKeywords.InterpolationCRS);
             final double accuracy = getLinearAccuracy();
             if (accuracy > 0) {

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java?rev=1738661&r1=1738660&r2=1738661&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java
[UTF-8] Mon Apr 11 22:52:39 2016
@@ -48,6 +48,7 @@ import org.apache.sis.referencing.operat
 import org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory;
 import org.apache.sis.referencing.factory.IdentifiedObjectFinder;
 import org.apache.sis.referencing.factory.MissingFactoryResourceException;
+import org.apache.sis.referencing.factory.InvalidGeodeticParameterException;
 import org.apache.sis.metadata.iso.extent.Extents;
 import org.apache.sis.internal.referencing.ReferencingUtilities;
 import org.apache.sis.internal.metadata.ReferencingServices;
@@ -650,7 +651,7 @@ final class CoordinateOperationRegistry
                             mt = ((DefaultMathTransformFactory) mtFactory).createParameterizedTransform(
                                     ((SingleOperation) op).getParameterValues(),
                                     ReferencingUtilities.createTransformContext(source3D,
target3D, null));
-                        } catch (FactoryException e) {
+                        } catch (InvalidGeodeticParameterException e) {
                             log(e);
                             break;
                         }

Modified: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperationTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperationTest.java?rev=1738661&r1=1738660&r2=1738661&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperationTest.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultConcatenatedOperationTest.java
[UTF-8] Mon Apr 11 22:52:39 2016
@@ -106,39 +106,23 @@ public final strictfp class DefaultConca
                 "      Axis[“Longitude (L)”, east, Unit[“degree”, 0.017453292519943295]],\n"
+
                 "      Axis[“Latitude (B)”, north, Unit[“degree”, 0.017453292519943295]],\n"
+
                 "      Axis[“Ellipsoidal height (h)”, up, Unit[“metre”, 1]]]],\n"
+
+                "  TargetCRS[GeodeticCRS[“JGD2000”,\n" +
+                "    Datum[“Japanese Geodetic Datum 2000”,\n" +
+                "      Ellipsoid[“GRS 1980”, 6378137.0, 298.257222101]],\n" +
+                "    CS[ellipsoidal, 3],\n" +
+                "      Axis[“Longitude (L)”, east, Unit[“degree”, 0.017453292519943295]],\n"
+
+                "      Axis[“Latitude (B)”, north, Unit[“degree”, 0.017453292519943295]],\n"
+
+                "      Axis[“Ellipsoidal height (h)”, up, Unit[“metre”, 1]]]],\n"
+
                 "  CoordinateOperationStep[“Geographic to geocentric”,\n" +
-                "    TargetCRS[GeodeticCRS[“Tokyo 1918”,\n" +
-                "      Datum[“Tokyo 1918”,\n" +
-                "        Ellipsoid[“Bessel 1841”, 6377397.155, 299.1528128]],\n" +
-                "      CS[Cartesian, 3],\n" +
-                "        Axis[“(X)”, geocentricX],\n" +
-                "        Axis[“(Y)”, geocentricY],\n" +
-                "        Axis[“(Z)”, geocentricZ],\n" +
-                "        Unit[“metre”, 1]]],\n" +
                 "    Method[“Geographic/geocentric conversions”],\n" +
                 "      Parameter[“semi_major”, 6377397.155, Unit[“metre”, 1]],\n"
+
                 "      Parameter[“semi_minor”, 6356078.962818189, Unit[“metre”, 1]]],\n"
+
                 "  CoordinateOperationStep[“Tokyo to JGD2000 (GSI)”,\n" +
-                "    TargetCRS[GeodeticCRS[“JGD2000”,\n" +
-                "      Datum[“Japanese Geodetic Datum 2000”,\n" +
-                "        Ellipsoid[“GRS 1980”, 6378137.0, 298.257222101]],\n" +
-                "      CS[Cartesian, 3],\n" +
-                "        Axis[“(X)”, geocentricX],\n" +
-                "        Axis[“(Y)”, geocentricY],\n" +
-                "        Axis[“(Z)”, geocentricZ],\n" +
-                "        Unit[“metre”, 1]]],\n" +
                 "    Method[“Geocentric translations”],\n" +
                 "      Parameter[“X-axis translation”, -146.414],\n" +
                 "      Parameter[“Y-axis translation”, 507.337],\n" +
                 "      Parameter[“Z-axis translation”, 680.507]],\n" +
                 "  CoordinateOperationStep[“Geocentric to geographic”,\n" +
-                "    TargetCRS[GeodeticCRS[“JGD2000”,\n" +
-                "      Datum[“Japanese Geodetic Datum 2000”,\n" +
-                "        Ellipsoid[“GRS 1980”, 6378137.0, 298.257222101]],\n" +
-                "      CS[ellipsoidal, 3],\n" +
-                "        Axis[“Longitude (L)”, east, Unit[“degree”, 0.017453292519943295]],\n"
+
-                "        Axis[“Latitude (B)”, north, Unit[“degree”, 0.017453292519943295]],\n"
+
-                "        Axis[“Ellipsoidal height (h)”, up, Unit[“metre”, 1]]]],\n"
+
                 "    Method[“Geographic/geocentric conversions”],\n" +
                 "      Parameter[“semi_major”, 6378137.0, Unit[“metre”, 1]],\n" +
                 "      Parameter[“semi_minor”, 6356752.314140356, Unit[“metre”, 1]]]]",
op);



Mime
View raw message