/** * Convert projection coordinates to lat/lon coordinates. * * @param from array of projection coordinates: from[2][n], * where from[0][i], from[1][i] is the x, y coordinate * of the ith point * @return resulting array of lat/lon coordinates, where to[0][i], to[1][i] * is the lat,lon coordinate of the ith point */ public float[][] projToLatLon(float[][] from) { return projToLatLon(from, new float[2][from[0].length]); }
/** * Convert projection coordinates to lat/lon coordinates. * * @param from array of projection coordinates: from[2][n], * where from[0][i], from[1][i] is the x, y coordinate * of the ith point * @return resulting array of lat/lon coordinates, where to[0][i], to[1][i] * is the lat,lon coordinate of the ith point */ public double[][] projToLatLon(double[][] from) { return projToLatLon(from, new double[2][from[0].length]); }
/** * Convert projection coordinates to lat/lon coordinates. * * @param from array of projection coordinates: from[2][n], * where from[0][i], from[1][i] is the x, y coordinate * of the ith point * @return resulting array of lat/lon coordinates, where to[0][i], to[1][i] * is the lat,lon coordinate of the ith point */ public double[][] projToLatLon(double[][] from) { return projToLatLon(from, new double[2][from[0].length]); }
/** * Convert projection coordinates to a LatLonPoint * Note: a new object is now created on each call for the return value, as of 4.0.46 * * @param ppt convert from these projection coordinates * @return LatLonPoint convert to these lat/lon coordinates */ public LatLonPoint projToLatLon(ProjectionPoint ppt) { return projToLatLon(ppt, new LatLonPointImpl()); }
/** * Convert a projection coordinate to a LatLonPoint * Note: a new object is now created on each call for the return value, as of 4.0.46 * * @param x x value to convert * @param y y value to convert * @return LatLonPointImpl convert to these lat/lon coordinates */ public LatLonPointImpl projToLatLon(double x, double y) { return (LatLonPointImpl) projToLatLon(new ProjectionPointImpl(x, y)); }
/** * Convert a projection coordinate to a LatLonPoint * Note: a new object is now created on each call for the return value, as of 4.0.46 * * @param x x value to convert * @param y y value to convert * @return LatLonPointImpl convert to these lat/lon coordinates */ public LatLonPoint projToLatLon(double x, double y) { return projToLatLon(new ProjectionPointImpl(x, y)); }
/** * Convert a projection coordinate to a LatLonPoint * Note: a new object is now created on each call for the return value, as of 4.0.46 * * @param x x value to convert * @param y y value to convert * @return LatLonPointImpl convert to these lat/lon coordinates */ public LatLonPointImpl projToLatLon(double x, double y) { return (LatLonPointImpl) projToLatLon( new ProjectionPointImpl(x,y)); }
/** * Convert projection coordinates to a LatLonPoint * Note: a new object is now created on each call for the return value, as of 4.0.46 * * @param ppt convert from these projection coordinates * @return LatLonPoint convert to these lat/lon coordinates */ public LatLonPoint projToLatLon(ProjectionPoint ppt) { return projToLatLon(ppt, new LatLonPointImpl()); }
private List<LatLonPoint> calcLatLonBoundaryPointsFromProjection(int maxPointsInYEdge, int maxPointsInXEdge) { List<ProjectionPoint> projPoints = calcProjectionBoundaryPoints(maxPointsInYEdge, maxPointsInXEdge); List<LatLonPoint> latLonPoints = new LinkedList<>(); for (ProjectionPoint projPoint : projPoints) { latLonPoints.add(transform.getProjection().projToLatLon(projPoint)); } return latLonPoints; }
static private void doOne(ProjectionImpl proj, double lat, double lon) { LatLonPointImpl startL = new LatLonPointImpl(lat, lon); ProjectionPoint p = proj.latLonToProj(startL); LatLonPointImpl endL = (LatLonPointImpl) proj.projToLatLon(p); System.out.println("start = " + startL.toString(8)); System.out.println("xy = " + p.toString()); System.out.println("end = " + endL.toString(8)); }
static private void doOne(ProjectionImpl proj, double lat, double lon) { LatLonPointImpl startL = new LatLonPointImpl(lat, lon); ProjectionPoint p = proj.latLonToProj(startL); LatLonPointImpl endL = (LatLonPointImpl) proj.projToLatLon(p); System.out.println("start = " + startL.toString(8)); System.out.println("xy = " + p.toString()); System.out.println("end = " + endL.toString(8)); }
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()); }
private static void toProj(ProjectionImpl p, double lat, double lon) { System.out.printf("lon,lat = %f %f%n", lon, lat); ProjectionPoint pt = p.latLonToProj(lat, lon); System.out.printf("x,y = %f %f%n", pt.getX(), pt.getY()); LatLonPoint ll = p.projToLatLon(pt); System.out.printf("lon,lat = %f %f%n%n", ll.getLongitude(), ll.getLatitude()); }
private static void fromProj(ProjectionImpl p, double x, double y) { System.out.printf("x,y = %f %f%n", x,y); LatLonPoint ll = p.projToLatLon(x, y); System.out.printf("lon,lat = %f %f%n", ll.getLongitude(), ll.getLatitude()); ProjectionPoint pt = p.latLonToProj(ll); System.out.printf("x,y = %f %f%n%n", pt.getX(), pt.getY()); }
private static void toProj(ProjectionImpl p, double lat, double lon) { System.out.printf("lon,lat = %f %f%n", lon, lat); ProjectionPoint pt = p.latLonToProj(lat, lon); System.out.printf("x,y = %f %f%n", pt.getX(), pt.getY()); LatLonPoint ll = p.projToLatLon(pt); System.out.printf("lon,lat = %f %f%n%n", ll.getLongitude(), ll.getLatitude()); }
private static void fromProj(ProjectionImpl p, double x, double y) { System.out.printf("x,y = %f %f%n", x,y); LatLonPoint ll = p.projToLatLon(x, y); System.out.printf("lon,lat = %f %f%n", ll.getLongitude(), ll.getLatitude()); ProjectionPoint pt = p.latLonToProj(ll); System.out.printf("x,y = %f %f%n%n", pt.getX(), pt.getY()); }
private static void toProj(ProjectionImpl p, double lat, double lon) { System.out.printf("lon,lat = %f %f%n", lon, lat); ProjectionPoint pt = p.latLonToProj(lat, lon); System.out.printf("x,y = %f %f%n", pt.getX(), pt.getY()); LatLonPoint ll = p.projToLatLon(pt); System.out.printf("lon,lat = %f %f%n%n", ll.getLongitude(), ll.getLatitude()); }
private static void fromProj(ProjectionImpl p, double x, double y) { System.out.printf("x,y = %f %f%n", x,y); LatLonPoint ll = p.projToLatLon(x, y); System.out.printf("lon,lat = %f %f%n", ll.getLongitude(), ll.getLatitude()); ProjectionPoint pt = p.latLonToProj(ll); System.out.printf("x,y = %f %f%n%n", pt.getX(), pt.getY()); }
private static void toProj(ProjectionImpl p, double lat, double lon) { System.out.printf("lon,lat = %f %f%n", lon, lat); ProjectionPoint pt = p.latLonToProj(lat, lon); System.out.printf("x,y = %f %f%n", pt.getX(), pt.getY()); LatLonPoint ll = p.projToLatLon(pt); System.out.printf("lon,lat = %f %f%n%n", ll.getLongitude(), ll.getLatitude()); }
private static void fromProj(ProjectionImpl p, double x, double y) { System.out.printf("x,y = %f %f%n", x,y); LatLonPoint ll = p.projToLatLon(x, y); System.out.printf("lon,lat = %f %f%n", ll.getLongitude(), ll.getLatitude()); ProjectionPoint pt = p.latLonToProj(ll); System.out.printf("x,y = %f %f%n%n", pt.getX(), pt.getY()); }