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 2019/02/13 18:49:10 UTC
[sis] 01/02: Replace some "ordinate" words by "coordinate",
following ISO 19111 policy. There is no code change in this commit,
except package-private fields renamed in PassThroughTransform.
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 60568da7ebb76debacca2db1a66eb19339e5d3fd
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Wed Feb 13 15:36:08 2019 +0100
Replace some "ordinate" words by "coordinate", following ISO 19111 policy.
There is no code change in this commit, except package-private fields renamed in PassThroughTransform.
---
.../org/apache/sis/io/wkt/MathTransformParser.java | 4 +-
.../java/org/apache/sis/geometry/Envelopes.java | 6 +-
.../operation/DefaultPassThroughOperation.java | 24 +--
.../sis/referencing/operation/matrix/Matrices.java | 44 +++---
.../transform/CoordinateSystemTransform.java | 2 +-
.../transform/DefaultMathTransformFactory.java | 24 +--
.../operation/transform/MathTransforms.java | 36 ++---
.../transform/MathTransformsOrFactory.java | 14 +-
.../operation/transform/PassThroughTransform.java | 176 ++++++++++-----------
.../transform/PassThroughTransform2D.java | 15 +-
.../operation/transform/TransformSeparator.java | 8 +-
.../transform/MathTransformFactoryBase.java | 4 +-
.../transform/MathTransformFactoryMock.java | 8 +-
.../transform/PassThroughTransformTest.java | 20 +--
.../transform/TransformSeparatorTest.java | 4 +-
.../org/apache/sis/storage/gdal/MTFactory.java | 2 +-
16 files changed, 195 insertions(+), 196 deletions(-)
diff --git a/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java b/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java
index 7d4e77d..da81f4d 100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/MathTransformParser.java
@@ -481,11 +481,11 @@ class MathTransformParser extends AbstractParser {
if (element == null) {
return null;
}
- final int firstAffectedOrdinate = parent.pullInteger("firstAffectedOrdinate");
+ final int firstAffectedCoordinate = parent.pullInteger("firstAffectedCoordinate");
final MathTransform transform = parseMathTransform(element, true);
element.close(ignoredElements);
try {
- return mtFactory.createPassThroughTransform(firstAffectedOrdinate, transform, 0);
+ return mtFactory.createPassThroughTransform(firstAffectedCoordinate, transform, 0);
} catch (FactoryException exception) {
throw element.parseFailed(exception);
}
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelopes.java b/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelopes.java
index a0988fc..d393aa7 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelopes.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/geometry/Envelopes.java
@@ -132,11 +132,11 @@ public final class Envelopes extends Static {
}
final GeneralEnvelope compound = new GeneralEnvelope(sum);
CoordinateReferenceSystem[] crsComponents = null;
- int firstAffectedOrdinate = 0;
+ int firstAffectedCoordinate = 0;
for (int i=0; i<components.length; i++) {
final Envelope env = components[i];
final int dim = env.getDimension();
- compound.subEnvelope(firstAffectedOrdinate, firstAffectedOrdinate += dim).setEnvelope(env);
+ compound.subEnvelope(firstAffectedCoordinate, firstAffectedCoordinate += dim).setEnvelope(env);
if (i == 0) {
final CoordinateReferenceSystem crs = env.getCoordinateReferenceSystem();
if (crs != null) {
@@ -149,7 +149,7 @@ public final class Envelopes extends Static {
}
}
}
- if (firstAffectedOrdinate != sum) {
+ if (firstAffectedCoordinate != sum) {
// Should never happen unless the number of dimensions of an envelope changed during iteration.
throw new ConcurrentModificationException();
}
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultPassThroughOperation.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultPassThroughOperation.java
index 8593199..9decaff 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultPassThroughOperation.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultPassThroughOperation.java
@@ -96,22 +96,22 @@ public class DefaultPassThroughOperation extends AbstractCoordinateOperation imp
* </tr>
* </table>
*
- * @param properties the properties to be given to the identified object.
- * @param sourceCRS the source CRS.
- * @param targetCRS the target CRS.
- * @param operation the operation to apply on the subset of a coordinate tuple.
- * @param firstAffectedOrdinate index of the first affected ordinate.
- * @param numTrailingOrdinates number of trailing ordinates to pass through.
+ * @param properties the properties to be given to the identified object.
+ * @param sourceCRS the source CRS.
+ * @param targetCRS the target CRS.
+ * @param operation the operation to apply on the subset of a coordinate tuple.
+ * @param firstAffectedCoordinate index of the first affected coordinate.
+ * @param numTrailingCoordinates number of trailing coordinates to pass through.
*/
public DefaultPassThroughOperation(final Map<String,?> properties,
final CoordinateReferenceSystem sourceCRS,
final CoordinateReferenceSystem targetCRS,
final CoordinateOperation operation,
- final int firstAffectedOrdinate,
- final int numTrailingOrdinates)
+ final int firstAffectedCoordinate,
+ final int numTrailingCoordinates)
{
super(properties, sourceCRS, targetCRS, null, MathTransforms.passThrough(
- firstAffectedOrdinate, operation.getMathTransform(), numTrailingOrdinates));
+ firstAffectedCoordinate, operation.getMathTransform(), numTrailingCoordinates));
ArgumentChecks.ensureNonNull("operation", operation);
this.operation = operation;
}
@@ -199,18 +199,18 @@ public class DefaultPassThroughOperation extends AbstractCoordinateOperation imp
*/
final CoordinateReferenceSystem sourceCRS = super.getSourceCRS();
if (sourceCRS instanceof CompoundCRS) {
- int firstAffectedOrdinate = 0;
+ int firstAffectedCoordinate = 0;
final CoordinateReferenceSystem search = operation.getSourceCRS();
for (final CoordinateReferenceSystem c : ((CompoundCRS) sourceCRS).getComponents()) {
final int dim = ReferencingUtilities.getDimension(c);
if (c == search) {
final int[] indices = new int[dim];
for (int i=0; i<dim; i++) {
- indices[i] = firstAffectedOrdinate + i;
+ indices[i] = firstAffectedCoordinate + i;
}
return indices;
}
- firstAffectedOrdinate += dim;
+ firstAffectedCoordinate += dim;
}
}
throw new UnsupportedImplementationException(transform.getClass());
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java
index eb8707a..e561bc3 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/matrix/Matrices.java
@@ -315,7 +315,7 @@ public final class Matrices extends Static {
* <li>If the destination envelope has less dimensions than the source envelope,
* then trailing dimensions are silently dropped.</li>
* <li>If the target envelope has more dimensions than the source envelope,
- * then the transform will append trailing ordinates with the 0 value.</li>
+ * then the transform will append trailing coordinates with the 0 value.</li>
* </ul>
*
* This method ignores the {@linkplain Envelope#getCoordinateReferenceSystem() envelope CRS}, which may be null.
@@ -595,12 +595,12 @@ public final class Matrices extends Static {
*
* <p>This method builds a new matrix with the following content:</p>
* <ul>
- * <li>An amount of {@code firstAffectedOrdinate} rows and columns are inserted before the first
+ * <li>An amount of {@code firstAffectedCoordinate} rows and columns are inserted before the first
* row and columns of the sub-matrix. The elements for the new rows and columns are set to 1
* on the diagonal, and 0 elsewhere.</li>
* <li>The sub-matrix - except for its last row and column - is copied in the new matrix starting
- * at index ({@code firstAffectedOrdinate}, {@code firstAffectedOrdinate}).</li>
- * <li>An amount of {@code numTrailingOrdinates} rows and columns are appended after the above sub-matrix.
+ * at index ({@code firstAffectedCoordinate}, {@code firstAffectedCoordinate}).</li>
+ * <li>An amount of {@code numTrailingCoordinates} rows and columns are appended after the above sub-matrix.
* Their elements are set to 1 on the pseudo-diagonal ending in the lower-right corner, and 0 elsewhere.</li>
* <li>The last sub-matrix row is copied in the last row of the new matrix, and the last sub-matrix column
* is copied in the last column of the sub-matrix.</li>
@@ -631,21 +631,21 @@ public final class Matrices extends Static {
* }
* </div>
*
- * @param firstAffectedOrdinate the lowest index of the affected ordinates.
- * @param subMatrix the matrix to use for affected ordinates.
- * @param numTrailingOrdinates number of trailing ordinates to pass through.
+ * @param firstAffectedCoordinate the lowest index of the affected coordinates.
+ * @param subMatrix the matrix to use for affected coordinates.
+ * @param numTrailingCoordinates number of trailing coordinates to pass through.
* @return a matrix for the same transform than the given matrix,
* augmented with leading and trailing pass-through coordinates.
*
* @see org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory#createPassThroughTransform(int, MathTransform, int)
*/
- public static MatrixSIS createPassThrough(final int firstAffectedOrdinate,
- final Matrix subMatrix, final int numTrailingOrdinates)
+ public static MatrixSIS createPassThrough(final int firstAffectedCoordinate,
+ final Matrix subMatrix, final int numTrailingCoordinates)
{
- ArgumentChecks.ensureNonNull ("subMatrix", subMatrix);
- ArgumentChecks.ensurePositive("firstAffectedOrdinate", firstAffectedOrdinate);
- ArgumentChecks.ensurePositive("numTrailingOrdinates", numTrailingOrdinates);
- final int expansion = firstAffectedOrdinate + numTrailingOrdinates;
+ ArgumentChecks.ensureNonNull ("subMatrix", subMatrix);
+ ArgumentChecks.ensurePositive("firstAffectedCoordinate", firstAffectedCoordinate);
+ ArgumentChecks.ensurePositive("numTrailingCoordinates", numTrailingCoordinates);
+ final int expansion = firstAffectedCoordinate + numTrailingCoordinates;
int sourceDimensions = subMatrix.getNumCol(); // Will become the number of dimensions later.
int targetDimensions = subMatrix.getNumRow();
/*
@@ -664,7 +664,7 @@ public final class Matrices extends Static {
* Following code processes from upper row to lower row.
* First, set the diagonal elements on leading new dimensions.
*/
- for (int j=0; j<firstAffectedOrdinate; j++) {
+ for (int j=0; j<firstAffectedCoordinate; j++) {
matrix.setElement(j, j, 1);
}
/*
@@ -673,19 +673,19 @@ public final class Matrices extends Static {
*/
final int lastColumn = sourceDimensions + expansion;
matrix.setElements(sources, length, stride, transfer,
- 0, 0, // Source (row, colum)
- firstAffectedOrdinate, firstAffectedOrdinate, // Target (row, column)
- targetDimensions, sourceDimensions); // Number of rows and columns to copy.
+ 0, 0, // Source (row, colum)
+ firstAffectedCoordinate, firstAffectedCoordinate, // Target (row, column)
+ targetDimensions, sourceDimensions); // Number of rows and columns to copy.
matrix.setElements(sources, length, stride, transfer,
- 0, sourceDimensions, // Source (row, colum): last column
- firstAffectedOrdinate, lastColumn, // Target (row, column): part of last column
- targetDimensions, 1); // Copy some rows of only 1 column.
+ 0, sourceDimensions, // Source (row, colum): last column
+ firstAffectedCoordinate, lastColumn, // Target (row, column): part of last column
+ targetDimensions, 1); // Copy some rows of only 1 column.
/*
* Set the pseudo-diagonal elements on the trailing new dimensions.
* 'diff' is zero for a square matrix and non-zero for rectangular matrix.
*/
final int diff = targetDimensions - sourceDimensions;
- for (int i=lastColumn - numTrailingOrdinates; i<lastColumn; i++) {
+ for (int i=lastColumn - numTrailingCoordinates; i<lastColumn; i++) {
matrix.setElement(diff + i, i, 1);
}
/*
@@ -695,7 +695,7 @@ public final class Matrices extends Static {
final int lastRow = targetDimensions + expansion;
matrix.setElements(sources, length, stride, transfer,
targetDimensions, 0, // Source (row, colum): last row
- lastRow, firstAffectedOrdinate, // Target (row, column): part of last row
+ lastRow, firstAffectedCoordinate, // Target (row, column): part of last row
1, sourceDimensions); // Copy some columns of only 1 row.
matrix.setElements(sources, length, stride, transfer,
targetDimensions, sourceDimensions,
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CoordinateSystemTransform.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CoordinateSystemTransform.java
index f09eeda..a773c3f 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CoordinateSystemTransform.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/CoordinateSystemTransform.java
@@ -69,7 +69,7 @@ abstract class CoordinateSystemTransform extends AbstractMathTransform {
private transient volatile MathTransform complete;
/**
- * The {@link #complete} transform in a {@link PassThroughTransform} with a 1 trailing ordinate.
+ * The {@link #complete} transform in a {@link PassThroughTransform} with a 1 trailing coordinate.
* This is used for supporting the cylindrical case on top the polar case.
*
* @see #passthrough(MathTransformFactory)
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
index 40cac83..5bdb172 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/DefaultMathTransformFactory.java
@@ -1139,9 +1139,9 @@ public class DefaultMathTransformFactory extends AbstractFactory implements Math
* the height unchanged from the base CRS to the target CRS. After this block, the
* dimensions of 'step2' and 'step3' should match.
*/
- final int numTrailingOrdinates = step3.getSourceDimensions() - step2.getTargetDimensions();
- if (numTrailingOrdinates > 0) {
- step2 = createPassThroughTransform(0, step2, numTrailingOrdinates);
+ final int numTrailingCoordinates = step3.getSourceDimensions() - step2.getTargetDimensions();
+ if (numTrailingCoordinates > 0) {
+ step2 = createPassThroughTransform(0, step2, numTrailingCoordinates);
}
/*
* If the source CS has a height but the target CS doesn't, drops the extra coordinates.
@@ -1327,27 +1327,27 @@ public class DefaultMathTransformFactory extends AbstractFactory implements Math
* The resulting transform will have the following dimensions:
*
* {@preformat java
- * Source: firstAffectedOrdinate + subTransform.getSourceDimensions() + numTrailingOrdinates
- * Target: firstAffectedOrdinate + subTransform.getTargetDimensions() + numTrailingOrdinates
+ * Source: firstAffectedCoordinate + subTransform.getSourceDimensions() + numTrailingCoordinates
+ * Target: firstAffectedCoordinate + subTransform.getTargetDimensions() + numTrailingCoordinates
* }
*
- * @param firstAffectedOrdinate the lowest index of the affected ordinates.
- * @param subTransform transform to use for affected ordinates.
- * @param numTrailingOrdinates number of trailing ordinates to pass through. Affected ordinates will range
- * from {@code firstAffectedOrdinate} inclusive to {@code dimTarget-numTrailingOrdinates} exclusive.
+ * @param firstAffectedCoordinate the lowest index of the affected coordinates.
+ * @param subTransform transform to use for affected coordinates.
+ * @param numTrailingCoordinates number of trailing coordinates to pass through. Affected coordinates will range
+ * from {@code firstAffectedCoordinate} inclusive to {@code dimTarget-numTrailingCoordinates} exclusive.
* @return a pass through transform.
* @throws FactoryException if the object creation failed.
*/
@Override
- public MathTransform createPassThroughTransform(final int firstAffectedOrdinate,
+ public MathTransform createPassThroughTransform(final int firstAffectedCoordinate,
final MathTransform subTransform,
- final int numTrailingOrdinates)
+ final int numTrailingCoordinates)
throws FactoryException
{
lastMethod.remove();
final MathTransform tr;
try {
- tr = MathTransforms.passThrough(firstAffectedOrdinate, subTransform, numTrailingOrdinates);
+ tr = MathTransforms.passThrough(firstAffectedCoordinate, subTransform, numTrailingCoordinates);
} catch (IllegalArgumentException exception) {
throw new InvalidGeodeticParameterException(exception.getLocalizedMessage(), exception);
}
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java
index 26495d3..6dbed36 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java
@@ -301,41 +301,41 @@ public final class MathTransforms extends Static {
* This method returns a transform having the following dimensions:
*
* {@preformat java
- * Source: firstAffectedOrdinate + subTransform.getSourceDimensions() + numTrailingOrdinates
- * Target: firstAffectedOrdinate + subTransform.getTargetDimensions() + numTrailingOrdinates
+ * Source: firstAffectedCoordinate + subTransform.getSourceDimensions() + numTrailingCoordinates
+ * Target: firstAffectedCoordinate + subTransform.getTargetDimensions() + numTrailingCoordinates
* }
*
- * Affected ordinates will range from {@code firstAffectedOrdinate} inclusive to
- * {@code dimTarget - numTrailingOrdinates} exclusive.
+ * Affected coordinates will range from {@code firstAffectedCoordinate} inclusive to
+ * {@code dimTarget - numTrailingCoordinates} exclusive.
*
- * @param firstAffectedOrdinate index of the first affected ordinate.
- * @param subTransform the sub-transform to apply on modified coordinates.
- * @param numTrailingOrdinates number of trailing ordinates to pass through.
+ * @param firstAffectedCoordinate index of the first affected coordinate.
+ * @param subTransform the sub-transform to apply on modified coordinates.
+ * @param numTrailingCoordinates number of trailing coordinates to pass through.
* @return a pass-through transform, potentially as a {@link PassThroughTransform} instance but not necessarily.
*
* @since 1.0
*/
- public static MathTransform passThrough(final int firstAffectedOrdinate,
+ public static MathTransform passThrough(final int firstAffectedCoordinate,
final MathTransform subTransform,
- final int numTrailingOrdinates)
+ final int numTrailingCoordinates)
{
- ArgumentChecks.ensureNonNull ("subTransform", subTransform);
- ArgumentChecks.ensurePositive("firstAffectedOrdinate", firstAffectedOrdinate);
- ArgumentChecks.ensurePositive("numTrailingOrdinates", numTrailingOrdinates);
- if (firstAffectedOrdinate == 0 && numTrailingOrdinates == 0) {
+ ArgumentChecks.ensureNonNull ("subTransform", subTransform);
+ ArgumentChecks.ensurePositive("firstAffectedCoordinate", firstAffectedCoordinate);
+ ArgumentChecks.ensurePositive("numTrailingCoordinates", numTrailingCoordinates);
+ if (firstAffectedCoordinate == 0 && numTrailingCoordinates == 0) {
return subTransform;
}
if (subTransform.isIdentity()) {
final int dimension = subTransform.getSourceDimensions();
if (dimension == subTransform.getTargetDimensions()) {
- return IdentityTransform.create(firstAffectedOrdinate + dimension + numTrailingOrdinates);
+ return IdentityTransform.create(firstAffectedCoordinate + dimension + numTrailingCoordinates);
}
}
final Matrix matrix = getMatrix(subTransform);
if (matrix != null) {
- return linear(PassThroughTransform.asMatrix(firstAffectedOrdinate, matrix, numTrailingOrdinates));
+ return linear(PassThroughTransform.asMatrix(firstAffectedCoordinate, matrix, numTrailingCoordinates));
} else {
- return PassThroughTransform.newInstance(firstAffectedOrdinate, subTransform, numTrailingOrdinates);
+ return PassThroughTransform.newInstance(firstAffectedCoordinate, subTransform, numTrailingCoordinates);
}
}
@@ -372,10 +372,10 @@ public final class MathTransforms extends Static {
sum += (dimensions[i] = tr.getSourceDimensions());
}
MathTransform compound = null;
- int firstAffectedOrdinate = 0;
+ int firstAffectedCoordinate = 0;
for (int i=0; i<components.length; i++) {
MathTransform tr = components[i];
- tr = passThrough(firstAffectedOrdinate, tr, sum - (firstAffectedOrdinate += dimensions[i]));
+ tr = passThrough(firstAffectedCoordinate, tr, sum - (firstAffectedCoordinate += dimensions[i]));
if (compound == null) {
compound = tr;
} else {
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransformsOrFactory.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransformsOrFactory.java
index 2bfc5f6..e5e3082 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransformsOrFactory.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransformsOrFactory.java
@@ -67,13 +67,13 @@ class MathTransformsOrFactory {
/**
* Creates a transform which passes through a subset of coordinates to another transform.
*
- * @param firstAffectedOrdinate index of the first affected ordinate.
- * @param subTransform the sub-transform to apply on modified coordinates.
- * @param numTrailingOrdinates number of trailing ordinates to pass through.
+ * @param firstAffectedCoordinate index of the first affected coordinate.
+ * @param subTransform the sub-transform to apply on modified coordinates.
+ * @param numTrailingCoordinates number of trailing coordinates to pass through.
* @return a pass-through transform, potentially as a {@link PassThroughTransform} instance but not necessarily.
*/
- MathTransform passThrough(int firstAffectedOrdinate, MathTransform subTransform, int numTrailingOrdinates) throws FactoryException {
- return MathTransforms.passThrough(firstAffectedOrdinate, subTransform, numTrailingOrdinates);
+ MathTransform passThrough(int firstAffectedCoordinate, MathTransform subTransform, int numTrailingCoordinates) throws FactoryException {
+ return MathTransforms.passThrough(firstAffectedCoordinate, subTransform, numTrailingCoordinates);
}
/**
@@ -117,8 +117,8 @@ class MathTransformsOrFactory {
}
/** Delegate to {@link MathTransformFactory#createPassThroughTransform(int, MathTransform, int)}. */
- @Override MathTransform passThrough(int firstAffectedOrdinate, MathTransform subTransform, int numTrailingOrdinates) throws FactoryException {
- return factory.createPassThroughTransform(firstAffectedOrdinate, subTransform, numTrailingOrdinates);
+ @Override MathTransform passThrough(int firstAffectedCoordinate, MathTransform subTransform, int numTrailingCoordinates) throws FactoryException {
+ return factory.createPassThroughTransform(firstAffectedCoordinate, subTransform, numTrailingCoordinates);
}
/** Delegate to {@link MathTransformFactory#createConcatenatedTransform(MathTransform, MathTransform)}. */
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
index 9fe1d1b..eedfe57 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform.java
@@ -41,7 +41,7 @@ import static org.apache.sis.util.ArgumentChecks.*;
/**
- * Transform which passes through a subset of ordinates to another transform.
+ * Transform which passes through a subset of coordinates to another transform.
* This allows transforms to operate on a subset of coordinate values.
*
* <div class="note"><b>Example:</b> giving (<var>latitude</var>, <var>longitude</var>, <var>height</var>) coordinates,
@@ -75,21 +75,21 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
/**
* Serial number for inter-operability with different versions.
*/
- private static final long serialVersionUID = -1673997634240223449L;
+ private static final long serialVersionUID = -910726602881388979L;
/**
- * Index of the first affected ordinate.
+ * Index of the first affected coordinate.
*
* @see #getModifiedCoordinates()
*/
- final int firstAffectedOrdinate;
+ final int firstAffectedCoordinate;
/**
- * Number of unaffected ordinates after the affected ones.
+ * Number of unaffected coordinates after the affected ones.
*
* @see #getModifiedCoordinates()
*/
- final int numTrailingOrdinates;
+ final int numTrailingCoordinates;
/**
* The sub-transform to apply on the {@linkplain #getModifiedCoordinates() modified coordinates}.
@@ -109,55 +109,55 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
* since the most optimal pass-through transform for the given {@code subTransform} is not necessarily
* a {@code PassThroughTransform} instance.
*
- * @param firstAffectedOrdinate index of the first affected ordinate.
- * @param subTransform the sub-transform to apply on modified coordinates.
- * @param numTrailingOrdinates number of trailing ordinates to pass through.
+ * @param firstAffectedCoordinate index of the first affected coordinate.
+ * @param subTransform the sub-transform to apply on modified coordinates.
+ * @param numTrailingCoordinates number of trailing coordinates to pass through.
*
* @see MathTransforms#passThrough(int, MathTransform, int)
*/
- protected PassThroughTransform(final int firstAffectedOrdinate,
+ protected PassThroughTransform(final int firstAffectedCoordinate,
final MathTransform subTransform,
- final int numTrailingOrdinates)
+ final int numTrailingCoordinates)
{
- ensurePositive("firstAffectedOrdinate", firstAffectedOrdinate);
- ensurePositive("numTrailingOrdinates", numTrailingOrdinates);
+ ensurePositive("firstAffectedCoordinate", firstAffectedCoordinate);
+ ensurePositive("numTrailingCoordinates", numTrailingCoordinates);
if (subTransform instanceof PassThroughTransform) {
final PassThroughTransform passThrough = (PassThroughTransform) subTransform;
- this.firstAffectedOrdinate = passThrough.firstAffectedOrdinate + firstAffectedOrdinate;
- this.numTrailingOrdinates = passThrough.numTrailingOrdinates + numTrailingOrdinates;
- this.subTransform = passThrough.subTransform;
+ this.firstAffectedCoordinate = passThrough.firstAffectedCoordinate + firstAffectedCoordinate;
+ this.numTrailingCoordinates = passThrough.numTrailingCoordinates + numTrailingCoordinates;
+ this.subTransform = passThrough.subTransform;
} else {
- this.firstAffectedOrdinate = firstAffectedOrdinate;
- this.numTrailingOrdinates = numTrailingOrdinates;
- this.subTransform = subTransform;
+ this.firstAffectedCoordinate = firstAffectedCoordinate;
+ this.numTrailingCoordinates = numTrailingCoordinates;
+ this.subTransform = subTransform;
}
}
/**
- * Creates a transform which passes through a subset of ordinates to another transform.
+ * Creates a transform which passes through a subset of coordinates to another transform.
* This method returns a transform having the following dimensions:
*
* {@preformat java
- * Source: firstAffectedOrdinate + subTransform.getSourceDimensions() + numTrailingOrdinates
- * Target: firstAffectedOrdinate + subTransform.getTargetDimensions() + numTrailingOrdinates
+ * Source: firstAffectedCoordinate + subTransform.getSourceDimensions() + numTrailingCoordinates
+ * Target: firstAffectedCoordinate + subTransform.getTargetDimensions() + numTrailingCoordinates
* }
*
- * Affected ordinates will range from {@code firstAffectedOrdinate} inclusive to
- * {@code dimTarget - numTrailingOrdinates} exclusive.
+ * Affected coordinates will range from {@code firstAffectedCoordinate} inclusive to
+ * {@code dimTarget - numTrailingCoordinates} exclusive.
*
- * @param firstAffectedOrdinate index of the first affected ordinate.
+ * @param firstAffectedCoordinate index of the first affected coordinate.
* @param subTransform the sub-transform to apply on modified coordinates.
- * @param numTrailingOrdinates number of trailing ordinates to pass through.
+ * @param numTrailingCoordinates number of trailing coordinates to pass through.
* @return a pass-through transform, not necessarily a {@code PassThroughTransform} instance.
*
* @deprecated Moved to {@link MathTransforms#passThrough(int, MathTransform, int)}.
*/
@Deprecated
- public static MathTransform create(final int firstAffectedOrdinate,
+ public static MathTransform create(final int firstAffectedCoordinate,
final MathTransform subTransform,
- final int numTrailingOrdinates)
+ final int numTrailingCoordinates)
{
- return MathTransforms.passThrough(firstAffectedOrdinate, subTransform, numTrailingOrdinates);
+ return MathTransforms.passThrough(firstAffectedCoordinate, subTransform, numTrailingCoordinates);
}
/**
@@ -165,8 +165,8 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
* instead of wrapping the sub-transform into a {@code PassThroughTransform} object. It is faster and easier
* to concatenate.
*/
- static Matrix asMatrix(final int firstAffectedOrdinate, final Matrix subTransform, final int numTrailingOrdinates) {
- return expand(MatrixSIS.castOrCopy(subTransform), firstAffectedOrdinate, numTrailingOrdinates, 1);
+ static Matrix asMatrix(final int firstAffectedCoordinate, final Matrix subTransform, final int numTrailingCoordinates) {
+ return expand(MatrixSIS.castOrCopy(subTransform), firstAffectedCoordinate, numTrailingCoordinates, 1);
}
/**
@@ -174,18 +174,18 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
* the constructor for the case where the sub-transform is already a {@code PassThroughTransform}.
* It is caller's responsibility to ensure that the argument values are valid.
*/
- static PassThroughTransform newInstance(final int firstAffectedOrdinate,
+ static PassThroughTransform newInstance(final int firstAffectedCoordinate,
final MathTransform subTransform,
- final int numTrailingOrdinates)
+ final int numTrailingCoordinates)
{
int dim = subTransform.getSourceDimensions();
if (subTransform.getTargetDimensions() == dim) {
- dim += firstAffectedOrdinate + numTrailingOrdinates;
+ dim += firstAffectedCoordinate + numTrailingCoordinates;
if (dim == 2) {
- return new PassThroughTransform2D(firstAffectedOrdinate, subTransform, numTrailingOrdinates);
+ return new PassThroughTransform2D(firstAffectedCoordinate, subTransform, numTrailingCoordinates);
}
}
- return new PassThroughTransform(firstAffectedOrdinate, subTransform, numTrailingOrdinates);
+ return new PassThroughTransform(firstAffectedCoordinate, subTransform, numTrailingCoordinates);
}
/**
@@ -196,7 +196,7 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
*/
@Override
public final int getSourceDimensions() {
- return firstAffectedOrdinate + subTransform.getSourceDimensions() + numTrailingOrdinates;
+ return firstAffectedCoordinate + subTransform.getSourceDimensions() + numTrailingCoordinates;
}
/**
@@ -207,7 +207,7 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
*/
@Override
public final int getTargetDimensions() {
- return firstAffectedOrdinate + subTransform.getTargetDimensions() + numTrailingOrdinates;
+ return firstAffectedCoordinate + subTransform.getTargetDimensions() + numTrailingCoordinates;
}
/**
@@ -215,8 +215,8 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
* coordinate tuple of the coordinates affected by this pass-through operation.
*
* <div class="note"><b>API note:</b> this method is final for now because most of Apache SIS code do
- * not use the {@code modifiedCoordinates} array. Instead, SIS uses the {@code firstAffectedOrdinate}
- * and {@code numTrailingOrdinates} information provided to the constructor. Consequently overriding
+ * not use the {@code modifiedCoordinates} array. Instead, SIS uses the {@code firstAffectedCoordinate}
+ * and {@code numTrailingCoordinates} information provided to the constructor. Consequently overriding
* this method may be misleading since it would be ignored by SIS. We do not want to make the "really
* used" fields public in order to keep the flexibility to replace them by a {@code modifiedCoordinates}
* array in a future SIS version.</div>
@@ -226,7 +226,7 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
* @see org.apache.sis.referencing.operation.DefaultPassThroughOperation#getModifiedCoordinates()
*/
public final int[] getModifiedCoordinates() {
- return ArraysExt.sequence(firstAffectedOrdinate, subTransform.getSourceDimensions());
+ return ArraysExt.sequence(firstAffectedCoordinate, subTransform.getSourceDimensions());
}
/**
@@ -298,7 +298,7 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
if (numPts <= 0) return;
final int subDimSource = subTransform.getSourceDimensions();
final int subDimTarget = subTransform.getTargetDimensions();
- final int numPassThrough = firstAffectedOrdinate + numTrailingOrdinates;
+ final int numPassThrough = firstAffectedCoordinate + numTrailingCoordinates;
final int dimSource = subDimSource + numPassThrough;
final int dimTarget = subDimTarget + numPassThrough;
/*
@@ -311,8 +311,8 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
final Object pasPts;
{
pasPts = newArray(srcPts, numPassThrough * numPts);
- System.arraycopy(srcPts, srcOff, pasPts, 0, firstAffectedOrdinate);
- int pasOff = firstAffectedOrdinate;
+ System.arraycopy(srcPts, srcOff, pasPts, 0, firstAffectedCoordinate);
+ int pasOff = firstAffectedCoordinate;
int srcCpk = srcOff + pasOff + subDimSource; // "Cpk" stands for "cherry-pick".
int n = numPts - 1;
while (--n >= 0) {
@@ -320,7 +320,7 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
pasOff += numPassThrough;
srcCpk += dimSource;
}
- System.arraycopy(srcPts, srcCpk, pasPts, pasOff, numTrailingOrdinates);
+ System.arraycopy(srcPts, srcCpk, pasPts, pasOff, numTrailingCoordinates);
}
/*
* Copy in a compact array the coordinates to be given to the sub-transform.
@@ -332,7 +332,7 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
Object subPts = dstPts;
{
int subOff = dstOff;
- int srcCpk = srcOff + firstAffectedOrdinate; // "Cpk" stands for "cherry-pick".
+ int srcCpk = srcOff + firstAffectedCoordinate; // "Cpk" stands for "cherry-pick".
int srcInc = dimSource;
int dstInc = subDimSource;
final IterationStrategy strategy;
@@ -386,8 +386,8 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
subOff += numPts * subDimTarget;
dstOff += numPts * dimTarget;
if (--numPts >= 0) {
- System.arraycopy(pasPts, pasOff -= numTrailingOrdinates,
- dstPts, dstOff -= numTrailingOrdinates, numTrailingOrdinates);
+ System.arraycopy(pasPts, pasOff -= numTrailingCoordinates,
+ dstPts, dstOff -= numTrailingCoordinates, numTrailingCoordinates);
System.arraycopy(subPts, subOff -= subDimTarget,
dstPts, dstOff -= subDimTarget, subDimTarget);
while (--numPts >= 0) {
@@ -396,8 +396,8 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
System.arraycopy(subPts, subOff -= subDimTarget,
dstPts, dstOff -= subDimTarget, subDimTarget);
}
- System.arraycopy(pasPts, pasOff - firstAffectedOrdinate,
- dstPts, dstOff - firstAffectedOrdinate, firstAffectedOrdinate);
+ System.arraycopy(pasPts, pasOff - firstAffectedCoordinate,
+ dstPts, dstOff - firstAffectedCoordinate, firstAffectedCoordinate);
}
}
@@ -433,13 +433,13 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
final int subDimSource = subTransform.getSourceDimensions();
final int subDimTarget = subTransform.getTargetDimensions();
while (--numPts >= 0) {
- for (int i=0; i < firstAffectedOrdinate; i++) {
+ for (int i=0; i < firstAffectedCoordinate; i++) {
dstPts[dstOff++] = (float) srcPts[srcOff++];
}
subTransform.transform(srcPts, srcOff, dstPts, dstOff, 1);
srcOff += subDimSource;
dstOff += subDimTarget;
- for (int i=0; i < numTrailingOrdinates; i++) {
+ for (int i=0; i < numTrailingCoordinates; i++) {
dstPts[dstOff++] = (float) srcPts[srcOff++];
}
}
@@ -457,13 +457,13 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
final int subDimSource = subTransform.getSourceDimensions();
final int subDimTarget = subTransform.getTargetDimensions();
while (--numPts >= 0) {
- for (int i=0; i < firstAffectedOrdinate; i++) {
+ for (int i=0; i < firstAffectedCoordinate; i++) {
dstPts[dstOff++] = srcPts[srcOff++];
}
subTransform.transform(srcPts, srcOff, dstPts, dstOff, 1);
srcOff += subDimSource;
dstOff += subDimTarget;
- for (int i=0; i < numTrailingOrdinates; i++) {
+ for (int i=0; i < numTrailingCoordinates; i++) {
dstPts[dstOff++] = srcPts[srcOff++];
}
}
@@ -477,15 +477,15 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
*/
@Override
public Matrix derivative(final DirectPosition point) throws TransformException {
- final int nSkipped = firstAffectedOrdinate + numTrailingOrdinates;
+ final int nSkipped = firstAffectedCoordinate + numTrailingCoordinates;
final int transDim = subTransform.getSourceDimensions();
ensureDimensionMatches("point", transDim + nSkipped, point);
final GeneralDirectPosition subPoint = new GeneralDirectPosition(transDim);
for (int i=0; i<transDim; i++) {
- subPoint.ordinates[i] = point.getOrdinate(i + firstAffectedOrdinate);
+ subPoint.ordinates[i] = point.getOrdinate(i + firstAffectedCoordinate);
}
return expand(MatrixSIS.castOrCopy(subTransform.derivative(subPoint)),
- firstAffectedOrdinate, numTrailingOrdinates, 0);
+ firstAffectedCoordinate, numTrailingCoordinates, 0);
}
/**
@@ -494,17 +494,17 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
* matrix returned by {@link #derivative}.
*
* @param subMatrix the sub-transform as a matrix.
- * @param firstAffectedOrdinate index of the first affected ordinate.
- * @param numTrailingOrdinates number of trailing ordinates to pass through.
+ * @param firstAffectedCoordinate index of the first affected coordinate.
+ * @param numTrailingCoordinates number of trailing coordinates to pass through.
* @param affine 0 if the matrix do not contains translation terms, or 1 if
* the matrix is an affine transform with translation terms.
*/
private static Matrix expand(final MatrixSIS subMatrix,
- final int firstAffectedOrdinate,
- final int numTrailingOrdinates,
+ final int firstAffectedCoordinate,
+ final int numTrailingCoordinates,
final int affine)
{
- final int nSkipped = firstAffectedOrdinate + numTrailingOrdinates;
+ final int nSkipped = firstAffectedCoordinate + numTrailingCoordinates;
final int numSubRow = subMatrix.getNumRow() - affine;
final int numSubCol = subMatrix.getNumCol() - affine;
final int numRow = numSubRow + (nSkipped + affine);
@@ -520,7 +520,7 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
* └ ┘
*/
final Integer ONE = 1;
- for (int j=0; j<firstAffectedOrdinate; j++) {
+ for (int j=0; j<firstAffectedCoordinate; j++) {
elements[j*numCol + j] = ONE;
}
/* ┌ ┐
@@ -537,8 +537,8 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
* We need to store the elements as Number, not as double, for giving to the matrix
* a chance to preserve the extra precision provided by DoubleDouble numbers.
*/
- elements[(j + firstAffectedOrdinate) * numCol // Contribution of row index
- + (i + firstAffectedOrdinate)] // Contribution of column index
+ elements[(j + firstAffectedCoordinate) * numCol // Contribution of row index
+ + (i + firstAffectedCoordinate)] // Contribution of column index
= subMatrix.getNumber(j, i);
}
}
@@ -553,17 +553,17 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
final int offset = numSubCol - numSubRow;
final int numRowOut = numSubRow + nSkipped;
final int numColOut = numSubCol + nSkipped;
- for (int j=numRowOut - numTrailingOrdinates; j<numRowOut; j++) {
+ for (int j=numRowOut - numTrailingCoordinates; j<numRowOut; j++) {
elements[j * numCol + (j + offset)] = ONE;
}
if (affine != 0) {
// Copy the translation terms in the last column.
for (int j=0; j<numSubRow; j++) {
- elements[(j + firstAffectedOrdinate) * numCol + numColOut] = subMatrix.getNumber(j, numSubCol);
+ elements[(j + firstAffectedCoordinate) * numCol + numColOut] = subMatrix.getNumber(j, numSubCol);
}
// Copy the last row as a safety, but it should contains only 0.
for (int i=0; i<numSubCol; i++) {
- elements[numRowOut * numCol + (i + firstAffectedOrdinate)] = subMatrix.getNumber(numSubRow, i);
+ elements[numRowOut * numCol + (i + firstAffectedCoordinate)] = subMatrix.getNumber(numSubRow, i);
}
// Copy the lower right corner, which should contains only 1.
elements[numRowOut * numCol + numColOut] = subMatrix.getNumber(numSubRow, numSubCol);
@@ -580,7 +580,7 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
@Override
public synchronized MathTransform inverse() throws NoninvertibleTransformException {
if (inverse == null) {
- inverse = new PassThroughTransform(firstAffectedOrdinate, subTransform.inverse(), numTrailingOrdinates);
+ inverse = new PassThroughTransform(firstAffectedCoordinate, subTransform.inverse(), numTrailingCoordinates);
inverse.inverse = this;
}
return inverse;
@@ -611,7 +611,7 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
* of the dimensions modified by the sub-transform, and not any other dimension.
*/
for (int j=numRow; --j>=0;) {
- final int sj = j - firstAffectedOrdinate;
+ final int sj = j - firstAffectedCoordinate;
for (int i=numCol; --i>=0;) {
final double element = matrix.getElement(j, i);
if (sj >= 0 && sj < subDim) {
@@ -621,7 +621,7 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
si = subDim;
copy = true;
} else { // Any term other than translation.
- si = i - firstAffectedOrdinate;
+ si = i - firstAffectedCoordinate;
copy = (si >= 0 && si < subDim);
}
if (copy) {
@@ -660,9 +660,9 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
final MathTransformsOrFactory proxy = MathTransformsOrFactory.wrap(factory);
if (other instanceof PassThroughTransform) {
final PassThroughTransform opt = (PassThroughTransform) other;
- if (opt.firstAffectedOrdinate == firstAffectedOrdinate && opt.numTrailingOrdinates == numTrailingOrdinates) {
+ if (opt.firstAffectedCoordinate == firstAffectedCoordinate && opt.numTrailingCoordinates == numTrailingCoordinates) {
final MathTransform sub = proxy.concatenate(applyOtherFirst, subTransform, opt.subTransform);
- return proxy.passThrough(firstAffectedOrdinate, sub, numTrailingOrdinates);
+ return proxy.passThrough(firstAffectedCoordinate, sub, numTrailingCoordinates);
}
}
final Matrix m = MathTransforms.getMatrix(other);
@@ -677,7 +677,7 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
if (sub != null) {
MathTransform tr = proxy.linear(sub);
tr = proxy.concatenate(applyOtherFirst, subTransform, tr);
- return proxy.passThrough(firstAffectedOrdinate, tr, numTrailingOrdinates);
+ return proxy.passThrough(firstAffectedCoordinate, tr, numTrailingCoordinates);
}
/*
* If this PassThroughTransform is followed by a matrix discarding some dimensions, identify which dimensions
@@ -703,7 +703,7 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
* can be keep or discarded on a case-by-case basis.
*/
final long fullTransformMask = maskLowBits(dimension);
- final long subTransformMask = maskLowBits(subTransform.getTargetDimensions()) << firstAffectedOrdinate;
+ final long subTransformMask = maskLowBits(subTransform.getTargetDimensions()) << firstAffectedCoordinate;
final boolean keepSubTransform = (retainedDimensions & subTransformMask) != 0;
if (keepSubTransform) {
retainedDimensions |= subTransformMask; // Ensure that we keep all sub-transform dimensions.
@@ -735,20 +735,20 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
* in number of dimensions. This change is represented by the 'change' integer computed above.
* We apply two strategies:
*
- * 1) If we keep the sub-transform, then the loop while surely sees the 'firstAffectedOrdinate'
+ * 1) If we keep the sub-transform, then the loop while surely sees the 'firstAffectedCoordinate'
* dimension since we ensured that we keep all sub-transform dimensions. When it happens, we
* add or remove bits at that point for the dimensionality changes.
*
- * 2) If we do not keep the sub-transform, then code inside 'if (dim == firstAffectedOrdinate)'
+ * 2) If we do not keep the sub-transform, then code inside 'if (dim == firstAffectedCoordinate)'
* should not have been executed. Instead we will adjust the indices after the loop.
*/
- final long leadPassThroughMask = maskLowBits(firstAffectedOrdinate);
+ final long leadPassThroughMask = maskLowBits(firstAffectedCoordinate);
final int numKeepAfter = Long.bitCount(retainedDimensions & ~(leadPassThroughMask | subTransformMask));
final int numKeepBefore = Long.bitCount(retainedDimensions & leadPassThroughMask);
final int[] indices = new int[Long.bitCount(retainedDimensions) + change];
for (int i=0; i<indices.length; i++) {
int dim = Long.numberOfTrailingZeros(retainedDimensions);
- if (dim == firstAffectedOrdinate) {
+ if (dim == firstAffectedCoordinate) {
if (change < 0) {
retainedDimensions >>>= -change; // Discard dimensions to skip.
retainedDimensions &= ~leadPassThroughMask; // Clear previous dimension flags.
@@ -763,7 +763,7 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
if (!keepSubTransform) {
for (int i=indices.length; --i >= 0;) {
final int dim = indices[i];
- if (dim <= firstAffectedOrdinate) break;
+ if (dim <= firstAffectedCoordinate) break;
indices[i] = dim - change;
}
}
@@ -807,9 +807,9 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
*/
@Override
protected int computeHashCode() {
- // Note that numTrailingOrdinates is related to source and
+ // Note that numTrailingCoordinates is related to source and
// target dimensions, which are computed by the super-class.
- return super.computeHashCode() ^ (subTransform.hashCode() + firstAffectedOrdinate);
+ return super.computeHashCode() ^ (subTransform.hashCode() + firstAffectedCoordinate);
}
/**
@@ -824,8 +824,8 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
}
if (super.equals(object, mode)) {
final PassThroughTransform that = (PassThroughTransform) object;
- return this.firstAffectedOrdinate == that.firstAffectedOrdinate &&
- this.numTrailingOrdinates == that.numTrailingOrdinates &&
+ return this.firstAffectedCoordinate == that.firstAffectedCoordinate &&
+ this.numTrailingCoordinates == that.numTrailingCoordinates &&
Utilities.deepEquals(this.subTransform, that.subTransform, mode);
}
return false;
@@ -845,12 +845,12 @@ public class PassThroughTransform extends AbstractMathTransform implements Seria
*/
@Override
protected String formatTo(final Formatter formatter) {
- formatter.append(firstAffectedOrdinate);
- if (numTrailingOrdinates != 0) {
- formatter.append(numTrailingOrdinates);
+ formatter.append(firstAffectedCoordinate);
+ if (numTrailingCoordinates != 0) {
+ formatter.append(numTrailingCoordinates);
}
formatter.append(subTransform);
- if (numTrailingOrdinates != 0) {
+ if (numTrailingCoordinates != 0) {
/*
* setInvalidWKT(…) shall be invoked only after we finished to format
* sub-transform, otherwise the wrong WKT element will be highlighted.
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform2D.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform2D.java
index a089c3e..4915513 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform2D.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/PassThroughTransform2D.java
@@ -44,15 +44,15 @@ final class PassThroughTransform2D extends PassThroughTransform implements MathT
/**
* Creates a pass through transform.
*
- * @param firstAffectedOrdinate index of the first affected ordinate.
- * @param subTransform the sub transform.
- * @param numTrailingOrdinates number of trailing ordinates to pass through.
+ * @param firstAffectedCoordinate index of the first affected coordinate.
+ * @param subTransform the sub transform.
+ * @param numTrailingCoordinates number of trailing coordinates to pass through.
*/
- PassThroughTransform2D(final int firstAffectedOrdinate,
+ PassThroughTransform2D(final int firstAffectedCoordinate,
final MathTransform subTransform,
- final int numTrailingOrdinates)
+ final int numTrailingCoordinates)
{
- super(firstAffectedOrdinate, subTransform, numTrailingOrdinates);
+ super(firstAffectedCoordinate, subTransform, numTrailingCoordinates);
}
/**
@@ -98,8 +98,7 @@ final class PassThroughTransform2D extends PassThroughTransform implements MathT
@Override
public synchronized MathTransform2D inverse() throws NoninvertibleTransformException {
if (inverse == null) {
- inverse = new PassThroughTransform2D(
- firstAffectedOrdinate, subTransform.inverse(), numTrailingOrdinates);
+ inverse = new PassThroughTransform2D(firstAffectedCoordinate, subTransform.inverse(), numTrailingCoordinates);
inverse.inverse = this;
}
return (MathTransform2D) inverse;
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/TransformSeparator.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/TransformSeparator.java
index 7486453..b2d07d8 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/TransformSeparator.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/TransformSeparator.java
@@ -525,7 +525,7 @@ public class TransformSeparator {
final PassThroughTransform passThrough = (PassThroughTransform) step;
final int numSubSrc = passThrough.subTransform.getSourceDimensions();
final int numNewDim = passThrough.subTransform.getTargetDimensions() - numSubSrc;
- final int subLower = passThrough.firstAffectedOrdinate;
+ final int subLower = passThrough.firstAffectedCoordinate;
final int subUpper = subLower + numSubSrc;
int[] subDimensions = new int[dimensions.length];
targetDimensions = null;
@@ -569,7 +569,7 @@ public class TransformSeparator {
* If all source dimensions not in the sub-transform are consecutive numbers, we can use our passthrough
* transform implementation. The "consecutive numbers" requirement (expressed in the 'if' statement below)
* is a consequence of a limitation in our current implementation: our current passthrough transform does
- * not accept arbitrary index for modified ordinates.
+ * not accept arbitrary indices for modified coordinates.
*/
if (containsAll(dimensions, lower, subLower) && containsAll(dimensions, subUpper, upper)) {
return factory.passThrough(subLower - lower, subTransform, Math.max(0, upper - subUpper));
@@ -682,7 +682,7 @@ reduce: for (int j=0; j <= numTgt; j++) {
int numRemoved = 0;
if (step instanceof PassThroughTransform) {
final PassThroughTransform passThrough = (PassThroughTransform) step;
- final int subLower = passThrough.firstAffectedOrdinate;
+ final int subLower = passThrough.firstAffectedCoordinate;
final int numSubTgt = passThrough.subTransform.getTargetDimensions();
if (!containsAny(dimensions, subLower, subLower + numSubTgt)) {
step = IdentityTransform.create(numTgt = numSrc);
@@ -778,7 +778,7 @@ reduce: for (int j=0; j <= numTgt; j++) {
}
/**
- * Returns {@code true} if the given sequence contains all index in the range {@code lower} inclusive
+ * Returns {@code true} if the given sequence contains all indices in the range {@code lower} inclusive
* to {@code upper} exclusive.
*
* @param sequence the {@link #sourceDimensions} or {@link #targetDimensions} sequence to test.
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryBase.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryBase.java
index 9799d4f..9ae7a42 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryBase.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryBase.java
@@ -36,7 +36,7 @@ import org.apache.sis.metadata.iso.citation.HardCodedCitations;
/**
* Skeleton for {@link MathTransformFactory} custom implementations.
- * Implementors need to override at least one method.
+ * Subclasses need to override at least one method.
*
* @author Martin Desruisseaux (Geomatys)
* @version 0.5
@@ -105,7 +105,7 @@ strictfp class MathTransformFactoryBase implements MathTransformFactory {
/** Default implementation throws an exception. */
@Override
- public MathTransform createPassThroughTransform(int firstAffectedOrdinate, MathTransform subTransform, int numTrailingOrdinates) throws FactoryException {
+ public MathTransform createPassThroughTransform(int firstAffectedCoordinate, MathTransform subTransform, int numTrailingCoordinates) throws FactoryException {
throw new FactoryException(MESSAGE);
}
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryMock.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryMock.java
index 3fe3530..0be16de 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryMock.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformFactoryMock.java
@@ -131,13 +131,13 @@ public final strictfp class MathTransformFactoryMock implements MathTransformFac
/**
* Unimplemented method.
*
- * @param firstAffectedOrdinate ignored.
- * @param subTransform ignored.
- * @param numTrailingOrdinates ignored.
+ * @param firstAffectedCoordinate ignored.
+ * @param subTransform ignored.
+ * @param numTrailingCoordinates ignored.
* @return never returned.
*/
@Override
- public MathTransform createPassThroughTransform(int firstAffectedOrdinate, MathTransform subTransform, int numTrailingOrdinates) {
+ public MathTransform createPassThroughTransform(int firstAffectedCoordinate, MathTransform subTransform, int numTrailingCoordinates) {
throw new UnsupportedOperationException();
}
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/PassThroughTransformTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/PassThroughTransformTest.java
index 2b6398b..e1605da 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/PassThroughTransformTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/PassThroughTransformTest.java
@@ -69,14 +69,14 @@ public final strictfp class PassThroughTransformTest extends MathTransformTestCa
fail("An illegal argument should have been detected");
} catch (IllegalArgumentException e) {
final String message = e.getMessage();
- assertTrue(message, message.contains("firstAffectedOrdinate"));
+ assertTrue(message, message.contains("firstAffectedCoordinate"));
}
try {
MathTransforms.passThrough(0, subTransform, -1);
fail("An illegal argument should have been detected");
} catch (IllegalArgumentException e) {
final String message = e.getMessage();
- assertTrue(message, message.contains("numTrailingOrdinates"));
+ assertTrue(message, message.contains("numTrailingCoordinates"));
}
}
@@ -152,13 +152,13 @@ public final strictfp class PassThroughTransformTest extends MathTransformTestCa
{
random = TestUtilities.createRandomNumberGenerator();
/*
- * Test many combinations of "first affected ordinate" and "number of trailing ordinates" parameters.
+ * Test many combinations of "first affected coordinate" and "number of trailing coordinates" parameters.
* For each combination we create a passthrough transform, test it with the 'verifyTransform' method.
*/
- for (int firstAffectedOrdinate=0; firstAffectedOrdinate<=3; firstAffectedOrdinate++) {
- for (int numTrailingOrdinates=0; numTrailingOrdinates<=3; numTrailingOrdinates++) {
- final int numAdditionalOrdinates = firstAffectedOrdinate + numTrailingOrdinates;
- transform = MathTransforms.passThrough(firstAffectedOrdinate, subTransform, numTrailingOrdinates);
+ for (int firstAffectedCoordinate=0; firstAffectedCoordinate<=3; firstAffectedCoordinate++) {
+ for (int numTrailingCoordinates=0; numTrailingCoordinates<=3; numTrailingCoordinates++) {
+ final int numAdditionalOrdinates = firstAffectedCoordinate + numTrailingCoordinates;
+ transform = MathTransforms.passThrough(firstAffectedCoordinate, subTransform, numTrailingCoordinates);
if (numAdditionalOrdinates == 0) {
assertSame("Failed to recognize that no passthrough was needed.", subTransform, transform);
continue;
@@ -169,7 +169,7 @@ public final strictfp class PassThroughTransformTest extends MathTransformTestCa
subTransform.getSourceDimensions() + numAdditionalOrdinates, transform.getSourceDimensions());
assertEquals ("Wrong number of target dimensions.",
subTransform.getTargetDimensions() + numAdditionalOrdinates, transform.getTargetDimensions());
- verifyTransform(subTransform, firstAffectedOrdinate);
+ verifyTransform(subTransform, firstAffectedCoordinate);
}
}
}
@@ -288,8 +288,8 @@ public final strictfp class PassThroughTransformTest extends MathTransformTestCa
* The number of pass-through dimensions have decreased from 2 to 1 on both sides of the sub-transform.
*/
final PassThroughTransform reduced = (PassThroughTransform) steps.get(1);
- assertEquals("firstAffectedOrdinate", 1, reduced.firstAffectedOrdinate);
- assertEquals("numTrailingOrdinates", 1, reduced.numTrailingOrdinates);
+ assertEquals("firstAffectedCoordinate", 1, reduced.firstAffectedCoordinate);
+ assertEquals("numTrailingCoordinates", 1, reduced.numTrailingCoordinates);
assertSame ("subTransform", ps.subTransform, reduced.subTransform);
/*
* We still have to remove source dimensions 2 and 3. Since we removed dimension 0 in previous step,
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransformSeparatorTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransformSeparatorTest.java
index 743cfbe..47d5c44 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransformSeparatorTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/TransformSeparatorTest.java
@@ -312,8 +312,8 @@ public final strictfp class TransformSeparatorTest extends TestCase {
assertArrayEquals("targetDimensions", new int[] {1, 2, 3, 4, 5, 6}, s.getTargetDimensions());
assertInstanceOf ("separate()", PassThroughTransform.class, result);
assertSame ("subTransform", nonLinear, ((PassThroughTransform) result).subTransform);
- assertEquals("firstAffectedOrdinate", 1, ((PassThroughTransform) result).firstAffectedOrdinate);
- assertEquals("numTrailingOrdinates", 2, ((PassThroughTransform) result).numTrailingOrdinates);
+ assertEquals("firstAffectedCoordinate", 1, ((PassThroughTransform) result).firstAffectedCoordinate);
+ assertEquals("numTrailingCoordinates", 2, ((PassThroughTransform) result).numTrailingCoordinates);
}
/**
diff --git a/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/MTFactory.java b/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/MTFactory.java
index e80d27c..c6bfdf7 100644
--- a/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/MTFactory.java
+++ b/storage/sis-gdal/src/test/java/org/apache/sis/storage/gdal/MTFactory.java
@@ -165,7 +165,7 @@ class MTFactory extends Proj4Factory implements CoordinateOperationFactory, Math
* Unsupported by the {@literal Proj.4} wrapper.
*/
@Override
- public MathTransform createPassThroughTransform(int firstAffectedOrdinate, MathTransform subTransform, int numTrailingOrdinates)
+ public MathTransform createPassThroughTransform(int firstAffectedCoordinate, MathTransform subTransform, int numTrailingCoordinates)
throws FactoryException
{
throw new UnsupportedOperationException();