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 2024/02/21 15:14:11 UTC
(sis) branch geoapi-4.0 updated (ee6e4b795c -> 7812f5c6af)
This is an automated email from the ASF dual-hosted git repository.
desruisseaux pushed a change to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git
from ee6e4b795c Use a separated option for enabling tests on the PostgreSQL database.
new a62860a7a5 Make the code more robust to absence of EPSG database.
new 7812f5c6af Add units of measurement for knot and tonne.
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../apache/sis/referencing/IdentifiedObjects.java | 7 ++-
.../operation/CoordinateOperationRegistry.java | 32 +++++++------
.../sis/storage/geotiff/writer/GeoEncoder.java | 17 ++++++-
.../org/apache/sis/measure/UnitNames.properties | 2 +
.../apache/sis/measure/UnitNames_en_US.properties | 1 +
.../org/apache/sis/measure/UnitNames_fr.properties | 1 +
.../main/org/apache/sis/measure/Units.java | 53 ++++++++++++++++++++--
.../org/apache/sis/measure/UnitFormatTest.java | 2 +
.../test/org/apache/sis/measure/UnitsTest.java | 7 +--
9 files changed, 97 insertions(+), 25 deletions(-)
(sis) 01/02: Make the code more robust to absence of EPSG database.
Posted by de...@apache.org.
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 a62860a7a5aa17688d67b14af1ccdd01be14c53f
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Wed Feb 21 15:15:50 2024 +0100
Make the code more robust to absence of EPSG database.
---
.../apache/sis/referencing/IdentifiedObjects.java | 7 +++--
.../operation/CoordinateOperationRegistry.java | 32 ++++++++++++----------
.../sis/storage/geotiff/writer/GeoEncoder.java | 17 +++++++++++-
3 files changed, 38 insertions(+), 18 deletions(-)
diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/IdentifiedObjects.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/IdentifiedObjects.java
index 9586af09ce..3ab9c02293 100644
--- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/IdentifiedObjects.java
+++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/IdentifiedObjects.java
@@ -50,6 +50,7 @@ import org.apache.sis.metadata.internal.NameToIdentifier;
import org.apache.sis.metadata.iso.citation.Citations;
import org.apache.sis.referencing.factory.IdentifiedObjectFinder;
import org.apache.sis.referencing.factory.GeodeticAuthorityFactory;
+import org.apache.sis.referencing.factory.UnavailableFactoryException;
import org.apache.sis.referencing.factory.NoSuchAuthorityFactoryException;
// Specific to the geoapi-3.1 and geoapi-4.0 branches:
@@ -443,7 +444,8 @@ public final class IdentifiedObjects extends Static {
* @param authority the authority for the identifier to return, or {@code null} for
* the first identifier regardless its authority.
* @return the identifier, or {@code null} if none was found without ambiguity or if the given object was null.
- * @throws FactoryException if an error occurred during the search.
+ * @throws UnavailableFactoryException if the factory for the authority identified in the URN is not available.
+ * @throws FactoryException if the lookup failed for another reason.
*
* @see #newFinder(String)
* @see #toURN(Class, Identifier)
@@ -561,7 +563,8 @@ public final class IdentifiedObjects extends Static {
* @param object the object (usually a {@linkplain org.apache.sis.referencing.crs.AbstractCRS
* coordinate reference system}) whose EPSG code is to be found, or {@code null}.
* @return the EPSG code, or {@code null} if none was found without ambiguity or if the given object was null.
- * @throws FactoryException if an error occurred during the search.
+ * @throws UnavailableFactoryException if the EPSG factory is not available.
+ * @throws FactoryException if the lookup failed for another reason.
*
* @see #newFinder(String)
*
diff --git a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java
index 0c47339489..2ca694b97a 100644
--- a/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java
+++ b/endorsed/src/org.apache.sis.referencing/main/org/apache/sis/referencing/operation/CoordinateOperationRegistry.java
@@ -57,6 +57,7 @@ import org.apache.sis.referencing.operation.transform.MathTransforms;
import org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory;
import org.apache.sis.referencing.factory.IdentifiedObjectFinder;
import org.apache.sis.referencing.factory.GeodeticAuthorityFactory;
+import org.apache.sis.referencing.factory.UnavailableFactoryException;
import org.apache.sis.referencing.factory.MissingFactoryResourceException;
import org.apache.sis.referencing.factory.InvalidGeodeticParameterException;
import org.apache.sis.referencing.factory.NoSuchAuthorityFactoryException;
@@ -169,7 +170,7 @@ class CoordinateOperationRegistry {
* @see #authorityCodes
* @see #findCode(CoordinateReferenceSystem)
*/
- private final IdentifiedObjectFinder codeFinder;
+ private IdentifiedObjectFinder codeFinder;
/**
* The factory to use for creating operations as defined by authority, or {@code null} if none.
@@ -265,9 +266,6 @@ class CoordinateOperationRegistry {
@SuppressWarnings("LocalVariableHidesMemberVariable")
Map<CoordinateReferenceSystem, List<String>> authorityCodes = Collections.emptyMap();
-
- @SuppressWarnings("LocalVariableHidesMemberVariable")
- IdentifiedObjectFinder codeFinder = null;
if (registry != null) {
if (registry instanceof GeodeticAuthorityFactory) {
codeFinder = ((GeodeticAuthorityFactory) registry).newIdentifiedObjectFinder();
@@ -280,7 +278,6 @@ class CoordinateOperationRegistry {
authorityCodes = new IdentityHashMap<>(5); // Rarely more than 4 entries.
}
}
- this.codeFinder = codeFinder;
this.authorityCodes = authorityCodes;
if (context != null) {
areaOfInterest = context.getAreaOfInterest();
@@ -308,7 +305,7 @@ class CoordinateOperationRegistry {
/**
* Finds the authority codes for the given coordinate reference system.
- * This method does not trust the code given by the user in its CRS - we verify it.
+ * This method does not trust the code given by the user in the CRS - it verifies it.
* This method may return codes even if the axis order does not match;
* it will be caller's responsibility to make necessary adjustments.
*
@@ -329,17 +326,22 @@ class CoordinateOperationRegistry {
: IdentifiedObjectFinder.Domain.VALID_DATASET);
int matchCount = 0;
final Citation authority = registry.getAuthority();
- for (final IdentifiedObject candidate : codeFinder.find(crs)) {
- final Identifier identifier = IdentifiedObjects.getIdentifier(candidate, authority);
- if (identifier != null) {
- final String code = identifier.getCode();
- if (Utilities.deepEquals(candidate, crs, ComparisonMode.APPROXIMATE)) {
- // If axis order matches, give precedence to that CRS.
- codes.add(matchCount++, code);
- } else {
- codes.add(code);
+ try {
+ for (final IdentifiedObject candidate : codeFinder.find(crs)) {
+ final Identifier identifier = IdentifiedObjects.getIdentifier(candidate, authority);
+ if (identifier != null) {
+ final String code = identifier.getCode();
+ if (Utilities.deepEquals(candidate, crs, ComparisonMode.APPROXIMATE)) {
+ // If axis order matches, give precedence to that CRS.
+ codes.add(matchCount++, code);
+ } else {
+ codes.add(code);
+ }
}
}
+ } catch (UnavailableFactoryException e) {
+ log(null, e);
+ codeFinder = null;
}
authorityCodes.put(crs, codes);
}
diff --git a/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/writer/GeoEncoder.java b/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/writer/GeoEncoder.java
index 0124b98495..25c445efbc 100644
--- a/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/writer/GeoEncoder.java
+++ b/endorsed/src/org.apache.sis.storage.geotiff/main/org/apache/sis/storage/geotiff/writer/GeoEncoder.java
@@ -18,6 +18,7 @@ package org.apache.sis.storage.geotiff.writer;
import java.util.List;
import java.util.EnumMap;
+import java.util.logging.Level;
import static javax.imageio.plugins.tiff.GeoTIFFTagSet.TAG_GEO_ASCII_PARAMS;
import static javax.imageio.plugins.tiff.GeoTIFFTagSet.TAG_GEO_DOUBLE_PARAMS;
import javax.measure.Unit;
@@ -56,6 +57,7 @@ import org.apache.sis.referencing.IdentifiedObjects;
import org.apache.sis.referencing.cs.CoordinateSystems;
import org.apache.sis.referencing.operation.matrix.Matrices;
import org.apache.sis.referencing.operation.transform.MathTransforms;
+import org.apache.sis.referencing.factory.UnavailableFactoryException;
import org.apache.sis.referencing.util.ReferencingUtilities;
import org.apache.sis.referencing.util.WKTKeywords;
import org.apache.sis.coverage.grid.GridGeometry;
@@ -184,6 +186,13 @@ public final class GeoEncoder {
*/
private int citationLengthIndex;
+ /**
+ * Whether to disable attempts to write EPSG codes. This is set to {@code true} on the first attempt to use the
+ * EPSG database if it appears to be unavailable. This is used for avoiding many retries which will continue to
+ * fail.
+ */
+ private boolean disableEPSG;
+
/**
* Prepares information for writing GeoTIFF tags for the given grid geometry.
* Caller shall invoke {@link #write(GridGeometry, MetadataFetcher)} exactly once after construction.
@@ -558,7 +567,13 @@ public final class GeoEncoder {
* This is not necessarily a bad thing, because there is a possibility that future GeoTIFF
* specifications become stricter, so we are already "strict" regarding usages of EPSG codes.
*/
- final short epsg = toShortEPSG(IdentifiedObjects.lookupEPSG(object));
+ short epsg = GeoCodes.userDefined;
+ if (!disableEPSG) try {
+ epsg = toShortEPSG(IdentifiedObjects.lookupEPSG(object));
+ } catch (UnavailableFactoryException e) {
+ listeners.warning(Level.FINE, null, e);
+ disableEPSG = true;
+ }
writeShort(key, epsg);
return (epsg == GeoCodes.userDefined);
}
(sis) 02/02: Add units of measurement for knot and tonne.
Posted by de...@apache.org.
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 7812f5c6af557e963b3b52ae50ab2c392fe53348
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Wed Feb 21 16:13:32 2024 +0100
Add units of measurement for knot and tonne.
---
.../org/apache/sis/measure/UnitNames.properties | 2 +
.../apache/sis/measure/UnitNames_en_US.properties | 1 +
.../org/apache/sis/measure/UnitNames_fr.properties | 1 +
.../main/org/apache/sis/measure/Units.java | 53 ++++++++++++++++++++--
.../org/apache/sis/measure/UnitFormatTest.java | 2 +
.../test/org/apache/sis/measure/UnitsTest.java | 7 +--
6 files changed, 59 insertions(+), 7 deletions(-)
diff --git a/endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/UnitNames.properties b/endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/UnitNames.properties
index 8b69549be1..7cf0da8c0d 100644
--- a/endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/UnitNames.properties
+++ b/endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/UnitNames.properties
@@ -30,6 +30,7 @@ J=joule
kg=kilogram
km=kilometre
km\u2215h=kilometres per hour
+kn=knot
L=litre
lm=lumen
lx=lux
@@ -56,6 +57,7 @@ rad\u2215s=radians per second
s=second
S=siemens
sr=steradian
+t=tonne
T=tesla
unity=unity
V=volt
diff --git a/endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/UnitNames_en_US.properties b/endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/UnitNames_en_US.properties
index aceb2737d8..94d76daee2 100644
--- a/endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/UnitNames_en_US.properties
+++ b/endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/UnitNames_en_US.properties
@@ -9,3 +9,4 @@ m\u00b3=cubic meter
mi=international mile
mm=millimeter
nm=nanometer
+t=metric ton
diff --git a/endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/UnitNames_fr.properties b/endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/UnitNames_fr.properties
index b087c0099a..bb1a4cf951 100644
--- a/endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/UnitNames_fr.properties
+++ b/endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/UnitNames_fr.properties
@@ -16,6 +16,7 @@ in=pouce
kg=kilogramme
km=kilom\u00e8tre
km\u2215h=kilom\u00e8tres par heure
+kn=n\u0153ud
M=mille marin international
m=m\u00e8tre
m\u00b2=m\u00e8tre carr\u00e9
diff --git a/endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/Units.java b/endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/Units.java
index 8a66199f21..493b2a5476 100644
--- a/endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/Units.java
+++ b/endorsed/src/org.apache.sis.util/main/org/apache/sis/measure/Units.java
@@ -75,7 +75,7 @@ import static org.apache.sis.measure.UnitRegistry.PREFIXABLE;
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Alexis Manin (Geomatys)
- * @version 1.4
+ * @version 1.5
* @since 0.3
*/
public final class Units extends Static {
@@ -597,7 +597,7 @@ public final class Units extends Static {
* <table class="compact" style="margin-left:30px; line-height:1.25">
* <caption>Related units</caption>
* <tr><td>SI speed units:</td> <td style="word-spacing:1em"><u><b>{@code METRES_PER_SECOND}</b></u>.</td></tr>
- * <tr><td>Non-SI units:</td> <td style="word-spacing:1em">{@link #KILOMETRES_PER_HOUR}.</td></tr>
+ * <tr><td>Non-SI units:</td> <td style="word-spacing:1em">{@link #KILOMETRES_PER_HOUR}, {@link #KNOT}.</td></tr>
* <tr><td>Components:</td> <td style="word-spacing:0.5em">{@link #METRE} ∕ {@link #SECOND}</td></tr>
* </table>
*
@@ -613,7 +613,7 @@ public final class Units extends Static {
* <table class="compact" style="margin-left:30px; line-height:1.25">
* <caption>Related units</caption>
* <tr><td>SI speed units:</td> <td style="word-spacing:1em"><b>{@link #METRES_PER_SECOND}</b>.</td></tr>
- * <tr><td>Non-SI units:</td> <td style="word-spacing:1em"><u>{@code KILOMETRES_PER_HOUR}</u>.</td></tr>
+ * <tr><td>Non-SI units:</td> <td style="word-spacing:1em"><u>{@code KILOMETRES_PER_HOUR}</u>, {@link #KNOT}.</td></tr>
* <tr><td>Components:</td> <td style="word-spacing:0.5em">{@link #KILOMETRE} ∕ {@link #HOUR}</td></tr>
* </table>
*
@@ -621,6 +621,22 @@ public final class Units extends Static {
*/
public static final Unit<Speed> KILOMETRES_PER_HOUR;
+ /**
+ * Unit of measurement defined as 1.852 km/h.
+ * The {@linkplain ConventionalUnit#getSystemUnit() system unit} is {@link #METRES_PER_SECOND}
+ * and the unlocalized name is “knot”.
+ *
+ * <table class="compact" style="margin-left:30px; line-height:1.25">
+ * <caption>Related units</caption>
+ * <tr><td>SI speed units:</td> <td style="word-spacing:1em"><b>{@link #METRES_PER_SECOND}</b>.</td></tr>
+ * <tr><td>Non-SI units:</td> <td style="word-spacing:1em">{@link #KILOMETRES_PER_HOUR}, <u>{@code #KNOT}</u>.</td></tr>
+ * <tr><td>Components:</td> <td style="word-spacing:0.5em">{@link #KILOMETRE} ∕ {@link #HOUR}</td></tr>
+ * </table>
+ *
+ * @since 1.5
+ */
+ public static final Unit<Speed> KNOT;
+
/**
* The SI derived unit for acceleration (m/s²).
* The unlocalized name is “metres per second squared”.
@@ -999,6 +1015,12 @@ public final class Units extends Static {
* A SI conventional unit for mass (g).
* The unlocalized name is “gram”.
*
+ * <table class="compact" style="margin-left:30px; line-height:1.25">
+ * <caption>Related units</caption>
+ * <tr><td>SI mass units:</td> <td style="word-spacing:1em"><u>{@code GRAM}</u>, <b>{@link #KILOGRAM}</b>.</td></tr>
+ * <tr><td>Non-SI units:</td> <td style="word-spacing:1em">{@link #TONNE}.</td></tr>
+ * </table>
+ *
* @since 0.8
*/
public static final Unit<Mass> GRAM;
@@ -1007,10 +1029,30 @@ public final class Units extends Static {
* The SI base unit for mass (kg).
* The unlocalized name is “kilogram”.
*
+ * <table class="compact" style="margin-left:30px; line-height:1.25">
+ * <caption>Related units</caption>
+ * <tr><td>SI mass units:</td> <td style="word-spacing:1em">{@link #GRAM}, <u><b>{@code KILOGRAM}</b></u>.</td></tr>
+ * <tr><td>Non-SI units:</td> <td style="word-spacing:1em">{@link #TONNE}.</td></tr>
+ * </table>
+ *
* @since 0.8
*/
public static final Unit<Mass> KILOGRAM;
+ /**
+ * The SI convention unit for mass (t).
+ * The unlocalized name is “tonne”.
+ *
+ * <table class="compact" style="margin-left:30px; line-height:1.25">
+ * <caption>Related units</caption>
+ * <tr><td>SI mass units:</td> <td style="word-spacing:1em">{@link #GRAM}, <b>{@link #KILOGRAM}</b>.</td></tr>
+ * <tr><td>Non-SI units:</td> <td style="word-spacing:1em"><u>{@code TONNE}</u>.</td></tr>
+ * </table>
+ *
+ * @since 1.5
+ */
+ public static final Unit<Mass> TONNE;
+
/**
* The SI base unit for amount of substance (mol).
* The unlocalized name is “mole”.
@@ -1229,11 +1271,12 @@ public final class Units extends Static {
final SystemUnit<ScaleRateOfChange> unityPerSecond;
unityPerSecond = new SystemUnit<>(ScaleRateOfChange.class, frequency, null, OTHER, (short) 1036, null);
unityPerSecond.related(1);
- mps .related(1);
+ mps .related(2);
mps2.related(1);
METRES_PER_SECOND = mps;
METRES_PER_SECOND_SQUARED = mps2;
KILOMETRES_PER_HOUR = add(mps, LinearConverter.scale(10, 36), "km∕h", ACCEPTED, (short) 0);
+ KNOT = add(mps, LinearConverter.scale(1852, 3600), "kn", OTHER, (short) 0);
RADIANS_PER_SECOND = add(AngularVelocity.class, null, frequency, "rad∕s", SI, (short) 1035);
GAL = add(mps2, centi, "Gal", (byte) (CGS | PREFIXABLE | ACCEPTED), (short) 0);
add(unityPerSecond, LinearConverter.scale(1, 31556925445E6), "ppm∕a", OTHER, (short) 1030);
@@ -1261,6 +1304,7 @@ public final class Units extends Static {
SQUARE_METRE = m2;
CUBIC_METRE = m3;
KILOGRAM = kg;
+ TONNE = add(kg, kilo, "t", ACCEPTED, (short) 0);
HECTARE = add(m2, ten4, "ha", ACCEPTED, (short) 0);
LITRE = add(m3, milli, "L", (byte) (ACCEPTED | PREFIXABLE), (short) 0);
GRAM = add(kg, milli, "g", (byte) (ACCEPTED | PREFIXABLE), (short) 0);
@@ -1314,6 +1358,7 @@ public final class Units extends Static {
UnitRegistry.alias(DEGREE, Short.valueOf(Constants.EPSG_AXIS_DEGREES));
UnitRegistry.alias(ARC_MINUTE, "'");
UnitRegistry.alias(ARC_SECOND, "\"");
+ UnitRegistry.alias(KNOT, "kt"); // Symbol used in aviation.
UnitRegistry.alias(KELVIN, "K"); // Ordinary "K" letter (not the dedicated Unicode character).
UnitRegistry.alias(CELSIUS, "℃");
UnitRegistry.alias(CELSIUS, "Cel");
diff --git a/endorsed/src/org.apache.sis.util/test/org/apache/sis/measure/UnitFormatTest.java b/endorsed/src/org.apache.sis.util/test/org/apache/sis/measure/UnitFormatTest.java
index 433f67b81d..acddb61c9f 100644
--- a/endorsed/src/org.apache.sis.util/test/org/apache/sis/measure/UnitFormatTest.java
+++ b/endorsed/src/org.apache.sis.util/test/org/apache/sis/measure/UnitFormatTest.java
@@ -100,6 +100,7 @@ public final class UnitFormatTest extends TestCase {
verify(declared, "RADIANS_PER_SECOND", "∕T", "rad∕s", "radians per second", Units.RADIANS_PER_SECOND);
verify(declared, "METRES_PER_SECOND", "L∕T", "m∕s", "metres per second", Units.METRES_PER_SECOND);
verify(declared, "KILOMETRES_PER_HOUR", "L∕T", "km∕h", "kilometres per hour", Units.KILOMETRES_PER_HOUR);
+ verify(declared, "KNOT", "L∕T", "kn", "knot", Units.KNOT);
verify(declared, "PASCAL", "M∕(L⋅T²)", "Pa", "pascal", Units.PASCAL);
verify(declared, "HECTOPASCAL", "M∕(L⋅T²)", "hPa", "hectopascal", Units.HECTOPASCAL);
verify(declared, "DECIBAR", "M∕(L⋅T²)", "dbar", "decibar", Units.DECIBAR);
@@ -125,6 +126,7 @@ public final class UnitFormatTest extends TestCase {
verify(declared, "LUX", "J∕L²", "lx", "lux", Units.LUX);
verify(declared, "KILOGRAM", "M", "kg", "kilogram", Units.KILOGRAM);
verify(declared, "GRAM", "M", "g", "gram", Units.GRAM);
+ verify(declared, "TONNE", "M", "t", "tonne", Units.TONNE);
verify(declared, "MOLE", "N", "mol", "mole", Units.MOLE);
verify(declared, "UNITY", "", "", null, Units.UNITY);
verify(declared, "PERCENT", "", "%", "percent", Units.PERCENT);
diff --git a/endorsed/src/org.apache.sis.util/test/org/apache/sis/measure/UnitsTest.java b/endorsed/src/org.apache.sis.util/test/org/apache/sis/measure/UnitsTest.java
index 0362b32a40..53aa9107e2 100644
--- a/endorsed/src/org.apache.sis.util/test/org/apache/sis/measure/UnitsTest.java
+++ b/endorsed/src/org.apache.sis.util/test/org/apache/sis/measure/UnitsTest.java
@@ -184,9 +184,10 @@ public final class UnitsTest extends TestCase {
*/
@Test
public void testConversionFactors() {
- assertEquals(1000, KILOMETRE .getConverterTo(METRE) .convert( 1));
- assertEquals( 3.6, METRES_PER_SECOND.getConverterTo(KILOMETRES_PER_HOUR).convert( 1));
- assertEquals(1E-6, BECQUEREL .getConverterTo(CURIE) .convert(37000), 1E-20);
+ assertEquals(1000, KILOMETRE .getConverterTo(METRE) .convert( 1));
+ assertEquals( 3.6, METRES_PER_SECOND.getConverterTo(KILOMETRES_PER_HOUR).convert( 1));
+ assertEquals(18.52, KNOT .getConverterTo(KILOMETRES_PER_HOUR).convert( 10));
+ assertEquals(1E-6, BECQUEREL .getConverterTo(CURIE) .convert(37000), 1E-20);
}
/**