/** * Convert lat/lon coordinates to projection coordinates. * * @param from array of lat/lon coordinates: from[2][n], * where from[0][i], from[1][i] is the (lat,lon) * coordinate of the ith point * @return resulting array of projection coordinates, where to[0][i], * to[1][i] is the (x,y) coordinate of the ith point */ public double[][] latLonToProj(double[][] from) { return latLonToProj(from, new double[2][from[0].length]); }
/** * Convert lat/lon coordinates to projection coordinates. * * @param from array of lat/lon coordinates: from[2][n], * where from[0][i], from[1][i] is the (lat,lon) * coordinate of the ith point * @return resulting array of projection coordinates, where to[0][i], * to[1][i] is the (x,y) coordinate of the ith point */ public double[][] latLonToProj(double[][] from) { return latLonToProj(from, new double[2][from[0].length]); }
/** * Convert lat/lon coordinates to projection coordinates. * * @param from array of lat/lon coordinates: from[2][n], * where from[0][i], from[1][i] is the (lat,lon) * coordinate of the ith point * @return resulting array of projection coordinates, where to[0][i], * to[1][i] is the (x,y) coordinate of the ith point */ public double[][] latLonToProj(double[][] from) { return latLonToProj(from, new double[2][from[0].length]); }
/** * Convert lat/lon coordinates to projection coordinates. * * @param from array of lat/lon coordinates: from[2][n], * where from[0][i], from[1][i] is the (lat,lon) * coordinate of the ith point * @return resulting array of projection coordinates, where to[0][i], * to[1][i] is the (x,y) coordinate of the ith point */ public float[][] latLonToProj(float[][] from) { return latLonToProj(from, new float[2][from[0].length]); }
/** * Convert lat/lon coordinates to projection coordinates. * * @param from array of lat/lon coordinates: from[2][n], * where from[0][i], from[1][i] is the (lat,lon) * coordinate of the ith point * @return resulting array of projection coordinates, where to[0][i], * to[1][i] is the (x,y) coordinate of the ith point */ public float[][] latLonToProj(float[][] from) { return latLonToProj(from, new float[2][from[0].length]); }
/** * Convert a LatLonPoint to projection coordinates * Note: a new object is now created on each call for the return value, as of 4.0.46 * * @param lat latitude of point to convert * @param lon longitude of point to convert * @return ProjectionPointImpl convert to these projection coordinates */ public ProjectionPoint latLonToProj(double lat, double lon) { return latLonToProj(new LatLonPointImpl(lat, lon)); }
/** * Convert a LatLonPoint to projection coordinates * Note: a new object is now created on each call for the return value, as of 4.0.46 * * @param latLon convert from these lat, lon coordinates * @return ProjectionPoint convert to these projection coordinates */ public ProjectionPoint latLonToProj(LatLonPoint latLon) { return latLonToProj(latLon, new ProjectionPointImpl()); }
/** * Convert a LatLonPoint to projection coordinates * Note: a new object is now created on each call for the return value, as of 4.0.46 * * @param latLon convert from these lat, lon coordinates * @return ProjectionPoint convert to these projection coordinates */ public ProjectionPoint latLonToProj(LatLonPoint latLon) { return latLonToProj(latLon, new ProjectionPointImpl()); }
/** * Convert a LatLonPoint to projection coordinates * Note: a new object is now created on each call for the return value, as of 4.0.46 * * @param latLon convert from these lat, lon coordinates * @return ProjectionPoint convert to these projection coordinates */ public ProjectionPoint latLonToProj(LatLonPoint latLon) { return latLonToProj(latLon, new ProjectionPointImpl()); }
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()); }
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()); }
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 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()); }
public GdsHorizCoordSys makeHorizCoordSys() { ProjectionImpl proj = null; Earth earth = getEarth(); if (earth.isSpherical()) { proj = new ucar.unidata.geoloc.projection.LambertConformal(latin1, lov, latin1, latin2, 0.0, 0.0, earth.getEquatorRadius() * .001); } else { proj = new ucar.unidata.geoloc.projection.proj4.LambertConformalConicEllipse(latin1, lov, latin1, latin2, 0.0, 0.0, earth); } LatLonPointImpl startLL = new LatLonPointImpl(la1, lo1); ProjectionPointImpl start = (ProjectionPointImpl) proj.latLonToProj(startLL); return new GdsHorizCoordSys(getNameShort(), template, 0, scanMode, proj, start.getX(), getDx(), start.getY(), getDy(), getNx(), getNy(), null); }