@Override public LatLonPoint projToLatLon(ProjectionPoint world, LatLonPointImpl result) { double fromX = (world.getX() - falseEasting) / totalScale; // assumes cartesian coords in km double fromY = (world.getY() - falseNorthing) / totalScale; Point2D.Double dst = projectInverse(fromX, fromY, new Point2D.Double()); if (dst.x < -Math.PI) dst.x = -Math.PI; else if (dst.x > Math.PI) dst.x = Math.PI; if (projectionLongitude != 0) dst.x = MapMath.normalizeLongitude(dst.x+projectionLongitude); result.setLongitude(Math.toDegrees(dst.x)); result.setLatitude(Math.toDegrees(dst.y)); return result; }
@Override public LatLonPoint projToLatLon(ProjectionPoint world, LatLonPointImpl result) { double fromX = (world.getX() - falseEasting) / totalScale; // assumes cartesian coords in km double fromY = (world.getY() - falseNorthing) / totalScale; Point2D.Double dst = projectInverse(fromX, fromY, new Point2D.Double()); if (dst.x < -Math.PI) dst.x = -Math.PI; else if (dst.x > Math.PI) dst.x = Math.PI; if (projectionLongitude != 0) dst.x = MapMath.normalizeLongitude(dst.x + projectionLongitude); result.setLongitude(Math.toDegrees(dst.x)); result.setLatitude(Math.toDegrees(dst.y)); return result; }
@Override public LatLonPoint projToLatLon(ProjectionPoint world, LatLonPointImpl result) { double fromX = (world.getX() - falseEasting) / totalScale; // assumes cartesian coords in km double fromY = (world.getY() - falseNorthing) / totalScale; ProjectionPointImpl dst = new ProjectionPointImpl(); projectInverse(fromX, fromY, dst); if (dst.getX() < -Math.PI) dst.setX(-Math.PI); else if (dst.getX() > Math.PI) dst.setX(Math.PI); if (projectionLongitude != 0) dst.setX(MapMath.normalizeLongitude(dst.getX()) + projectionLongitude); result.setLongitude(Math.toDegrees(dst.getX())); result.setLatitude(Math.toDegrees(dst.getY())); return result; }
@Override public LatLonPoint projToLatLon(ProjectionPoint world, LatLonPointImpl result) { double fromX = (world.getX() - falseEasting) / totalScale; // assumes cartesian coords in km double fromY = (world.getY() - falseNorthing) / totalScale; ProjectionPointImpl dst = new ProjectionPointImpl(); projectInverse(fromX, fromY, dst); if (dst.getX() < -Math.PI) dst.setX(-Math.PI); else if (dst.getX() > Math.PI) dst.setX(Math.PI); if (projectionLongitude != 0) dst.setX(MapMath.normalizeLongitude(dst.getX()) + projectionLongitude); result.setLongitude(Math.toDegrees(dst.getX())); result.setLatitude(Math.toDegrees(dst.getY())); return result; }