private static void test(double lat, double lon) { double radius = 6371.0; VerticalPerspectiveView a = new VerticalPerspectiveView(0, 0, radius, 5.62 * radius); ProjectionPoint p = a.latLonToProj(lat, lon); System.out.println("-----\nproj point = " + p); System.out.println("x/r = " + p.getX() / radius); // see snyder p 174 System.out.println("y/r = " + p.getY() / radius); LatLonPoint ll = a.projToLatLon(p); System.out.println(" lat = " + ll.getLatitude() + " should be= " + lat); System.out.println(" lon = " + ll.getLongitude() + " should be= " + lon); }
private static void test(double lat, double lon) { double radius = 6371.0; VerticalPerspectiveView a = new VerticalPerspectiveView(0, 0, radius, 5.62 * radius); ProjectionPointImpl p = a.latLonToProj(lat, lon); System.out.println("-----\nproj point = " + p); System.out.println("x/r = " + p.getX() / radius); // see snyder p 174 System.out.println("y/r = " + p.getY() / radius); LatLonPoint ll = a.projToLatLon(p); System.out.println(" lat = " + ll.getLatitude() + " should be= " + lat); System.out.println(" lon = " + ll.getLongitude() + " should be= " + lon); }
private static void test(double lat, double lon) { double radius = 6371.0; VerticalPerspectiveView a = new VerticalPerspectiveView(0, 0, radius, 5.62*radius); ProjectionPointImpl p = a.latLonToProj(lat, lon); System.out.println("-----\nproj point = " + p); System.out.println("x/r = " + p.getX()/radius); // see snyder p 174 System.out.println("y/r = " + p.getY()/radius); LatLonPoint ll = a.projToLatLon(p); System.out.println(" lat = "+ll.getLatitude()+ " should be= " + lat); System.out.println(" lon = "+ll.getLongitude()+ " should be= " + lon); }
private static void test(double lat, double lon) { double radius = 6371.0; VerticalPerspectiveView a = new VerticalPerspectiveView(0, 0, radius, 5.62 * radius); ProjectionPoint p = a.latLonToProj(lat, lon); System.out.println("-----\nproj point = " + p); System.out.println("x/r = " + p.getX() / radius); // see snyder p 174 System.out.println("y/r = " + p.getY() / radius); LatLonPoint ll = a.projToLatLon(p); System.out.println(" lat = " + ll.getLatitude() + " should be= " + lat); System.out.println(" lon = " + ll.getLongitude() + " should be= " + lon); }
public CoordinateTransform makeCoordinateTransform(NetcdfDataset ds, Variable ctv) { readStandardParams(ds, ctv); double distance = readAttributeDouble(ctv, CF.PERSPECTIVE_POINT_HEIGHT, Double.NaN); if (Double.isNaN(distance)) { distance = readAttributeDouble(ctv, "height_above_earth", Double.NaN); } if (Double.isNaN(lon0) || Double.isNaN(lat0) || Double.isNaN(distance)) throw new IllegalArgumentException("Vertical Perspective must have: " + CF.LONGITUDE_OF_PROJECTION_ORIGIN + ", " + CF.LATITUDE_OF_PROJECTION_ORIGIN + ", and " + CF.PERSPECTIVE_POINT_HEIGHT + "(or height_above_earth) " + "attributes"); // We assume distance comes in 'm' (CF-compliant) and we pass in as 'km' ucar.unidata.geoloc.projection.VerticalPerspectiveView proj = new ucar.unidata.geoloc.projection.VerticalPerspectiveView(lat0, lon0, earth_radius, distance / 1000., false_easting, false_northing); return new ProjectionCT(ctv.getShortName(), "FGDC", proj); } }
public ProjectionCT makeCoordinateTransform(AttributeContainer ctv, String geoCoordinateUnits) { readStandardParams(ctv, geoCoordinateUnits); double distance = readAttributeDouble(ctv, CF.PERSPECTIVE_POINT_HEIGHT, Double.NaN); if (Double.isNaN(distance)) { distance = readAttributeDouble(ctv, "height_above_earth", Double.NaN); } if (Double.isNaN(lon0) || Double.isNaN(lat0) || Double.isNaN(distance)) throw new IllegalArgumentException("Vertical Perspective must have: " + CF.LONGITUDE_OF_PROJECTION_ORIGIN + ", " + CF.LATITUDE_OF_PROJECTION_ORIGIN + ", and " + CF.PERSPECTIVE_POINT_HEIGHT + "(or height_above_earth) " + "attributes"); // We assume distance comes in 'm' (CF-compliant) and we pass in as 'km' ucar.unidata.geoloc.projection.VerticalPerspectiveView proj = new ucar.unidata.geoloc.projection.VerticalPerspectiveView(lat0, lon0, earth_radius, distance / 1000., false_easting, false_northing); return new ProjectionCT(ctv.getName(), "FGDC", proj); } }
@Override protected VerticalPerspectiveView createProjection(final ParameterValueGroup p) { if (p == null) return new VerticalPerspectiveView(); return new VerticalPerspectiveView(value(p, CF.LATITUDE_OF_PROJECTION_ORIGIN), value(p, CF.LONGITUDE_OF_PROJECTION_ORIGIN), earthRadius(p) / KILOMETRE, value(p, CF.PERSPECTIVE_POINT_HEIGHT) / KILOMETRE, value(p, CF.FALSE_EASTING) / KILOMETRE, value(p, CF.FALSE_NORTHING) / KILOMETRE); } }
/** copy constructor - avoid clone !! */ public ProjectionImpl constructCopy() { return new VerticalPerspectiveView( getOriginLat(), getOriginLon(), R, getHeight(), false_east, false_north); }
double height = 35747.0; VerticalPerspectiveView a = new VerticalPerspectiveView(0, 0, radius, height);
double height = 35747.0; VerticalPerspectiveView a = new VerticalPerspectiveView(0, 0, radius, height);
double height = 35747.0; VerticalPerspectiveView a = new VerticalPerspectiveView(0, 0, radius, height);
double height = 35747.0; VerticalPerspectiveView a = new VerticalPerspectiveView(0, 0, radius, height);
public void utestVerticalPerspectiveView() { testProjectionLonMax(new VerticalPerspectiveView(), 66, 60); VerticalPerspectiveView p = new VerticalPerspectiveView(); VerticalPerspectiveView p2 = (VerticalPerspectiveView) p.constructCopy(); assert p.equals(p2); }
public CoordinateTransform makeCoordinateTransform(NetcdfDataset ds, Variable ctv) { double lon0 = readAttributeDouble( ctv, "longitude_of_projection_origin", Double.NaN); double lat0 = readAttributeDouble( ctv, "latitude_of_projection_origin", Double.NaN); double distance = readAttributeDouble( ctv, "height_above_earth", Double.NaN); if (Double.isNaN(lon0) || Double.isNaN(lat0) || Double.isNaN(distance)) throw new IllegalArgumentException("Vertical Perspective must have longitude_of_projection_origin, latitude_of_projection_origin, height_above_earth attributes"); double false_easting = readAttributeDouble(ctv, "false_easting", 0.0); double false_northing = readAttributeDouble(ctv, "false_northing", 0.0); if ((false_easting != 0.0) || (false_northing != 0.0)) { double scalef = getFalseEastingScaleFactor(ds, ctv); false_easting *= scalef; false_northing *= scalef; } double earth_radius = getEarthRadiusInKm(ctv); ucar.unidata.geoloc.projection.VerticalPerspectiveView proj = new ucar.unidata.geoloc.projection.VerticalPerspectiveView(lat0, lon0, earth_radius, distance, false_easting, false_northing); return new ProjectionCT(ctv.getShortName(), "FGDC", proj); } }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new VerticalPerspectiveView(getOriginLat(), getOriginLon(), R, getHeight(), false_east, false_north); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new VerticalPerspectiveView(getOriginLat(), getOriginLon(), R, getHeight(), false_east, false_north); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new VerticalPerspectiveView(getOriginLat(), getOriginLon(), R, getHeight(), false_east, false_north); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
proj = new VerticalPerspectiveView(Lat0, Lon0, radius, height);