You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2020/07/06 14:56:29 UTC
[sis] 01/03: Deprecate
DefaultOperationMethod.getSource/TargetDimensions(). Those attributes have
been removed from ISO 19111:2019. Removing them from SIS would reduce
complexity in management of OperationMethods working on variable number of
dimensions.
This is an automated email from the ASF dual-hosted git repository.
desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git
commit f7d3c80edf1d5c1ec10caeb755ce3dd2cc337828
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Mon Jul 6 12:13:07 2020 +0200
Deprecate DefaultOperationMethod.getSource/TargetDimensions(). Those attributes have been removed from ISO 19111:2019.
Removing them from SIS would reduce complexity in management of OperationMethods working on variable number of dimensions.
---
.../sis/internal/referencing/provider/Affine.java | 3 ++
.../referencing/provider/GeodeticOperation.java | 6 ++++
.../referencing/provider/MapProjection.java | 6 ++++
.../referencing/provider/MapProjection3D.java | 9 ++++++
.../operation/DefaultOperationMethod.java | 37 +++++++++++++++++++++-
.../referencing/provider/ProviderMock.java | 4 +--
6 files changed, 62 insertions(+), 3 deletions(-)
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java
index 348b637..f44fb3b 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Affine.java
@@ -212,8 +212,11 @@ public final class Affine extends AbstractProvider {
* @param sourceDimensions the desired number of input dimensions.
* @param targetDimensions the desired number of output dimensions.
* @return the redimensioned operation method, or {@code this} if no change is needed.
+ *
+ * @deprecated ISO 19111:2019 removed source/target dimensions attributes.
*/
@Override
+ @Deprecated
public OperationMethod redimension(final int sourceDimensions, final int targetDimensions) {
return getProvider(sourceDimensions, targetDimensions, false);
}
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeodeticOperation.java b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeodeticOperation.java
index 9367b3f..d57b33c 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeodeticOperation.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeodeticOperation.java
@@ -53,7 +53,10 @@ abstract class GeodeticOperation extends AbstractProvider {
*
* <strong>Do not modify this array after construction</strong>, since the same array is shared by many
* objects and there is no synchronization.
+ *
+ * @deprecated ISO 19111:2019 removed source/target dimensions attributes.
*/
+ @Deprecated
final GeodeticOperation[] redimensioned;
/**
@@ -100,8 +103,11 @@ abstract class GeodeticOperation extends AbstractProvider {
* @param sourceDimensions the desired number of input dimensions.
* @param targetDimensions the desired number of output dimensions.
* @return the redimensioned operation method, or {@code null} if none.
+ *
+ * @deprecated ISO 19111:2019 removed source/target dimensions attributes.
*/
@Override
+ @Deprecated
public final OperationMethod redimension(final int sourceDimensions, final int targetDimensions) {
if (redimensioned != null && (sourceDimensions & ~1) == 2 && (targetDimensions & ~1) == 2) {
final GeodeticOperation m = redimensioned[((sourceDimensions & 1) << 1) | (targetDimensions & 1)];
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java
index e7a1394..6094b46 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java
@@ -174,7 +174,10 @@ public abstract class MapProjection extends AbstractProvider {
*
* @see #redimension(int, int)
* @see GeodeticOperation#redimensioned
+ *
+ * @deprecated ISO 19111:2019 removed source/target dimensions attributes.
*/
+ @Deprecated
private OperationMethod redimensioned;
/**
@@ -204,8 +207,11 @@ public abstract class MapProjection extends AbstractProvider {
* @return the redimensioned projection method, or {@code this} if no change is needed.
*
* @since 0.8
+ *
+ * @deprecated ISO 19111:2019 removed source/target dimensions attributes.
*/
@Override
+ @Deprecated
public final OperationMethod redimension(final int sourceDimensions, final int targetDimensions) {
if (sourceDimensions != 3 || targetDimensions != 3) {
return super.redimension(sourceDimensions, targetDimensions);
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection3D.java b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection3D.java
index 5d8983f..0796416 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection3D.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection3D.java
@@ -33,7 +33,10 @@ import org.opengis.util.FactoryException;
* @version 0.8
* @since 0.8
* @module
+ *
+ * @deprecated ISO 19111:2019 removed source/target dimensions attributes.
*/
+@Deprecated
@XmlTransient
final class MapProjection3D extends AbstractProvider {
/**
@@ -43,7 +46,10 @@ final class MapProjection3D extends AbstractProvider {
/**
* The two-dimensional counterpart of this three-dimensional map projection.
+ *
+ * @deprecated ISO 19111:2019 removed source/target dimensions attributes.
*/
+ @Deprecated
private final MapProjection redimensioned;
/**
@@ -57,8 +63,11 @@ final class MapProjection3D extends AbstractProvider {
/**
* Returns this operation method with the specified number of dimensions.
* The number of dimensions can be only 2 or 3, and must be the same for source and target CRS.
+ *
+ * @deprecated ISO 19111:2019 removed source/target dimensions attributes.
*/
@Override
+ @Deprecated
public OperationMethod redimension(final int sourceDimensions, final int targetDimensions) {
if (sourceDimensions == 2 && targetDimensions == 2) {
return redimensioned;
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
index f50d2a4..94c68b2 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultOperationMethod.java
@@ -117,7 +117,7 @@ import static org.apache.sis.util.ArgumentChecks.*;
* {@link org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory}.
*
* @author Martin Desruisseaux (IRD, Geomatys)
- * @version 0.7
+ * @version 1.1
*
* @see DefaultConversion
* @see DefaultTransformation
@@ -166,7 +166,10 @@ public class DefaultOperationMethod extends AbstractIdentifiedObject implements
* This field is modified only at unmarshalling time by {@link #setSourceDimensions(Integer)}</p>
*
* @see #getSourceDimensions()
+ *
+ * @deprecated ISO 19111:2019 removed source/target dimensions attributes.
*/
+ @Deprecated
private Integer sourceDimensions;
/**
@@ -178,7 +181,10 @@ public class DefaultOperationMethod extends AbstractIdentifiedObject implements
* This field is modified only at unmarshalling time by {@link #setTargetDimensions(Integer)}</p>
*
* @see #getTargetDimensions()
+ *
+ * @deprecated ISO 19111:2019 removed source/target dimensions attributes.
*/
+ @Deprecated
private Integer targetDimensions;
/**
@@ -232,6 +238,19 @@ public class DefaultOperationMethod extends AbstractIdentifiedObject implements
* </tr>
* </table>
*
+ * @param properties set of properties. Shall contain at least {@code "name"}.
+ * @param parameters description of parameters expected by this operation.
+ *
+ * @since 1.1
+ */
+ public DefaultOperationMethod(final Map<String,?> properties,
+ final ParameterDescriptorGroup parameters)
+ {
+ this(properties, null, null, parameters);
+ }
+
+ /**
+ * Constructs an operation method for the given number of dimensions.
* The source and target dimensions may be {@code null} if this method can work
* with any number of dimensions (e.g. <cite>Affine Transform</cite>).
*
@@ -239,7 +258,10 @@ public class DefaultOperationMethod extends AbstractIdentifiedObject implements
* @param sourceDimensions number of dimensions in the source CRS of this operation method, or {@code null}.
* @param targetDimensions number of dimensions in the target CRS of this operation method, or {@code null}.
* @param parameters description of parameters expected by this operation.
+ *
+ * @deprecated ISO 19111:2019 removed "source dimensions" and "target dimensions" attributes.
*/
+ @Deprecated
public DefaultOperationMethod(final Map<String,?> properties,
final Integer sourceDimensions,
final Integer targetDimensions,
@@ -450,7 +472,11 @@ public class DefaultOperationMethod extends AbstractIdentifiedObject implements
* @return the redimensioned operation method, or {@code null} if the given method was null,
* or {@code method} if no change is needed.
* @throws IllegalArgumentException if the given dimensions are illegal for the given operation method.
+ *
+ * @deprecated Not needed anymore since ISO 19111:2019 removed the
+ * "source dimensions" and "target dimensions" attributes.
*/
+ @Deprecated
public static OperationMethod redimension(OperationMethod method,
final int sourceDimensions, final int targetDimensions)
{
@@ -489,7 +515,10 @@ public class DefaultOperationMethod extends AbstractIdentifiedObject implements
* @throws IllegalArgumentException if the given dimensions are illegal for this operation method.
*
* @since 0.6
+ *
+ * @deprecated ISO 19111:2019 removed source/target dimensions attributes.
*/
+ @Deprecated
public OperationMethod redimension(final int sourceDimensions, final int targetDimensions) {
return redimension(this, sourceDimensions, this.sourceDimensions,
targetDimensions, this.targetDimensions);
@@ -568,8 +597,11 @@ public class DefaultOperationMethod extends AbstractIdentifiedObject implements
* @return the dimension of source CRS, or {@code null} if unknown.
*
* @see org.apache.sis.referencing.operation.transform.AbstractMathTransform#getSourceDimensions()
+ *
+ * @deprecated This attribute has been removed from ISO 19111:2019.
*/
@Override
+ @Deprecated
@XmlElement(name = "sourceDimensions")
@XmlSchemaType(name = "positiveInteger")
public Integer getSourceDimensions() {
@@ -583,8 +615,11 @@ public class DefaultOperationMethod extends AbstractIdentifiedObject implements
* @return the dimension of target CRS, or {@code null} if unknown.
*
* @see org.apache.sis.referencing.operation.transform.AbstractMathTransform#getTargetDimensions()
+ *
+ * @deprecated This attribute has been removed from ISO 19111:2019.
*/
@Override
+ @Deprecated
@XmlElement(name = "targetDimensions")
@XmlSchemaType(name = "positiveInteger")
public Integer getTargetDimensions() {
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProviderMock.java b/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProviderMock.java
index 1ab8e13..1d03d13 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProviderMock.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProviderMock.java
@@ -59,8 +59,8 @@ abstract strictfp class ProviderMock extends AbstractProvider {
@Override
public final MathTransform createMathTransform(MathTransformFactory factory, ParameterValueGroup parameters) {
return new AbstractMathTransform() {
- @Override public int getSourceDimensions() {return ProviderMock.this.getSourceDimensions();}
- @Override public int getTargetDimensions() {return ProviderMock.this.getTargetDimensions();}
+ @Override @Deprecated public int getSourceDimensions() {return ProviderMock.this.getSourceDimensions();}
+ @Override @Deprecated public int getTargetDimensions() {return ProviderMock.this.getTargetDimensions();}
@Override
public Matrix transform(double[] srcPts, int srcOff, double[] dstPts, int dstOff, boolean derivate) {
throw new UnsupportedOperationException();