/** * Construct a Stereographic Projection using latitude of true scale and calculating scale factor. * <p> Since the scale factor at lat = k = 2*k0/(1+sin(lat)) [Snyder,Working Manual p157] * then to make scale = 1 at lat, set k0 = (1+sin(lat))/2 * * @param latt tangent point of projection, also origin of projection coord system * @param lont tangent point of projection, also origin of projection coord system * @param latTrue latitude of true scale in degrees north; latitude where scale factor = 1.0 * @return Stereographic projection */ static public Stereographic factory(double latt, double lont, double latTrue) { double scale = (1.0 + Math.sin(Math.toRadians(latTrue))) / 2.0; return new Stereographic(latt, lont, scale); }
/** * Construct a Stereographic Projection using latitude of true scale and calculating scale factor. * <p> Since the scale factor at lat = k = 2*k0/(1+sin(lat)) [Snyder,Working Manual p157] * then to make scale = 1 at lat, set k0 = (1+sin(lat))/2 * * @param latt tangent point of projection, also origin of projection coord system * @param lont tangent point of projection, also origin of projection coord system * @param latTrue latitude of true scale in degrees north; latitude where scale factor = 1.0 * @return Stereographic projection */ static public Stereographic factory(double latt, double lont, double latTrue) { double scale = (1.0 + Math.sin(Math.toRadians(latTrue))) / 2.0; return new Stereographic(latt, lont, scale); }
/** * Construct a Stereographic Projection using latitude of true scale and calculating scale factor. * <p> Since the scale factor at lat = k = 2*k0/(1+sin(lat)) [Snyder,Working Manual p157] * then to make scale = 1 at lat, set k0 = (1+sin(lat))/2 * * @param latt tangent point of projection, also origin of projection coord system * @param lont tangent point of projection, also origin of projection coord system * @param latTrue latitude of true scale in degrees north; latitude where scale factor = 1.0 * @return Stereographic projection */ static public Stereographic factory(double latt, double lont, double latTrue) { double scale = (1.0 + Math.sin(Math.toRadians(latTrue))) / 2.0; return new Stereographic(latt, lont, scale); }
/** * Construct a Stereographic Projection using latitude of true scale and calculating scale factor. * <p> Since the scale factor at lat = k = 2*k0/(1+sin(lat)) [Snyder,Working Manual p157] * then to make scale = 1 at lat, set k0 = (1+sin(lat))/2 * * @param latt tangent point of projection, also origin of projection coord system * @param lont tangent point of projection, also origin of projection coord system * @param latTrue latitude of true scale in degrees north; latitude where scale factor = 1.0 * @return Stereographic projection */ static public Stereographic factory(double latt, double lont, double latTrue) { double scale = (1.0 + Math.sin(Math.toRadians(latTrue))) / 2.0; return new Stereographic(latt, lont, scale); }
@Override protected Stereographic createProjection(final ParameterValueGroup p) { if (p == null) return new Stereographic(); return new Stereographic(value(p, CF.LATITUDE_OF_PROJECTION_ORIGIN), value(p, CF.LONGITUDE_OF_PROJECTION_ORIGIN), value(p, CF.SCALE_FACTOR_AT_PROJECTION_ORIGIN), value(p, CF.FALSE_EASTING) / KILOMETRE, value(p, CF.FALSE_NORTHING) / KILOMETRE, earthRadius(p) / KILOMETRE); } }
private CoordinateTransform makeSTProjection(NetcdfDataset ds) { double latt = findAttributeDouble(ds, "PROJ_ALPHA"); if (Double.isNaN(latt)) latt = findAttributeDouble(ds, "P_ALP"); double lont = findAttributeDouble(ds, "PROJ_BETA"); if (Double.isNaN(lont)) lont = findAttributeDouble(ds, "P_BET"); /** * Construct a Stereographic Projection. * @param latt tangent point of projection, also origin of projecion coord system * @param lont tangent point of projection, also origin of projecion coord system * @param scale scale factor at tangent point, "normally 1.0 but may be reduced" */ Stereographic st = new Stereographic(latt, lont, 1.0, 0.0, 0.0, earthRadius); return new ProjectionCT("StereographicProjection", "FGDC", st); }
private CoordinateTransform makeSTProjection(NetcdfDataset ds) { double latt = findAttributeDouble(ds, "PROJ_ALPHA"); if (Double.isNaN(latt)) latt = findAttributeDouble(ds, "P_ALP"); double lont = findAttributeDouble(ds, "PROJ_BETA"); if (Double.isNaN(lont)) lont = findAttributeDouble(ds, "P_BET"); /** * Construct a Stereographic Projection. * @param latt tangent point of projection, also origin of projecion coord system * @param lont tangent point of projection, also origin of projecion coord system * @param scale scale factor at tangent point, "normally 1.0 but may be reduced" */ Stereographic st = new Stereographic(latt, lont, 1.0, 0.0, 0.0, earthRadius); return new ProjectionCT("StereographicProjection", "FGDC", st); }
private CoordinateTransform makeSTProjection(NetcdfDataset ds) { double latt = findAttributeDouble(ds, "PROJ_ALPHA"); if (Double.isNaN(latt)) latt = findAttributeDouble(ds, "P_ALP"); double lont = findAttributeDouble(ds, "PROJ_BETA"); if (Double.isNaN(lont)) lont = findAttributeDouble(ds, "P_BET"); /** * Construct a Stereographic Projection. * @param latt tangent point of projection, also origin of projecion coord system * @param lont tangent point of projection, also origin of projecion coord system * @param scale scale factor at tangent point, "normally 1.0 but may be reduced" */ Stereographic st = new Stereographic(latt, lont, 1.0, 0.0, 0.0, earthRadius); return new ProjectionCT("StereographicProjection", "FGDC", st); }
private CoordinateTransform makePolarStereographicProjection(NetcdfDataset ds) { //boolean n_polar = (findAttributeDouble(ds, "P_ALP") == 1.0); //double central_meridian = findAttributeDouble(ds, "P_GAM"); double lon0 = findAttributeDouble(ds, "XCENT"); double lat0 = findAttributeDouble(ds, "YCENT"); double latts = findAttributeDouble(ds, "P_BET"); Stereographic sg = new Stereographic(latts, lat0, lon0, 0.0, 0.0, earthRadius); //sg.setCentralMeridian(centeral_meridian); return new ProjectionCT("PolarStereographic", "FGDC", sg); }
private CoordinateTransform makePolarStereographicProjection(NetcdfDataset ds) { //boolean n_polar = (findAttributeDouble(ds, "P_ALP") == 1.0); //double central_meridian = findAttributeDouble(ds, "P_GAM"); double lon0 = findAttributeDouble(ds, "XCENT"); double lat0 = findAttributeDouble(ds, "YCENT"); double latts = findAttributeDouble(ds, "P_BET"); Stereographic sg = new Stereographic(latts, lat0, lon0, 0.0, 0.0, earthRadius); //sg.setCentralMeridian(centeral_meridian); return new ProjectionCT("PolarStereographic", "FGDC", sg); }
private CoordinateTransform makePolarStereographicProjection(NetcdfDataset ds) { //boolean n_polar = (findAttributeDouble(ds, "P_ALP") == 1.0); //double central_meridian = findAttributeDouble(ds, "P_GAM"); double lon0 = findAttributeDouble(ds, "XCENT"); double lat0 = findAttributeDouble(ds, "YCENT"); double latts = findAttributeDouble(ds, "P_BET"); Stereographic sg = new Stereographic(latts, lat0, lon0, 0.0, 0.0, earthRadius); //sg.setCentralMeridian(centeral_meridian); return new ProjectionCT("PolarStereographic", "FGDC", sg); }
/** * copy constructor - avoid clone !! */ public ProjectionImpl constructCopy() { return new Stereographic(getTangentLat(), getTangentLon(), getScale(), getFalseEasting(), getFalseNorthing()); }
@Test public void testStereo() { testProjection(new Stereographic()); Stereographic p = new Stereographic(); Stereographic p2 = (Stereographic) p.constructCopy(); assert p.equals(p2); }
public GdsHorizCoordSys makeHorizCoordSys() { boolean northPole = (projCenterFlag & 128) == 0; double latOrigin = northPole ? 90.0 : -90.0; // Why the scale factor?. according to GRIB docs: // "Grid lengths are in units of meters, at the 60 degree latitude circle nearest to the pole" // since the scale factor at 60 degrees = k = 2*k0/(1+sin(60)) [Snyder,Working Manual p157] // then to make scale = 1 at 60 degrees, k0 = (1+sin(60))/2 = .933 double scale; if (Double.isNaN(lad)) { // LOOK ?? scale = 0.9330127018922193; } else { scale = (1.0 + Math.sin(Math.toRadians( Math.abs(lad)))) / 2; } ProjectionImpl proj; Earth earth = getEarth(); if (earth.isSpherical()) { proj = new Stereographic(latOrigin, lov, scale); } else { proj = new ucar.unidata.geoloc.projection.proj4.StereographicAzimuthalProjection(latOrigin, lov, scale, lad, 0.0, 0.0, earth); } ProjectionPointImpl start = (ProjectionPointImpl) proj.latLonToProj(new LatLonPointImpl(la1, lo1)); return new GdsHorizCoordSys(getNameShort(), template, 0, scanMode, proj, start.getX(), getDx(), start.getY(), getDy(), getNx(), getNy(), null); }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new Stereographic(getTangentLat(), getTangentLon(), getScale(), getFalseEasting(), getFalseNorthing(), getEarthRadius()); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new Stereographic(getTangentLat(), getTangentLon(), getScale(), getFalseEasting(), getFalseNorthing(), getEarthRadius()); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new Stereographic(getTangentLat(), getTangentLon(), getScale(), getFalseEasting(), getFalseNorthing(), getEarthRadius()); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
private ProjectionCT makePSProjection() throws NoSuchElementException { double lov = navInfo.getDouble( "Lov"); double la1 = navInfo.getDouble( "La1"); double lo1 = navInfo.getDouble( "Lo1"); // Why the scale factor?. accordining to GRID docs: // "Grid lengths are in units of meters, at the 60 degree latitude circle nearest to the pole" // since the scale factor at 60 degrees = k = 2*k0/(1+sin(60)) [Snyder,Working Manual p157] // then to make scale = 1 at 60 degrees, k0 = (1+sin(60))/2 = .933 Stereographic ps = new Stereographic(90.0, lov, .933); // we have to project in order to find the origin ProjectionPointImpl start = (ProjectionPointImpl) ps.latLonToProj( new LatLonPointImpl( la1, lo1)); if (debug) System.out.println("start at proj coord "+start); startx = start.getX(); starty = start.getY(); nx = navInfo.getInt( "Nx"); ny = navInfo.getInt( "Ny"); dx = navInfo.getDouble( "Dx")/1000.0; dy = navInfo.getDouble( "Dy")/1000.0; return new ProjectionCT(grid_name, "FGDC", ps); }
private ProjectionCT makePSProjection() throws NoSuchElementException { double lov = navInfo.getDouble( "Lov"); double la1 = navInfo.getDouble( "La1"); double lo1 = navInfo.getDouble( "Lo1"); // Why the scale factor?. accordining to GRID docs: // "Grid lengths are in units of meters, at the 60 degree latitude circle nearest to the pole" // since the scale factor at 60 degrees = k = 2*k0/(1+sin(60)) [Snyder,Working Manual p157] // then to make scale = 1 at 60 degrees, k0 = (1+sin(60))/2 = .933 Stereographic ps = new Stereographic(90.0, lov, .933); // we have to project in order to find the origin ProjectionPointImpl start = (ProjectionPointImpl) ps.latLonToProj( new LatLonPointImpl( la1, lo1)); if (debug) System.out.println("start at proj coord "+start); startx = start.getX(); starty = start.getY(); nx = navInfo.getInt( "Nx"); ny = navInfo.getInt( "Ny"); dx = navInfo.getDouble( "Dx")/1000.0; dy = navInfo.getDouble( "Dy")/1000.0; return new ProjectionCT(grid_name, "FGDC", ps); }
private ProjectionCT makePSProjection() throws NoSuchElementException { double lov = navInfo.getDouble( "Lov"); double la1 = navInfo.getDouble( "La1"); double lo1 = navInfo.getDouble( "Lo1"); // Why the scale factor?. accordining to GRID docs: // "Grid lengths are in units of meters, at the 60 degree latitude circle nearest to the pole" // since the scale factor at 60 degrees = k = 2*k0/(1+sin(60)) [Snyder,Working Manual p157] // then to make scale = 1 at 60 degrees, k0 = (1+sin(60))/2 = .933 Stereographic ps = new Stereographic(90.0, lov, .933); // we have to project in order to find the origin ProjectionPointImpl start = (ProjectionPointImpl) ps.latLonToProj( new LatLonPointImpl( la1, lo1)); if (debug) System.out.println("start at proj coord "+start); startx = start.getX(); starty = start.getY(); nx = navInfo.getInt( "Nx"); ny = navInfo.getInt( "Ny"); dx = navInfo.getDouble( "Dx")/1000.0; dy = navInfo.getDouble( "Dy")/1000.0; return new ProjectionCT(grid_name, "FGDC", ps); }