UtmProjection proj = new UtmProjection(zone, lat >= 0.0); ProjectionPoint p = proj.latLonToProj(startL); LatLonPoint endL = proj.projToLatLon(p);
private void testProjectionUTM(double lat, double lon) { LatLonPointImpl startL = new LatLonPointImpl(); startL.setLatitude(lat); startL.setLongitude(lon); int zone = (int) ((lon + 183) / 6); UtmProjection proj = new UtmProjection(zone, lat >= 0.0); ProjectionPoint p = proj.latLonToProj(startL); LatLonPoint endL = proj.projToLatLon(p); if (show) { System.out.println("startL = " + startL); System.out.println("inter = " + p); System.out.println("endL = " + endL); } Assert.assertEquals(startL.toString(8), startL.getLatitude(), endL.getLatitude(), 1.3e-4); Assert.assertEquals(startL.toString(8), startL.getLongitude(), endL.getLongitude(), 1.3e-4); }