Skip to content

Commit

Permalink
Merge pull request #1438 from lat-lon/officialJgridshift-8613-1233
Browse files Browse the repository at this point in the history
Use official jgridshift version with patch
  • Loading branch information
stephanr authored Aug 9, 2023
2 parents 5748374 + 018ba5d commit e567b43
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 21 deletions.
4 changes: 2 additions & 2 deletions deegree-core/deegree-core-cs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
<artifactId>vecmath</artifactId>
</dependency>
<dependency>
<groupId>jgridshift</groupId>
<artifactId>jgridshift</artifactId>
<groupId>it.geosolutions.jgridshift</groupId>
<artifactId>jgridshift-core</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,21 +148,20 @@ public NTv2Transformation(ICRS sourceCRS, ICRS targetCRS, CRSResource id, URL gr
IEllipsoid sourceEl = sourceCRS.getGeodeticDatum().getEllipsoid();
IEllipsoid targetEl = targetCRS.getGeodeticDatum().getEllipsoid();

// rb: patched the gridshift file for access to the axis
if (Math.abs(sourceEl.getSemiMajorAxis() - gsf.getFromSemiMajor()) > 0.001
|| Math.abs(sourceEl.getSemiMinorAxis() - gsf.getFromSemiMinor()) > 0.001) {
if (Math.abs(sourceEl.getSemiMajorAxis() - gsf.getFromSemiMajorAxis()) > 0.001
|| Math.abs(sourceEl.getSemiMinorAxis() - gsf.getFromSemiMinorAxis()) > 0.001) {
LOG.warn("The given source CRS' ellipsoid (" + sourceEl.getCode().getOriginal()
+ ") does not match the 'from' ellipsoid (" + fromEllips + ")defined in the gridfile: " + gridURL);
+ ") does not match the 'from' ellipsoid (" + fromEllips + ") defined in the gridfile: " + gridURL);
}

if (Math.abs(targetEl.getSemiMajorAxis() - gsf.getToSemiMajor()) > 0.001
|| Math.abs(targetEl.getSemiMinorAxis() - gsf.getToSemiMinor()) > 0.001) {
if (Math.abs(targetEl.getSemiMajorAxis() - gsf.getToSemiMajorAxis()) > 0.001
|| Math.abs(targetEl.getSemiMinorAxis() - gsf.getToSemiMinorAxis()) > 0.001) {
LOG.warn("The given target CRS' ellipsoid (" + targetEl.getCode().getOriginal()
+ ") does not match the 'to' ellipsoid (" + toEllips + ") defined in the gridfile: " + gridURL);
}

isIdentity = (Math.abs(gsf.getFromSemiMajor() - gsf.getToSemiMajor()) < 0.001)
&& (Math.abs(gsf.getFromSemiMinor() - gsf.getToSemiMinor()) < 0.001);
isIdentity = (Math.abs(gsf.getFromSemiMajorAxis() - gsf.getToSemiMajorAxis()) < 0.001)
&& (Math.abs(gsf.getFromSemiMinorAxis() - gsf.getToSemiMinorAxis()) < 0.001);
}

/**
Expand All @@ -180,21 +179,20 @@ public NTv2Transformation(ICRS sourceCRS, ICRS targetCRS, CRSResource id, GridSh
IEllipsoid sourceEl = sourceCRS.getGeodeticDatum().getEllipsoid();
IEllipsoid targetEl = targetCRS.getGeodeticDatum().getEllipsoid();

// rb: patched the gridshift file for access to the axis
if (Math.abs(sourceEl.getSemiMajorAxis() - gsf.getFromSemiMajor()) > 0.001
|| Math.abs(sourceEl.getSemiMinorAxis() - gsf.getFromSemiMinor()) > 0.001) {
if (Math.abs(sourceEl.getSemiMajorAxis() - gsf.getFromSemiMajorAxis()) > 0.001
|| Math.abs(sourceEl.getSemiMinorAxis() - gsf.getFromSemiMinorAxis()) > 0.001) {
LOG.warn("The given source CRS' ellipsoid (" + sourceEl.getCode().getOriginal()
+ ") does not match the 'from' ellipsoid (" + fromEllips + ")defined in the gridfile: " + gridURL);
+ ") does not match the 'from' ellipsoid (" + fromEllips + ") defined in the gridfile: " + gridURL);
}

if (Math.abs(targetEl.getSemiMajorAxis() - gsf.getToSemiMajor()) > 0.001
|| Math.abs(targetEl.getSemiMinorAxis() - gsf.getToSemiMinor()) > 0.001) {
if (Math.abs(targetEl.getSemiMajorAxis() - gsf.getToSemiMajorAxis()) > 0.001
|| Math.abs(targetEl.getSemiMinorAxis() - gsf.getToSemiMinorAxis()) > 0.001) {
LOG.warn("The given target CRS' ellipsoid (" + targetEl.getCode().getOriginal()
+ ") does not match the 'to' ellipsoid (" + toEllips + ") defined in the gridfile: " + gridURL);
}

isIdentity = (Math.abs(gsf.getFromSemiMajor() - gsf.getToSemiMajor()) < 0.001)
&& (Math.abs(gsf.getFromSemiMinor() - gsf.getToSemiMinor()) < 0.001);
isIdentity = (Math.abs(gsf.getFromSemiMajorAxis() - gsf.getToSemiMajorAxis()) < 0.001)
&& (Math.abs(gsf.getFromSemiMinorAxis() - gsf.getToSemiMinorAxis()) < 0.001);
}

/**
Expand Down
13 changes: 10 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>geotools-releases</id>
<url>https://repo.osgeo.org/repository/geotools-releases/</url>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
</repository>
</repositories>

<distributionManagement>
Expand Down Expand Up @@ -1068,9 +1075,9 @@
<version>1.19.0</version>
</dependency>
<dependency>
<groupId>jgridshift</groupId>
<artifactId>jgridshift</artifactId>
<version>1.0-deegreeversion</version>
<groupId>it.geosolutions.jgridshift</groupId>
<artifactId>jgridshift-core</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>org.ehcache</groupId>
Expand Down

0 comments on commit e567b43

Please sign in to comment.