Skip to content

Commit

Permalink
Merge pull request #152 from ebocher/fix_149
Browse files Browse the repository at this point in the history
Fix 149
  • Loading branch information
ebocher authored Oct 28, 2023
2 parents f41a551 + 4e63e06 commit 5b83d45
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Changelog for v1.7.1
+ Fix GGRS87 / Greek Grid transformation
+ Update SLF4J to 2.0.9
+ Fix parsing ellipsoid name

6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@
<artifactId>slf4j-api</artifactId>
<version>${slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>${slf4j-version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/cts/CRSHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ private static Ellipsoid getEllipsoid(Map<String, String> 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(":");
Expand Down
5 changes: 5 additions & 0 deletions src/test/java/org/cts/CTSTestCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
12 changes: 10 additions & 2 deletions src/test/java/org/cts/op/BatchCoordinateTransformTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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};
Expand Down
3 changes: 2 additions & 1 deletion src/test/resources/org/cts/op/crstransform.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
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

0 comments on commit 5b83d45

Please sign in to comment.