static private void doTwo(ProjectionImpl proj, double x, double y) { ProjectionPointImpl startL = new ProjectionPointImpl(x, y); LatLonPoint p = proj.projToLatLon(startL); ProjectionPointImpl endL = (ProjectionPointImpl) proj.latLonToProj(p); System.out.println("start = " + startL.toString()); System.out.println("lat,lon = " + p.toString()); System.out.println("end = " + endL.toString()); }
static private void doTwo(ProjectionImpl proj, double x, double y) { ProjectionPointImpl startL = new ProjectionPointImpl(x, y); LatLonPoint p = proj.projToLatLon(startL); ProjectionPointImpl endL = (ProjectionPointImpl) proj.latLonToProj(p); System.out.println("start = " + startL.toString()); System.out.println("lat,lon = " + p.toString()); System.out.println("end = " + endL.toString()); }
static private void doTwo(ProjectionImpl proj, double x, double y) { ProjectionPointImpl startL = new ProjectionPointImpl(x, y); LatLonPoint p = proj.projToLatLon(startL); ProjectionPointImpl endL = (ProjectionPointImpl) proj.latLonToProj(p); System.out.println("start = " + startL.toString()); System.out.println("lat,lon = " + p.toString()); System.out.println("end = " + endL.toString()); }
static private void doTwo(ProjectionImpl proj, double x, double y) { ProjectionPointImpl startL = new ProjectionPointImpl(x, y); LatLonPoint p = proj.projToLatLon(startL); ProjectionPointImpl endL = (ProjectionPointImpl) proj.latLonToProj(p); System.out.println("start = " + startL.toString()); System.out.println("lat,lon = " + p.toString()); System.out.println("end = " + endL.toString()); }
public void testProjectionProjMax(ProjectionImpl proj, double xMax, double yMax) { java.util.Random r = new java.util.Random((long) this.hashCode()); ProjectionPointImpl startP = new ProjectionPointImpl(); for (int i = 0; i < NTRIALS; i++) { double x = xMax * (2 * r.nextDouble() - 1); double y = yMax * (2 * r.nextDouble() - 1); startP.setLocation(x, y); try { LatLonPoint ll = proj.projToLatLon(startP); ProjectionPoint endP = proj.latLonToProj(ll); if (show) { System.out.println("start = " + startP); System.out.println("interL = " + ll); System.out.println("end = " + endP); } Assert.assertEquals(startP.toString(), startP.getX(), endP.getX(), tolerence); Assert.assertEquals(startP.toString(), startP.getY(), endP.getY(), tolerence); } catch (IllegalArgumentException e) { System.out.printf("IllegalArgumentException=%s%n", e.getMessage()); continue; } } if (show) System.out.println("Tested " + NTRIALS + " pts for projection " + proj.getClassName()); }