/** * Set the origin longitude. * @param lon the origin longitude. */ public void setOriginLon(double lon) { origin.setLongitude(lon); lon0 = Math.toRadians(lon); precalculate(); }
/** * Set the origin latitude. * * @param lat the origin latitude. */ public void setOriginLat(double lat) { origin.setLatitude(lat); lat0 = Math.toRadians(lat); precalculate(); }
/** * Construct a FlatEarth Projection, two standard parellels. * For the one standard parellel case, set them both to the same value. * * @param lat0 lat origin of the coord. system on the projection plane * @param lon0 lon origin of the coord. system on the projection plane * @param rotAngle angle of rotation, in degrees * @throws IllegalArgumentException if lat0, par1, par2 = +/-90 deg */ public FlatEarth(double lat0, double lon0, double rotAngle) { this.lat0 = Math.toRadians(lat0); this.lon0 = Math.toRadians(lon0); this.rotAngle = Math.toRadians(rotAngle); origin = new LatLonPointImpl(lat0, lon0); precalculate(); addParameter(ATTR_NAME, "flat_earth"); addParameter("latitude_of_projection_origin", lat0); addParameter("longitude_of_projection_origin", lon0); addParameter("rotationAngle", rotAngle); }
/** * Construct a FlatEarth Projection, two standard parellels. * For the one standard parellel case, set them both to the same value. * * @param lat0 lat origin of the coord. system on the projection plane * @param lon0 lon origin of the coord. system on the projection plane * @param rotAngle angle of rotation, in degrees * @param radius earth radius in km * @throws IllegalArgumentException if lat0, par1, par2 = +/-90 deg */ public FlatEarth(double lat0, double lon0, double rotAngle, double radius) { super("FlatEarth", false); this.lat0 = Math.toRadians(lat0); this.lon0 = Math.toRadians(lon0); this.rotAngle = Math.toRadians(rotAngle); this.radius = radius; precalculate(); addParameter(CF.GRID_MAPPING_NAME, "flat_earth"); addParameter(CF.LATITUDE_OF_PROJECTION_ORIGIN, lat0); addParameter(CF.LONGITUDE_OF_PROJECTION_ORIGIN, lon0); addParameter(ROTATIONANGLE, rotAngle); addParameter(CF.EARTH_RADIUS, radius * 1000); }
/** * Construct a FlatEarth Projection, two standard parellels. * For the one standard parellel case, set them both to the same value. * * @param lat0 lat origin of the coord. system on the projection plane * @param lon0 lon origin of the coord. system on the projection plane * @param rotAngle angle of rotation, in degrees * @param radius earth radius in km * @throws IllegalArgumentException if lat0, par1, par2 = +/-90 deg */ public FlatEarth(double lat0, double lon0, double rotAngle, double radius) { super("FlatEarth", false); this.lat0 = Math.toRadians(lat0); this.lon0 = Math.toRadians(lon0); this.rotAngle = Math.toRadians(rotAngle); this.radius = radius; precalculate(); addParameter(CF.GRID_MAPPING_NAME, "flat_earth"); addParameter(CF.LATITUDE_OF_PROJECTION_ORIGIN, lat0); addParameter(CF.LONGITUDE_OF_PROJECTION_ORIGIN, lon0); addParameter(ROTATIONANGLE, rotAngle); addParameter(CF.EARTH_RADIUS, radius * 1000); }
/** * Construct a FlatEarth Projection, two standard parellels. * For the one standard parellel case, set them both to the same value. * * @param lat0 lat origin of the coord. system on the projection plane * @param lon0 lon origin of the coord. system on the projection plane * @param rotAngle angle of rotation, in degrees * @param radius earth radius in km * @throws IllegalArgumentException if lat0, par1, par2 = +/-90 deg */ public FlatEarth(double lat0, double lon0, double rotAngle, double radius) { super("FlatEarth", false); this.lat0 = Math.toRadians(lat0); this.lon0 = Math.toRadians(lon0); this.rotAngle = Math.toRadians(rotAngle); this.radius = radius; precalculate(); addParameter(CF.GRID_MAPPING_NAME, "flat_earth"); addParameter(CF.LATITUDE_OF_PROJECTION_ORIGIN, lat0); addParameter(CF.LONGITUDE_OF_PROJECTION_ORIGIN, lon0); addParameter(ROTATIONANGLE, rotAngle); addParameter(CF.EARTH_RADIUS, radius * 1000); }
/** * Construct a FlatEarth Projection, two standard parellels. * For the one standard parellel case, set them both to the same value. * * @param lat0 lat origin of the coord. system on the projection plane * @param lon0 lon origin of the coord. system on the projection plane * rotAngle angle of rotation is default to 0.0 * @throws IllegalArgumentException if lat0, par1, par2 = +/-90 deg */ public FlatEarth(double lat0, double lon0) { this.lat0 = Math.toRadians(lat0); this.lon0 = Math.toRadians(lon0); this.rotAngle = Math.toRadians(0.0); origin = new LatLonPointImpl(lat0, lon0); precalculate(); addParameter(ATTR_NAME, "flat_earth"); addParameter("latitude_of_projection_origin", lat0); addParameter("longitude_of_projection_origin", lon0); addParameter("rotationAngle", rotAngle); // addParameter("units", "km"); } // move this to ucar.unit or ucar.unidata.util