sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1688778 - in /sis/branches/JDK8: core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/ core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ core/sis-referencing/src/test/resources/META-INF/ core/sis...
Date Thu, 02 Jul 2015 08:03:16 GMT
Author: desruisseaux
Date: Thu Jul  2 08:03:15 2015
New Revision: 1688778

URL: http://svn.apache.org/r1688778
Log:
WKT 2: add a mock for the "Pole rotation" operation method.
This allow us to execute the GeoAPI test for Derived Geodetic CRS.

Added:
    sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/PoleRotationMock.java
  (with props)
    sis/branches/JDK8/core/sis-referencing/src/test/resources/META-INF/
    sis/branches/JDK8/core/sis-referencing/src/test/resources/META-INF/services/
    sis/branches/JDK8/core/sis-referencing/src/test/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod
      - copied, changed from r1688688, sis/branches/JDK8/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod
Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java
    sis/branches/JDK8/ide-project/NetBeans/build.xml

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java?rev=1688778&r1=1688777&r2=1688778&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/crs/DefaultDerivedCRS.java
[UTF-8] Thu Jul  2 08:03:15 2015
@@ -525,6 +525,7 @@ public class DefaultDerivedCRS extends A
         if (isWKT1) {
             return WKTKeywords.Fitted_CS;
         } else {
+            formatter.newLine();
             formatter.append(new FormattableObject() {     // Format inside a "DefiningConversion"
element.
                 @Override protected String formatTo(final Formatter formatter) {
                     WKTUtilities.appendName(conversion, formatter, null);

Added: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/PoleRotationMock.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/PoleRotationMock.java?rev=1688778&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/PoleRotationMock.java
(added)
+++ sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/PoleRotationMock.java
[UTF-8] Thu Jul  2 08:03:15 2015
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.internal.referencing.provider;
+
+import javax.measure.unit.NonSI;
+import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.parameter.ParameterDescriptorGroup;
+import org.opengis.parameter.ParameterValueGroup;
+import org.opengis.referencing.operation.Matrix;
+import org.opengis.referencing.operation.MathTransform;
+import org.opengis.referencing.operation.MathTransformFactory;
+import org.apache.sis.referencing.operation.transform.AbstractMathTransform;
+import org.apache.sis.parameter.ParameterBuilder;
+
+
+/**
+ * The provider for <cite>"Pole rotation"</cite> conversion.
+ *
+ * This conversion is not yet implemented in Apache SIS, but we need to at least accept the
parameters
+ * for a Well Known Text (WKT) parsing test in the {@link org.apache.sis.io.wkt.WKTParserTest}
class.
+ *
+ * <p>This class may be promoted to a real operation if we implement the formulas in
a future Apache SIS version.</p>
+ *
+ * @author  Martin Desruisseaux (Geomatys)
+ * @since   0.6
+ * @version 0.6
+ * @module
+ */
+@SuppressWarnings("serial")
+public final strictfp class PoleRotationMock extends AbstractProvider {
+    /**
+     * The group of all parameters expected by this coordinate operation.
+     */
+    private static final ParameterDescriptorGroup PARAMETERS;
+    static {
+        final ParameterBuilder builder = new ParameterBuilder().setRequired(true);
+        final ParameterDescriptor<?>[] parameters = {
+            createLatitude (builder.addName("Latitude of rotated pole"), true),
+            createLongitude(builder.addName("Longitude of rotated pole")),
+                            builder.addName("Axis rotation").create(Double.NaN, NonSI.DEGREE_ANGLE)
+        };
+        PARAMETERS = builder.addName("Pole rotation").createGroup(parameters);
+    }
+
+    /**
+     * Creates a new <cite>"Pole rotation"</cite> operation method.
+     */
+    public PoleRotationMock() {
+        super(2, 2, PARAMETERS);
+    }
+
+    /**
+     * Not yet supported.
+     *
+     * @param  factory    Ignored.
+     * @param  parameters Ignored.
+     * @return A dummy math transform.
+     */
+    @Override
+    public MathTransform createMathTransform(MathTransformFactory factory, ParameterValueGroup
parameters) {
+        return new Unimplemented();
+    }
+
+    /**
+     * Dummy value returned by {@link PoleRotationMock#createMathTransform(MathTransformFactory,
ParameterValueGroup)}.
+     */
+    private static final class Unimplemented extends AbstractMathTransform {
+        @Override public int getSourceDimensions() {return 2;}
+        @Override public int getTargetDimensions() {return 2;}
+        @Override public Matrix transform(double[] srcPts, int srcOff, double[] dstPts, int
dstOff, boolean derivate) {
+            throw new UnsupportedOperationException();
+        }
+    }
+}

Propchange: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/PoleRotationMock.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/PoleRotationMock.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Copied: sis/branches/JDK8/core/sis-referencing/src/test/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod
(from r1688688, sis/branches/JDK8/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod)
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/test/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod?p2=sis/branches/JDK8/core/sis-referencing/src/test/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod&p1=sis/branches/JDK8/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod&r1=1688688&r2=1688778&rev=1688778&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/test/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod
[UTF-8] Thu Jul  2 08:03:15 2015
@@ -1,14 +1,2 @@
 # Licensed to the Apache Software Foundation (ASF) under one or more contributor license
agreements.
-# Heavier classes (e.g. having more dependencies) or classes less likely to be used, should
be last.
-org.apache.sis.internal.referencing.provider.Affine
-org.apache.sis.internal.referencing.provider.LongitudeRotation
-org.apache.sis.internal.referencing.provider.Equirectangular
-org.apache.sis.internal.referencing.provider.Mercator1SP
-org.apache.sis.internal.referencing.provider.Mercator2SP
-org.apache.sis.internal.referencing.provider.MercatorSpherical
-org.apache.sis.internal.referencing.provider.PseudoMercator
-org.apache.sis.internal.referencing.provider.RegionalMercator
-org.apache.sis.internal.referencing.provider.MillerCylindrical
-org.apache.sis.internal.referencing.provider.LambertConformal1SP
-org.apache.sis.internal.referencing.provider.LambertConformal2SP
-org.apache.sis.internal.referencing.provider.LambertConformalBelgium
+org.apache.sis.internal.referencing.provider.PoleRotationMock

Modified: sis/branches/JDK8/ide-project/NetBeans/build.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/ide-project/NetBeans/build.xml?rev=1688778&r1=1688777&r2=1688778&view=diff
==============================================================================
--- sis/branches/JDK8/ide-project/NetBeans/build.xml (original)
+++ sis/branches/JDK8/ide-project/NetBeans/build.xml Thu Jul  2 08:03:15 2015
@@ -109,6 +109,7 @@
     <concat destfile="${build.classes.dir}/META-INF/services/org.opengis.referencing.operation.OperationMethod"
encoding="UTF-8" fixlastline="yes">
       <fileset dir="${project.root}">
         <include name="*/*/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod"/>
+        <include name="*/*/src/test/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod"/>
       </fileset>
     </concat>
 



Mime
View raw message