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/06/10 15:55:01 UTC
[sis] 02/02: Rename Utilities.equalsApproximatively(…) as Utilities.equalsApproximately(…). https://issues.apache.org/jira/browse/SIS-440
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 f6909310857d617f8708b5033f7eed16a58d4daf
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Mon Jun 10 17:53:47 2019 +0200
Rename Utilities.equalsApproximatively(…) as Utilities.equalsApproximately(…).
https://issues.apache.org/jira/browse/SIS-440
---
.../sis/internal/referencing/DefinitionVerifier.java | 14 +++++++-------
.../operation/CoordinateOperationRegistry.java | 8 ++++----
.../provider/CoordinateFrameRotationTest.java | 2 +-
.../referencing/provider/GeocentricTranslationTest.java | 4 ++--
.../referencing/provider/PositionVector7ParamTest.java | 2 +-
.../operation/DefaultCoordinateOperationFactoryTest.java | 2 +-
.../operation/projection/AlbersEqualAreaTest.java | 6 +++---
.../operation/projection/CylindricalEqualAreaTest.java | 4 ++--
.../operation/projection/LambertConicConformalTest.java | 2 +-
.../operation/projection/MapProjectionTestCase.java | 2 +-
.../referencing/operation/projection/MercatorTest.java | 2 +-
.../referencing/operation/projection/MollweideTest.java | 4 ++--
.../operation/projection/ObliqueMercatorTest.java | 4 ++--
.../operation/projection/ObliqueStereographicTest.java | 2 +-
.../operation/projection/PolarStereographicTest.java | 4 ++--
.../referencing/operation/projection/PolyconicTest.java | 4 ++--
.../referencing/operation/projection/SinusoidalTest.java | 4 ++--
.../operation/projection/TransverseMercatorTest.java | 4 ++--
.../transform/AbridgedMolodenskyTransformTest.java | 2 +-
.../transform/EllipsoidToCentricTransformTest.java | 8 ++++----
.../transform/InterpolatedGeocentricTransformTest.java | 4 ++--
.../operation/transform/MolodenskyTransformTest.java | 2 +-
.../src/main/java/org/apache/sis/util/Utilities.java | 16 +++++++++++++---
23 files changed, 58 insertions(+), 48 deletions(-)
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/DefinitionVerifier.java b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/DefinitionVerifier.java
index 183eb62..baee026 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/DefinitionVerifier.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/DefinitionVerifier.java
@@ -250,23 +250,23 @@ public final class DefinitionVerifier {
while (authoritative.hasNext() && given.hasNext()) {
final SingleCRS crsA = authoritative.next();
final SingleCRS crsG = given.next();
- if (!Utilities.equalsApproximatively(crsA, crsG)) {
+ if (!Utilities.equalsApproximately(crsA, crsG)) {
if (crsA instanceof GeneralDerivedCRS && crsG instanceof GeneralDerivedCRS) {
final Conversion cnvA = ((GeneralDerivedCRS) crsA).getConversionFromBase();
final Conversion cnvG = ((GeneralDerivedCRS) crsG).getConversionFromBase();
- if (!Utilities.equalsApproximatively(cnvA, cnvG)) {
- return Utilities.equalsApproximatively(cnvA.getMethod(), cnvG.getMethod()) ? CONVERSION : METHOD;
+ if (!Utilities.equalsApproximately(cnvA, cnvG)) {
+ return Utilities.equalsApproximately(cnvA.getMethod(), cnvG.getMethod()) ? CONVERSION : METHOD;
}
}
- if (!Utilities.equalsApproximatively(crsA.getCoordinateSystem(), crsG.getCoordinateSystem())) {
+ if (!Utilities.equalsApproximately(crsA.getCoordinateSystem(), crsG.getCoordinateSystem())) {
return CS;
}
final Datum datumA = crsA.getDatum();
final Datum datumG = crsG.getDatum();
- if (!Utilities.equalsApproximatively(datumA, datumG)) {
+ if (!Utilities.equalsApproximately(datumA, datumG)) {
if ((datumA instanceof GeodeticDatum) && (datumG instanceof GeodeticDatum) &&
- !Utilities.equalsApproximatively(((GeodeticDatum) datumA).getPrimeMeridian(),
- ((GeodeticDatum) datumG).getPrimeMeridian()))
+ !Utilities.equalsApproximately(((GeodeticDatum) datumA).getPrimeMeridian(),
+ ((GeodeticDatum) datumG).getPrimeMeridian()))
{
return PRIME_MERIDIAN;
}
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java
index 70bca5f..7f3b92d 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java
@@ -765,8 +765,8 @@ class CoordinateOperationRegistry {
* while the user-provided CRS can be anything (e.g. parsed from a quite approximated WKT).
*/
CoordinateReferenceSystem crs;
- if (Utilities.equalsApproximatively(sourceCRS, crs = operation.getSourceCRS())) sourceCRS = crs;
- if (Utilities.equalsApproximatively(targetCRS, crs = operation.getTargetCRS())) targetCRS = crs;
+ if (Utilities.equalsApproximately(sourceCRS, crs = operation.getSourceCRS())) sourceCRS = crs;
+ if (Utilities.equalsApproximately(targetCRS, crs = operation.getTargetCRS())) targetCRS = crs;
final Map<String,Object> properties = new HashMap<>(derivedFrom(operation));
/*
* Determine whether the operation to create is a Conversion or a Transformation
@@ -831,8 +831,8 @@ class CoordinateOperationRegistry {
final ParameterValueGroup parameters = operation.getParameterValues();
if (parameters != null) {
CoordinateReferenceSystem crs;
- if (Utilities.equalsApproximatively(sourceCRS, crs = operation.getSourceCRS())) sourceCRS = crs;
- if (Utilities.equalsApproximatively(targetCRS, crs = operation.getTargetCRS())) targetCRS = crs;
+ if (Utilities.equalsApproximately(sourceCRS, crs = operation.getSourceCRS())) sourceCRS = crs;
+ if (Utilities.equalsApproximately(targetCRS, crs = operation.getTargetCRS())) targetCRS = crs;
final MathTransformFactory mtFactory = factorySIS.getMathTransformFactory();
if (mtFactory instanceof DefaultMathTransformFactory) {
MathTransform mt = ((DefaultMathTransformFactory) mtFactory).createParameterizedTransform(
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateFrameRotationTest.java b/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateFrameRotationTest.java
index c3dfb09..d24fd55 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateFrameRotationTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/CoordinateFrameRotationTest.java
@@ -77,7 +77,7 @@ public final strictfp class CoordinateFrameRotationTest extends MathTransformTes
@Test
@DependsOnMethod("testGeocentricDomain")
public void testGeographicDomain() throws FactoryException, TransformException {
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres
derivativeDeltas = new double[] {delta, delta, 100}; // (Δλ, Δφ, Δh)
tolerance = Formulas.ANGULAR_TOLERANCE;
zTolerance = Formulas.LINEAR_TOLERANCE;
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/GeocentricTranslationTest.java b/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/GeocentricTranslationTest.java
index bbf4db9..a9e0c49 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/GeocentricTranslationTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/GeocentricTranslationTest.java
@@ -259,7 +259,7 @@ public final strictfp class GeocentricTranslationTest extends MathTransformTestC
public void testGeographicDomain() throws FactoryException, TransformException {
create(new GeocentricTranslation3D());
assertFalse(transform instanceof LinearTransform);
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres
derivativeDeltas = new double[] {delta, delta, 100}; // (Δλ, Δφ, Δh)
zTolerance = Formulas.LINEAR_TOLERANCE / 2; // Half the precision of h value given by EPSG
zDimension = new int[] {2}; // Dimension of h where to apply zTolerance
@@ -286,7 +286,7 @@ public final strictfp class GeocentricTranslationTest extends MathTransformTestC
-FranceGeocentricInterpolation.TY,
-FranceGeocentricInterpolation.TZ);
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres
derivativeDeltas = new double[] {delta, delta, 100}; // (Δλ, Δφ, Δh)
tolerance = FranceGeocentricInterpolationTest.ANGULAR_TOLERANCE;
zTolerance = 0.005; // Half the precision of the target[2] value set below.
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/PositionVector7ParamTest.java b/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/PositionVector7ParamTest.java
index ae46011..7a1ee4b 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/PositionVector7ParamTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/PositionVector7ParamTest.java
@@ -133,7 +133,7 @@ public final strictfp class PositionVector7ParamTest extends MathTransformTestCa
@Test
@DependsOnMethod("testGeocentricDomain")
public void testGeographicDomain() throws FactoryException, TransformException {
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres
derivativeDeltas = new double[] {delta, delta, 100}; // (Δλ, Δφ, Δh)
tolerance = Formulas.ANGULAR_TOLERANCE;
zTolerance = Formulas.LINEAR_TOLERANCE;
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactoryTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactoryTest.java
index ec1f784..0658839 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactoryTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactoryTest.java
@@ -318,7 +318,7 @@ public final strictfp class DefaultCoordinateOperationFactoryTest extends MathTr
tolerance = 1;
assertFalse("Mercator to Google should not be an identity transform.", transform.isIdentity());
- final DirectPosition2D sourcePt = new DirectPosition2D(334000, 4840000); // Approximatively 40°N 3°W
+ final DirectPosition2D sourcePt = new DirectPosition2D(334000, 4840000); // Approximately 40°N 3°W
final DirectPosition2D targetPt = new DirectPosition2D();
assertSame(targetPt, transform.transform(sourcePt, targetPt));
assertEquals("Easting should be unchanged", sourcePt.getX(), targetPt.getX(), STRICT);
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/AlbersEqualAreaTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/AlbersEqualAreaTest.java
index 139f930..0392c23 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/AlbersEqualAreaTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/AlbersEqualAreaTest.java
@@ -72,7 +72,7 @@ public final strictfp class AlbersEqualAreaTest extends MapProjectionTestCase {
0, // False easting
0); // False northing
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres.
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres.
derivativeDeltas = new double[] {delta, delta};
toleranceModifier = ToleranceModifier.PROJECTION;
tolerance = Formulas.LINEAR_TOLERANCE;
@@ -121,7 +121,7 @@ public final strictfp class AlbersEqualAreaTest extends MapProjectionTestCase {
0, // False easting
0); // False northing
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres.
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres.
derivativeDeltas = new double[] {delta, delta};
toleranceModifier = ToleranceModifier.PROJECTION;
tolerance = Formulas.LINEAR_TOLERANCE;
@@ -247,7 +247,7 @@ public final strictfp class AlbersEqualAreaTest extends MapProjectionTestCase {
tolerance = Formulas.LINEAR_TOLERANCE;
toleranceModifier = ToleranceModifier.PROJECTION;
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres.
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres.
derivativeDeltas = new double[] {delta, delta};
verifyInDomain(new double[] {-40, 10}, // Minimal input ordinate values
new double[] {+40, 60}, // Maximal input ordinate values
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/CylindricalEqualAreaTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/CylindricalEqualAreaTest.java
index 73c555f..4998d6e 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/CylindricalEqualAreaTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/CylindricalEqualAreaTest.java
@@ -46,7 +46,7 @@ public final strictfp class CylindricalEqualAreaTest extends MapProjectionTestCa
* @throws TransformException if an error occurred while projecting a point.
*/
private void testDerivative() throws TransformException {
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres.
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres.
derivativeDeltas = new double[] {delta, delta};
tolerance = 1E-6; // More severe than Formulas.LINEAR_TOLERANCE.
verifyDerivative(toRadians(15), toRadians( 30));
@@ -167,7 +167,7 @@ public final strictfp class CylindricalEqualAreaTest extends MapProjectionTestCa
tolerance = Formulas.LINEAR_TOLERANCE;
toleranceModifier = ToleranceModifier.PROJECTION;
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres.
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres.
derivativeDeltas = new double[] {delta, delta};
verifyInDomain(CoordinateDomain.GEOGRAPHIC_SAFE, 0);
}
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/LambertConicConformalTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/LambertConicConformalTest.java
index 32b0450..b0a266b 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/LambertConicConformalTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/LambertConicConformalTest.java
@@ -169,7 +169,7 @@ public final strictfp class LambertConicConformalTest extends MapProjectionTestC
if (transform == null) { // May have been initialized by 'testSphericalCase'.
createNormalizedProjection(true, 40); // Elliptical case
}
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres.
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres.
derivativeDeltas = new double[] {delta, delta};
tolerance = 1E-9;
verifyDerivative(toRadians( 0), toRadians( 0));
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java
index fc8d8c5..0385c7b 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MapProjectionTestCase.java
@@ -211,7 +211,7 @@ abstract strictfp class MapProjectionTestCase extends MathTransformTestCase {
{
transform = ProjectionResultComparator.sphericalAndEllipsoidal(transform);
if (derivativeDeltas == null) {
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres.
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres.
derivativeDeltas = new double[] {delta, delta};
}
verifyInDomain(domain, randomSeed);
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java
index 7c4fd6e..90c9422 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java
@@ -166,7 +166,7 @@ public final strictfp class MercatorTest extends MapProjectionTestCase {
if (transform == null) { // May have been initialized by 'testSphericalCase'.
createNormalizedProjection(true); // Elliptical case
}
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres.
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres.
derivativeDeltas = new double[] {delta, delta};
tolerance = 1E-9; // More severe than Formulas.LINEAR_TOLERANCE.
verifyDerivative(toRadians(15), toRadians( 30));
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MollweideTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MollweideTest.java
index 325554a..98e83ec 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MollweideTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MollweideTest.java
@@ -141,7 +141,7 @@ public final strictfp class MollweideTest extends MapProjectionTestCase {
public void testInverseDerivative() throws FactoryException, TransformException {
createProjection(false);
transform = transform.inverse();
- derivativeDeltas = new double[] {100, 100}; // Approximatively 100 metres.
+ derivativeDeltas = new double[] {100, 100}; // Approximately 100 metres.
tolerance = Formulas.ANGULAR_TOLERANCE;
verifyDerivative( 912759.823, 5873471.956);
verifyDerivative(-7622861.357, -7774469.608);
@@ -158,7 +158,7 @@ public final strictfp class MollweideTest extends MapProjectionTestCase {
@DependsOnMethod("testInverseDerivative")
public void testDerivative() throws FactoryException, TransformException {
createProjection(false);
- final double delta = (100.0 / 60) / 1852; // Approximatively 100 metres.
+ final double delta = (100.0 / 60) / 1852; // Approximately 100 metres.
derivativeDeltas = new double[] {delta, delta};
tolerance = 1E-6; // More severe than Formulas.LINEAR_TOLERANCE.
verifyDerivative(15, 30);
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ObliqueMercatorTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ObliqueMercatorTest.java
index 7086fee..67e8d70 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ObliqueMercatorTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ObliqueMercatorTest.java
@@ -71,7 +71,7 @@ public final strictfp class ObliqueMercatorTest extends MapProjectionTestCase {
transform = create(5, 10, 20);
validate();
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres.
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres.
derivativeDeltas = new double[] {delta, delta};
verifyDerivative(toRadians( 0), toRadians( 0));
verifyDerivative(toRadians(15), toRadians(30));
@@ -90,7 +90,7 @@ public final strictfp class ObliqueMercatorTest extends MapProjectionTestCase {
transform = create(10, 20, 90);
validate();
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres.
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres.
derivativeDeltas = new double[] {delta, delta};
verifyInverse(toRadians(15), toRadians(25));
}
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ObliqueStereographicTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ObliqueStereographicTest.java
index 859967a..a4050df 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ObliqueStereographicTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/ObliqueStereographicTest.java
@@ -352,7 +352,7 @@ public final strictfp class ObliqueStereographicTest extends MapProjectionTestCa
createNormalizedProjection(true);
tolerance = 1E-9;
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres.
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres.
derivativeDeltas = new double[] {delta, delta};
verifyDerivative(toRadians( 0), toRadians( 0));
verifyDerivative(toRadians(-3), toRadians(30));
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/PolarStereographicTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/PolarStereographicTest.java
index ec67d1f..4d99553 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/PolarStereographicTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/PolarStereographicTest.java
@@ -68,7 +68,7 @@ public final strictfp class PolarStereographicTest extends MapProjectionTestCase
@Test
public void testSphericalCaseSouth() throws FactoryException, TransformException {
createNormalizedProjection(new PolarStereographicSouth());
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres.
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres.
derivativeDeltas = new double[] {delta, delta};
verifyInDomain(CoordinateDomain.GEOGRAPHIC_RADIANS_SOUTH, 56763886);
}
@@ -84,7 +84,7 @@ public final strictfp class PolarStereographicTest extends MapProjectionTestCase
@DependsOnMethod("testSphericalCaseSouth")
public void testSphericalCaseNorth() throws FactoryException, TransformException {
createNormalizedProjection(new PolarStereographicNorth());
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres.
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres.
derivativeDeltas = new double[] {delta, delta};
verifyInDomain(CoordinateDomain.GEOGRAPHIC_RADIANS_NORTH, 56763886);
}
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/PolyconicTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/PolyconicTest.java
index 7ffe0d5..9f1cbe9 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/PolyconicTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/PolyconicTest.java
@@ -114,7 +114,7 @@ public final strictfp class PolyconicTest extends MapProjectionTestCase {
@DependsOnMethod("testInverseDerivative")
public void testDerivativeOnSphere() throws FactoryException, TransformException {
createProjection(false);
- final double delta = (1.0 / 60) / 1852; // Approximatively 1 metre.
+ final double delta = (1.0 / 60) / 1852; // Approximately 1 metre.
derivativeDeltas = new double[] {delta, delta};
tolerance = Formulas.LINEAR_TOLERANCE / 10;
verifyDerivative(-100, 3);
@@ -133,7 +133,7 @@ public final strictfp class PolyconicTest extends MapProjectionTestCase {
@DependsOnMethod("testInverseDerivative")
public void testDerivativeOnEllipsoid() throws FactoryException, TransformException {
createProjection(true);
- final double delta = (1.0 / 60) / 1852; // Approximatively 1 metre.
+ final double delta = (1.0 / 60) / 1852; // Approximately 1 metre.
derivativeDeltas = new double[] {delta, delta};
tolerance = Formulas.LINEAR_TOLERANCE / 10;
verifyDerivative(-100, 3);
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/SinusoidalTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/SinusoidalTest.java
index 2ce6ffc..743e844 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/SinusoidalTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/SinusoidalTest.java
@@ -104,7 +104,7 @@ public final strictfp class SinusoidalTest extends MapProjectionTestCase {
@DependsOnMethod("testInverseDerivative")
public void testDerivativeOnSphere() throws FactoryException, TransformException {
createProjection(false);
- final double delta = (1.0 / 60) / 1852; // Approximatively 1 metre.
+ final double delta = (1.0 / 60) / 1852; // Approximately 1 metre.
derivativeDeltas = new double[] {delta, delta};
tolerance = Formulas.LINEAR_TOLERANCE / 10000;
verifyDerivative(105, 30);
@@ -122,7 +122,7 @@ public final strictfp class SinusoidalTest extends MapProjectionTestCase {
@DependsOnMethod("testInverseDerivative")
public void testDerivativeOnEllipsoid() throws FactoryException, TransformException {
createProjection(true);
- final double delta = (1.0 / 60) / 1852; // Approximatively 1 metre.
+ final double delta = (1.0 / 60) / 1852; // Approximately 1 metre.
derivativeDeltas = new double[] {delta, delta};
tolerance = Formulas.LINEAR_TOLERANCE / 10000;
verifyDerivative(105, 30);
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/TransverseMercatorTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/TransverseMercatorTest.java
index bc79bb3..164d1ac 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/TransverseMercatorTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/TransverseMercatorTest.java
@@ -129,7 +129,7 @@ public final strictfp class TransverseMercatorTest extends MapProjectionTestCase
createNormalizedProjection(false, 0);
tolerance = 1E-9;
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres.
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres.
derivativeDeltas = new double[] {delta, delta};
verifyDerivative(toRadians( 0), toRadians( 0));
verifyDerivative(toRadians(-3), toRadians(30));
@@ -146,7 +146,7 @@ public final strictfp class TransverseMercatorTest extends MapProjectionTestCase
createNormalizedProjection(true, 0);
tolerance = 1E-9;
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres.
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres.
derivativeDeltas = new double[] {delta, delta};
verifyDerivative(toRadians( 0), toRadians( 0));
verifyDerivative(toRadians(-3), toRadians(30));
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/AbridgedMolodenskyTransformTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/AbridgedMolodenskyTransformTest.java
index abebea9..eafcca3 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/AbridgedMolodenskyTransformTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/AbridgedMolodenskyTransformTest.java
@@ -49,7 +49,7 @@ public final strictfp class AbridgedMolodenskyTransformTest extends MathTransfor
* Creates a new test case.
*/
public AbridgedMolodenskyTransformTest() {
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres
derivativeDeltas = new double[] {delta, delta}; // (Δλ, Δφ)
λDimension = new int[] {0}; // Dimension for which to ignore ±360° differences.
tolerance = Formulas.ANGULAR_TOLERANCE; // Tolerance for longitude and latitude in degrees
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/EllipsoidToCentricTransformTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/EllipsoidToCentricTransformTest.java
index 6edd76b..f6c2339 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/EllipsoidToCentricTransformTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/EllipsoidToCentricTransformTest.java
@@ -91,7 +91,7 @@ public final strictfp class EllipsoidToCentricTransformTest extends MathTransfor
isInverseTransformSupported = false; // Geocentric to geographic is not the purpose of this test.
validate();
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres
derivativeDeltas = new double[] {delta, delta, 100}; // (Δλ, Δφ, Δh)
tolerance = GeocentricTranslationTest.precision(2); // Half the precision of target sample point
verifyTransform(GeocentricTranslationTest.samplePoint(1), // 53°48'33.820"N, 02°07'46.380"E, 73.00 metres
@@ -132,7 +132,7 @@ public final strictfp class EllipsoidToCentricTransformTest extends MathTransfor
"testGeocentricToGeographic"
})
public void testRandomPoints() throws FactoryException, TransformException {
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres
derivativeDeltas = new double[] {delta, delta, 100}; // (Δλ, Δφ, Δh)
tolerance = Formulas.LINEAR_TOLERANCE;
toleranceModifier = ToleranceModifier.PROJECTION;
@@ -177,7 +177,7 @@ public final strictfp class EllipsoidToCentricTransformTest extends MathTransfor
* Derivative of the direct transform.
*/
tolerance = 1E-2;
- derivativeDeltas = new double[] {toRadians(1.0 / 60) / 1852}; // Approximatively one metre.
+ derivativeDeltas = new double[] {toRadians(1.0 / 60) / 1852}; // Approximately one metre.
verifyDerivative(point.getCoordinate());
/*
* Derivative of the inverse transform.
@@ -185,7 +185,7 @@ public final strictfp class EllipsoidToCentricTransformTest extends MathTransfor
point = transform.transform(point, null);
transform = transform.inverse();
tolerance = 1E-8;
- derivativeDeltas = new double[] {1}; // Approximatively one metre.
+ derivativeDeltas = new double[] {1}; // Approximately one metre.
verifyDerivative(point.getCoordinate());
}
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/InterpolatedGeocentricTransformTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/InterpolatedGeocentricTransformTest.java
index b0b5960..4f9e2e0 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/InterpolatedGeocentricTransformTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/InterpolatedGeocentricTransformTest.java
@@ -128,7 +128,7 @@ public strictfp class InterpolatedGeocentricTransformTest extends MathTransformT
public void testForwardDerivative() throws FactoryException, TransformException {
createGeodeticTransformation();
transform = transform.inverse();
- final double delta = (100.0 / 60) / 1852; // Approximatively 100 metres.
+ final double delta = (100.0 / 60) / 1852; // Approximately 100 metres.
derivativeDeltas = new double[] {delta, delta};
tolerance = 1E-5; // Empirical value.
verifyDerivative(FranceGeocentricInterpolationTest.samplePoint(1));
@@ -145,7 +145,7 @@ public strictfp class InterpolatedGeocentricTransformTest extends MathTransformT
@DependsOnMethod("testInverseTransform")
public void testInverseDerivative() throws FactoryException, TransformException {
createGeodeticTransformation();
- final double delta = (100.0 / 60) / 1852; // Approximatively 100 metres.
+ final double delta = (100.0 / 60) / 1852; // Approximately 100 metres.
derivativeDeltas = new double[] {delta, delta};
tolerance = 1E-5; // Empirical value.
verifyDerivative(FranceGeocentricInterpolationTest.samplePoint(3));
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MolodenskyTransformTest.java b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MolodenskyTransformTest.java
index 256511c..ddfecfe 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MolodenskyTransformTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MolodenskyTransformTest.java
@@ -76,7 +76,7 @@ public final strictfp class MolodenskyTransformTest extends MathTransformTestCas
* Creates a new test case.
*/
public MolodenskyTransformTest() {
- final double delta = toRadians(100.0 / 60) / 1852; // Approximatively 100 metres
+ final double delta = toRadians(100.0 / 60) / 1852; // Approximately 100 metres
derivativeDeltas = new double[] {delta, delta, 100}; // (Δλ, Δφ, Δh)
λDimension = new int[] {0}; // Dimension for which to ignore ±360° differences.
zDimension = new int[] {2}; // Dimension of h where to apply zTolerance
diff --git a/core/sis-utility/src/main/java/org/apache/sis/util/Utilities.java b/core/sis-utility/src/main/java/org/apache/sis/util/Utilities.java
index aacaccb..d11a357 100644
--- a/core/sis-utility/src/main/java/org/apache/sis/util/Utilities.java
+++ b/core/sis-utility/src/main/java/org/apache/sis/util/Utilities.java
@@ -58,7 +58,7 @@ public final class Utilities extends Static {
* </ul>
*
* If a more lenient comparison allowing slight differences in numerical values is wanted,
- * then {@link #equalsApproximatively(Object, Object)} can be used instead.
+ * then {@link #equalsApproximately(Object, Object)} can be used instead.
*
* <div class="section">Implementation note</div>
* This is a convenience method for the following method call:
@@ -108,11 +108,21 @@ public final class Utilities extends Static {
* @see #deepEquals(Object, Object, ComparisonMode)
* @see ComparisonMode#APPROXIMATE
*/
- public static boolean equalsApproximatively(final Object object1, final Object object2) {
+ public static boolean equalsApproximately(final Object object1, final Object object2) {
return deepEquals(object1, object2, ComparisonMode.APPROXIMATE);
}
/**
+ * @deprecated Renamed {@link #equalsApproximately(Object, Object)}.
+ *
+ * @see <a href="https://issues.apache.org/jira/browse/SIS-440">SIS-440</a>
+ */
+ @Deprecated
+ public static boolean equalsApproximatively(final Object object1, final Object object2) {
+ return equalsApproximately(object1, object2);
+ }
+
+ /**
* Convenience method for testing two objects for equality using the given level of strictness.
* If at least one of the given objects implement the {@link LenientComparable} interface, then
* the comparison is performed using the {@link LenientComparable#equals(Object, ComparisonMode)}
@@ -127,7 +137,7 @@ public final class Utilities extends Static {
* @return {@code true} if both objects are equal for the given level of strictness.
*
* @see #equalsIgnoreMetadata(Object, Object)
- * @see #equalsApproximatively(Object, Object)
+ * @see #equalsApproximately(Object, Object)
*/
public static boolean deepEquals(final Object object1, final Object object2, final ComparisonMode mode) {
if (object1 == object2) {