sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1675418 - in /sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis: internal/referencing/j2d/ referencing/operation/
Date Wed, 22 Apr 2015 16:57:38 GMT
Author: desruisseaux
Date: Wed Apr 22 16:57:38 2015
New Revision: 1675418

URL: http://svn.apache.org/r1675418
Log:
Referencing: initial port of DefaultConversion and DefaultTransformation.

Added:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
  (with props)
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
  (with props)
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultTransformation.java
  (with props)
Modified:
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java
    sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java

Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java?rev=1675418&r1=1675417&r2=1675418&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java
[UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/j2d/ParameterizedAffine.java
[UTF-8] Wed Apr 22 16:57:38 2015
@@ -104,7 +104,8 @@ public final class ParameterizedAffine e
      */
     @Override
     public ParameterDescriptorGroup getParameterDescriptors() {
-        return isDefinitive ? parameters.getDescriptor() : super.getParameterDescriptors();
+        return isDefinitive || Semaphores.query(Semaphores.PROJCS)  // See comment in getParameterValues().
+               ? parameters.getDescriptor() : super.getParameterDescriptors();
     }
 
     /**

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=1675418&r1=1675417&r2=1675418&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] Wed Apr 22 16:57:38 2015
@@ -23,9 +23,14 @@ import org.opengis.util.InternationalStr
 import org.opengis.metadata.extent.Extent;
 import org.opengis.metadata.quality.PositionalAccuracy;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
-import org.opengis.referencing.operation.*;     // We really use most of this package content.
+import org.opengis.referencing.operation.Conversion;
+import org.opengis.referencing.operation.SingleOperation;
+import org.opengis.referencing.operation.CoordinateOperation;
+import org.opengis.referencing.operation.OperationMethod;
+import org.opengis.referencing.operation.MathTransform;
 import org.opengis.metadata.Identifier;
 import org.apache.sis.parameter.Parameterized;
+import org.opengis.parameter.ParameterDescriptorGroup;
 import org.opengis.parameter.ParameterValueGroup;
 import org.apache.sis.io.wkt.Formatter;
 import org.apache.sis.io.wkt.FormattableObject;
@@ -539,14 +544,47 @@ public class AbstractCoordinateOperation
     }
 
     /**
-     * Returns the parameter values. The default implementation infers the parameter
-     * values from the {@linkplain #transform transform}, if possible.
-     *
-     * @throws UnsupportedOperationException if the parameter values can't be determined
-     *         for the current math transform implementation.
+     * Returns the parameter descriptor. The default implementation infers the descriptor
from the
+     * {@linkplain #transform}, if possible. If no descriptor can be inferred from the math
transform,
+     * then this method fallback on the {@link OperationMethod} parameters.
+     */
+    ParameterDescriptorGroup getParameterDescriptors() throws UnsupportedOperationException
{
+        MathTransform mt = transform;
+        while (mt != null) {
+            if (mt instanceof Parameterized) {
+                final ParameterDescriptorGroup param;
+                if (Semaphores.queryAndSet(Semaphores.PROJCS)) {
+                    throw new AssertionError(); // Should never happen.
+                }
+                try {
+                    param = ((Parameterized) mt).getParameterDescriptors();
+                } finally {
+                    Semaphores.clear(Semaphores.PROJCS);
+                }
+                if (param != null) {
+                    return param;
+                }
+            }
+            if (mt instanceof PassThroughTransform) {
+                mt = ((PassThroughTransform) mt).getSubTransform();
+            } else {
+                break;
+            }
+        }
+        /*
+         * Fallback on the method descriptor. We should never get a NullPointerException
here, because this method
+         * should be invoked only by DefaultConversion and DefaultTransformation subclasses
which verified that the
+         * method is non-null.
+         */
+        return method().getParameters();
+    }
+
+    /**
+     * Returns the parameter values. The default implementation infers the
+     * parameter values from the {@linkplain #transform}, if possible.
      *
-     * @see DefaultMathTransformFactory#createParameterizedTransform(ParameterValueGroup)
-     * @see Parameterized#getParameterValues()
+     * @throws UnsupportedOperationException if the parameter values can not
+     *         be determined for the current math transform implementation.
      */
     ParameterValueGroup getParameterValues() throws UnsupportedOperationException {
         MathTransform mt = transform;
@@ -574,7 +612,6 @@ public class AbstractCoordinateOperation
         throw new UnsupportedImplementationException(Classes.getClass(mt));
     }
 
-
     /**
      * Compares this coordinate operation with the specified object for equality. If the
{@code mode} argument
      * is {@link ComparisonMode#STRICT} or {@link ComparisonMode#BY_CONTRACT BY_CONTRACT},
then all available
@@ -683,7 +720,7 @@ public class AbstractCoordinateOperation
          * inside the above 'equals(Object, ComparisonMode)' method for more information.
          * Note that we use the 'transform' hash code, which should be sufficient.
          */
-        return super.computeHashCode() + Objects.hash(sourceCRS, targetCRS, transform);
+        return super.computeHashCode() + Objects.hash(sourceCRS, targetCRS, interpolationCRS,
transform);
     }
 
     /**

Added: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java?rev=1675418&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
(added)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
[UTF-8] Wed Apr 22 16:57:38 2015
@@ -0,0 +1,130 @@
+/*
+ * 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.referencing.operation;
+
+import java.util.Map;
+import org.opengis.parameter.ParameterValueGroup;
+import org.opengis.parameter.ParameterDescriptorGroup;
+import org.opengis.referencing.operation.SingleOperation;
+import org.opengis.referencing.operation.OperationMethod;
+import org.opengis.referencing.operation.MathTransform;
+import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.apache.sis.internal.referencing.OperationMethods;
+import org.apache.sis.parameter.Parameterized;
+import org.apache.sis.util.collection.Containers;
+import org.apache.sis.util.ArgumentChecks;
+
+
+/**
+ * Shared implementation for {@link DefaultConversion} and {@link DefaultTransformation}.
+ * Does not need to be public, as users should handle only conversions or transformations.
+ *
+ * @author  Martin Desruisseaux (IRD, Geomatys)
+ * @since   0.6
+ * @version 0.6
+ * @module
+ */
+class AbstractSingleOperation extends AbstractCoordinateOperation implements SingleOperation,
Parameterized {
+    /**
+     * Serial number for inter-operability with different versions.
+     */
+    private static final long serialVersionUID = -2635450075620911309L;
+
+    /**
+     * The operation method.
+     */
+    private final OperationMethod method;
+
+    /**
+     * The parameter values, or {@code null} for inferring it from the math transform.
+     */
+    private final ParameterValueGroup parameters;
+
+    /**
+     * Creates a coordinate operation from the given properties.
+     */
+    public AbstractSingleOperation(final Map<String,?>             properties,
+                                   final CoordinateReferenceSystem sourceCRS,
+                                   final CoordinateReferenceSystem targetCRS,
+                                   final CoordinateReferenceSystem interpolationCRS,
+                                   final OperationMethod           method,
+                                   final MathTransform             transform)
+    {
+        super(properties, sourceCRS, targetCRS, interpolationCRS, transform);
+        ArgumentChecks.ensureNonNull("sourceCRS", sourceCRS);
+        ArgumentChecks.ensureNonNull("targetCRS", targetCRS);
+        ArgumentChecks.ensureNonNull("method",    method);
+        ArgumentChecks.ensureNonNull("transform", transform);
+        this.method = method;
+        /*
+         * Undocumented property. We do not document it because parameters are usually either
inferred from
+         * the MathTransform, or specified explicitely in a DefiningConversion. However there
is a few cases,
+         * for example the Molodenski transform, where none of the above can apply, because
the operation is
+         * implemented by a concatenation of math transforms, and concatenations do not have
ParameterValueGroup.
+         */
+        parameters = Containers.property(properties, OperationMethods.PARAMETERS_KEY, ParameterValueGroup.class);
+        // No clone since this is a SIS internal property and SIS does not modify those values
after construction.
+    }
+
+    /**
+     * Returns the operation method (non-overrideable).
+     */
+    @Override
+    final OperationMethod method() {
+        return method;
+    }
+
+    /**
+     * Returns the operation method.
+     *
+     * @return The operation method.
+     */
+    @Override
+    public OperationMethod getMethod() {
+        return method;
+    }
+
+    /**
+     * Returns a description of the parameters. The default implementation tries to infer
the
+     * description from the {@linkplain #getMathTransform() math transform} itself before
to
+     * fallback on the {@linkplain DefaultOperationMethod#getParameters() method parameters}.
+     *
+     * <div class="note"><b>Note:</b>
+     * the two parameter descriptions (from the {@code MathTransform} or from the {@code
OperationMethod})
+     * should be very similar. If they differ, it should be only in minor details like remarks,
default
+     * values or units of measurement.</div>
+     *
+     * @return A description of the parameters.
+     */
+    @Override
+    public ParameterDescriptorGroup getParameterDescriptors() {
+        return (parameters != null) ? parameters.getDescriptor() : super.getParameterDescriptors();
+    }
+
+    /**
+     * Returns the parameter values. The default implementation infers the parameter values
from the
+     * {@linkplain #getMathTransform() math transform}, if possible.
+     *
+     * @return The parameter values.
+     * @throws UnsupportedOperationException if the parameter values can not be determined
+     *         for the current math transform implementation.
+     */
+    @Override
+    public ParameterValueGroup getParameterValues() throws UnsupportedOperationException
{
+        return (parameters != null) ? parameters.clone() : super.getParameterValues();
+    }
+}

Propchange: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractSingleOperation.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Added: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java?rev=1675418&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
(added)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
[UTF-8] Wed Apr 22 16:57:38 2015
@@ -0,0 +1,121 @@
+/*
+ * 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.referencing.operation;
+
+import java.util.Map;
+import org.opengis.referencing.operation.Conversion;
+import org.opengis.referencing.operation.OperationMethod;
+import org.opengis.referencing.operation.MathTransform;
+import org.opengis.referencing.crs.CoordinateReferenceSystem;
+
+
+/**
+ * A parameterized mathematical operation that converts coordinates to another CRS without
any change of
+ * {@linkplain org.apache.sis.referencing.datum.AbstractDatum datum}.
+ * The best-known example of a coordinate conversion is a map projection.
+ * The parameters describing coordinate conversions are defined rather than empirically derived.
+ *
+ * <p>This coordinate operation contains an {@linkplain DefaultOperationMethod operation
method}, usually
+ * with associated parameter values. In the SIS default implementation, the parameter values
are inferred from the
+ * {@linkplain #getMathTransform() math transform}. Subclasses may have to override the {@link
#getParameterValues()}
+ * method if they need to provide a different set of parameters.</p>
+ *
+ * <div class="section">Immutability and thread safety</div>
+ * This base class is immutable and thus thread-safe if the property <em>values</em>
(not necessarily the map itself)
+ * given to the constructor are also immutable. Most SIS subclasses and related classes are
immutable under similar
+ * conditions. This means that unless otherwise noted in the javadoc, {@code CoordinateOperation}
instances created
+ * using only SIS factories and static constants can be shared by many objects and passed
between threads without
+ * synchronization.
+ *
+ * @author  Martin Desruisseaux (IRD, Geomatys)
+ * @since   0.6
+ * @version 0.6
+ * @module
+ *
+ * @see DefaultTransformation
+ */
+public class DefaultConversion extends AbstractSingleOperation implements Conversion {
+    /**
+     * Serial number for inter-operability with different versions.
+     */
+    private static final long serialVersionUID = -2148164324805562793L;
+
+    /**
+     * Creates a coordinate conversion from the given properties.
+     * The properties given in argument follow the same rules than for the
+     * {@linkplain AbstractCoordinateOperation#AbstractCoordinateOperation(Map, CoordinateReferenceSystem,
+     * CoordinateReferenceSystem, CoordinateReferenceSystem, MathTransform) super-class constructor}.
+     * The following table is a reminder of main (not all) properties:
+     *
+     * <table class="sis">
+     *   <caption>Recognized properties (non exhaustive list)</caption>
+     *   <tr>
+     *     <th>Property name</th>
+     *     <th>Value type</th>
+     *     <th>Returned by</th>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value org.opengis.referencing.IdentifiedObject#NAME_KEY}</td>
+     *     <td>{@link org.opengis.metadata.Identifier} or {@link String}</td>
+     *     <td>{@link #getName()}</td>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value org.opengis.referencing.IdentifiedObject#IDENTIFIERS_KEY}</td>
+     *     <td>{@link org.opengis.metadata.Identifier} (optionally as array)</td>
+     *     <td>{@link #getIdentifiers()}</td>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value org.opengis.referencing.operation.CoordinateOperation#COORDINATE_OPERATION_ACCURACY_KEY}</td>
+     *     <td>{@link org.opengis.metadata.quality.PositionalAccuracy} (optionally
as array)</td>
+     *     <td>{@link #getCoordinateOperationAccuracy()}</td>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value org.opengis.referencing.operation.CoordinateOperation#DOMAIN_OF_VALIDITY_KEY}</td>
+     *     <td>{@link org.opengis.metadata.extent.Extent}</td>
+     *     <td>{@link #getDomainOfValidity()}</td>
+     *   </tr>
+     * </table>
+     *
+     * @param properties The properties to be given to the identified object.
+     * @param sourceCRS  The source CRS.
+     * @param targetCRS  The target CRS.
+     * @param interpolationCRS The CRS of additional coordinates needed for the operation,
or {@code null} if none.
+     * @param method     The coordinate operation method (mandatory in all cases).
+     * @param transform  Transform from positions in the source CRS to positions in the target
CRS.
+     */
+    public DefaultConversion(final Map<String,?>             properties,
+                             final CoordinateReferenceSystem sourceCRS,
+                             final CoordinateReferenceSystem targetCRS,
+                             final CoordinateReferenceSystem interpolationCRS,
+                             final OperationMethod           method,
+                             final MathTransform             transform)
+    {
+        super(properties, sourceCRS, targetCRS, interpolationCRS, method, transform);
+    }
+
+    /**
+     * Returns the GeoAPI interface implemented by this class.
+     * The default implementation returns {@code Conversion.class}.
+     * Subclasses implementing a more specific GeoAPI interface shall override this method.
+     *
+     * @return The conversion interface implemented by this class.
+     */
+    @Override
+    public Class<? extends Conversion> getInterface() {
+        return Conversion.class;
+    }
+}

Propchange: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultConversion.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8

Added: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultTransformation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultTransformation.java?rev=1675418&view=auto
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultTransformation.java
(added)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultTransformation.java
[UTF-8] Wed Apr 22 16:57:38 2015
@@ -0,0 +1,128 @@
+/*
+ * 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.referencing.operation;
+
+import java.util.Map;
+import org.opengis.referencing.operation.Transformation;
+import org.opengis.referencing.operation.OperationMethod;
+import org.opengis.referencing.operation.MathTransform;
+import org.opengis.referencing.crs.CoordinateReferenceSystem;
+
+
+/**
+ * A parameterized mathematical operation that transforms coordinates to another CRS with
a change of
+ * {@linkplain org.apache.sis.referencing.datum.AbstractDatum datum}.
+ * The parameters of a coordinate transformation are empirically derived from data containing
the coordinates of a
+ * series of points in both coordinate reference systems. This computational process is usually
"over-determined",
+ * allowing derivation of error (or {@linkplain #getCoordinateOperationAccuracy() accuracy})
estimates for the
+ * transformation. Also, the stochastic nature of the parameters may result in multiple (different)
+ * {@linkplain #getOperationVersion() versions} of the same coordinate transformation.
+ *
+ * <p>This coordinate operation contains an {@linkplain DefaultOperationMethod operation
method}, usually
+ * with associated parameter values. In the SIS default implementation, the parameter values
are inferred from the
+ * {@linkplain #getMathTransform() math transform}. Subclasses may have to override the {@link
#getParameterValues()}
+ * method if they need to provide a different set of parameters.</p>
+ *
+ * <div class="section">Immutability and thread safety</div>
+ * This base class is immutable and thus thread-safe if the property <em>values</em>
(not necessarily the map itself)
+ * given to the constructor are also immutable. Most SIS subclasses and related classes are
immutable under similar
+ * conditions. This means that unless otherwise noted in the javadoc, {@code CoordinateOperation}
instances created
+ * using only SIS factories and static constants can be shared by many objects and passed
between threads without
+ * synchronization.
+ *
+ * @author  Martin Desruisseaux (IRD, Geomatys)
+ * @since   0.6
+ * @version 0.6
+ * @module
+ *
+ * @see DefaultConversion
+ */
+public class DefaultTransformation extends AbstractSingleOperation implements Transformation
{
+    /**
+     * Serial number for inter-operability with different versions.
+     */
+    private static final long serialVersionUID = -7486704846151648971L;
+
+    /**
+     * Creates a coordinate transformation from the given properties.
+     * The properties given in argument follow the same rules than for the
+     * {@linkplain AbstractCoordinateOperation#AbstractCoordinateOperation(Map, CoordinateReferenceSystem,
+     * CoordinateReferenceSystem, CoordinateReferenceSystem, MathTransform) super-class constructor}.
+     * The following table is a reminder of main (not all) properties:
+     *
+     * <table class="sis">
+     *   <caption>Recognized properties (non exhaustive list)</caption>
+     *   <tr>
+     *     <th>Property name</th>
+     *     <th>Value type</th>
+     *     <th>Returned by</th>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value org.opengis.referencing.IdentifiedObject#NAME_KEY}</td>
+     *     <td>{@link org.opengis.metadata.Identifier} or {@link String}</td>
+     *     <td>{@link #getName()}</td>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value org.opengis.referencing.IdentifiedObject#IDENTIFIERS_KEY}</td>
+     *     <td>{@link org.opengis.metadata.Identifier} (optionally as array)</td>
+     *     <td>{@link #getIdentifiers()}</td>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value org.opengis.referencing.operation.CoordinateOperation#COORDINATE_OPERATION_ACCURACY_KEY}</td>
+     *     <td>{@link org.opengis.metadata.quality.PositionalAccuracy} (optionally
as array)</td>
+     *     <td>{@link #getCoordinateOperationAccuracy()}</td>
+     *   </tr>
+     *   <tr>
+     *     <td>{@value org.opengis.referencing.operation.CoordinateOperation#DOMAIN_OF_VALIDITY_KEY}</td>
+     *     <td>{@link org.opengis.metadata.extent.Extent}</td>
+     *     <td>{@link #getDomainOfValidity()}</td>
+     *   </tr>
+     * </table>
+     *
+     * @param properties The properties to be given to the identified object.
+     * @param sourceCRS  The source CRS.
+     * @param targetCRS  The target CRS.
+     * @param interpolationCRS The CRS of additional coordinates needed for the operation,
or {@code null} if none.
+     * @param method     The coordinate operation method (mandatory in all cases).
+     * @param transform  Transform from positions in the source CRS to positions in the target
CRS.
+     */
+    public DefaultTransformation(final Map<String,?>             properties,
+                                 final CoordinateReferenceSystem sourceCRS,
+                                 final CoordinateReferenceSystem targetCRS,
+                                 final CoordinateReferenceSystem interpolationCRS,
+                                 final OperationMethod           method,
+                                 final MathTransform             transform)
+    {
+        super(properties, sourceCRS, targetCRS, interpolationCRS, method, transform);
+    }
+
+    /**
+     * Returns the GeoAPI interface implemented by this class.
+     * The SIS implementation returns {@code Transformation.class}.
+     *
+     * <div class="note"><b>Note for implementors:</b>
+     * Subclasses usually do not need to override this method since GeoAPI does not define
{@code Transformation}
+     * sub-interface. Overriding possibility is left mostly for implementors who wish to
extend GeoAPI with their
+     * own set of interfaces.</div>
+     *
+     * @return {@code Transformation.class} or a user-defined sub-interface.
+     */
+    @Override
+    public Class<? extends Transformation> getInterface() {
+        return Transformation.class;
+    }
+}

Propchange: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultTransformation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultTransformation.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain;charset=UTF-8



Mime
View raw message