diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 522d1c7..93a4a64 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,4 +1,5 @@ ## Changelog for v1.7.1 + Fix GGRS87 / Greek Grid transformation + Update SLF4J to 2.0.9 ++ Fix parsing ellipsoid name diff --git a/pom.xml b/pom.xml index cac209b..cb0ed28 100644 --- a/pom.xml +++ b/pom.xml @@ -101,6 +101,12 @@ slf4j-api ${slf4j-version} + + org.slf4j + slf4j-simple + ${slf4j-version} + test + diff --git a/src/main/java/org/cts/CRSHelper.java b/src/main/java/org/cts/CRSHelper.java index 931238d..ae42b12 100644 --- a/src/main/java/org/cts/CRSHelper.java +++ b/src/main/java/org/cts/CRSHelper.java @@ -630,7 +630,7 @@ private static Ellipsoid getEllipsoid(Map param) { Ellipsoid ellps = null; if (null != ellipsoidName) { - ellps = Ellipsoid.ellipsoidFromName.get(ellipsoidName.replaceAll("[^a-zA-Z0-9_]", "").toLowerCase()); + ellps = Ellipsoid.ellipsoidFromName.get(ellipsoidName.replaceAll("[^a-zA-Z0-9]", "").toLowerCase()); } if (ellps == null && authorityCode != null) { String[] authNameWithKey = authorityCode.split(":"); diff --git a/src/test/java/org/cts/CTSTestCase.java b/src/test/java/org/cts/CTSTestCase.java index 7c6876a..638c429 100644 --- a/src/test/java/org/cts/CTSTestCase.java +++ b/src/test/java/org/cts/CTSTestCase.java @@ -39,6 +39,11 @@ */ public class CTSTestCase { + static { + //Here change the log level + System.setProperty(org.slf4j.simple.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "DEBUG"); + } + protected Logger LOGGER = LoggerFactory.getLogger(CTSTestCase.class); protected static CRSFactory cRSFactory; diff --git a/src/test/java/org/cts/op/BatchCoordinateTransformTest.java b/src/test/java/org/cts/op/BatchCoordinateTransformTest.java index ce88b11..c2cbf7e 100644 --- a/src/test/java/org/cts/op/BatchCoordinateTransformTest.java +++ b/src/test/java/org/cts/op/BatchCoordinateTransformTest.java @@ -25,6 +25,8 @@ import java.io.FileReader; import java.io.LineNumberReader; + +import org.cts.crs.CRSException; import org.cts.crs.CoordinateReferenceSystem; import org.cts.crs.GeodeticCRS; import org.junit.jupiter.api.Test; @@ -69,8 +71,14 @@ public void testCoordinateTransformFromFile() throws Exception { double csNameDest_X = parseNumber(values[5]); double csNameDest_Y = parseNumber(values[6]); double tolerance = parseNumber(values[7]); - CoordinateReferenceSystem inputCRS = cRSFactory.getCRS(csNameSrc); - CoordinateReferenceSystem outputCRS = cRSFactory.getCRS(csNameDest); + CoordinateReferenceSystem inputCRS; + CoordinateReferenceSystem outputCRS; + try { + inputCRS = cRSFactory.getCRS(csNameSrc); + outputCRS = cRSFactory.getCRS(csNameDest); + }catch (CRSException ex){ + throw new CRSException("Cannot create the CRS's for the id : "+ id); + } double[] pointSource = new double[]{csNameSrc_X, csNameSrc_Y}; double[] result = transform((GeodeticCRS) inputCRS, (GeodeticCRS) outputCRS, pointSource); double[] pointDest = new double[]{csNameDest_X, csNameDest_Y}; diff --git a/src/test/resources/org/cts/op/crstransform.csv b/src/test/resources/org/cts/op/crstransform.csv index 0c5f289..d1d7a66 100644 --- a/src/test/resources/org/cts/op/crstransform.csv +++ b/src/test/resources/org/cts/op/crstransform.csv @@ -72,4 +72,5 @@ id;csNameSrc;csNameSrc_X;csNameSrc_Y;csNameDest;csNameDest_X;csNameDest_Y;tolera 54;EPSG:4326;-7.899170;52.831312;EPSG:29902;206845.456303112;175560.736757651;0.01 55;EPSG:4326;-3.0;55.0;EPSG:27700;336128.74;567727.11;0.01 56;EPSG:4326; 3.8142776; 51.285914;EPSG:23031;556878.9016076007; 5682145.166264554;0.1 -57;EPSG:4269; -142.0; 56.50833333333333;ESRI:102632;1640416.667; 916074.825; 0.1 \ No newline at end of file +57;EPSG:4269; -142.0; 56.50833333333333;ESRI:102632;1640416.667; 916074.825; 0.1 +58;EPSG:4326;-53.3647812;-8.5810211;EPSG:5875;2937045.64888;8980282.93543; 0.00001 \ No newline at end of file