File tree Expand file tree Collapse file tree
main/java/org/locationtech/proj4j
test/java/org/locationtech/proj4j/datum Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 */
1616package org .locationtech .proj4j ;
1717
18+ import java .util .Objects ;
19+ import java .util .stream .DoubleStream ;
20+
1821import org .locationtech .proj4j .datum .*;
22+ import org .locationtech .proj4j .util .ProjectionMath ;
1923
2024/**
2125 * Represents the operation of transforming
Original file line number Diff line number Diff line change 2323import java .io .IOException ;
2424import java .util .ArrayList ;
2525import java .util .List ;
26- import java .util .Objects ;
2726
2827import org .locationtech .proj4j .ProjCoordinate ;
2928
@@ -150,9 +149,8 @@ public double[] getTransformToWGS84() {
150149 public int getTransformType () {
151150 if (grids != null && grids .size () > 0 ) return TYPE_GRIDSHIFT ;
152151
153- if (Ellipsoid .WGS84 .equals (ellipsoid ) || Ellipsoid .GRS80 .equals (ellipsoid )) {
152+ if (Ellipsoid .WGS84 .isEqual (ellipsoid ) || Ellipsoid .GRS80 .isEqual (ellipsoid )) {
154153 if (transform == null ) return TYPE_WGS84 ;
155-
156154 if (isIdentity (transform )) return TYPE_WGS84 ;
157155 }
158156
@@ -269,4 +267,4 @@ public void inverseShift(ProjCoordinate xy) {
269267 public void setGrids (List <Grid > grids ) {
270268 this .grids = grids ;
271269 }
272- }
270+ }
Original file line number Diff line number Diff line change 1+ package org .locationtech .proj4j .datum ;
2+
3+ import org .junit .Test ;
4+ import org .locationtech .proj4j .CRSFactory ;
5+ import org .locationtech .proj4j .CoordinateReferenceSystem ;
6+
7+ import static org .junit .Assert .assertTrue ;
8+
9+ public class TransformerTypeTest {
10+
11+ private final CRSFactory crsFactory = new CRSFactory ();
12+
13+ @ Test
14+ public void isTransformerTypeWgs84 () {
15+
16+ String utm32znParameters = "+proj=tmerc +lat_0=0.0 +lon_0=9.0 +k_0=0.9996 +x_0=3.25E7 +y_0=0.0 +a=6378137.0 +f=298.257222101 +pm=Greenwich +units=m +no_defs" ;
17+ CoordinateReferenceSystem utm32znCrs = crsFactory .createFromParameters ("Anon" , utm32znParameters );
18+
19+ assertTrue (utm32znCrs .getDatum ().getTransformType () == Datum .TYPE_WGS84 );
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments