@Override protected RotatedPole createProjection(final ParameterValueGroup p) { if (p == null) return new RotatedPole(); return new RotatedPole(value(p, CF.GRID_NORTH_POLE_LATITUDE), value(p, CF.GRID_NORTH_POLE_LONGITUDE)); } }
/** * Constructor. * @param northPoleLat * @param northPoleLon */ public RotatedPole(double northPoleLat, double northPoleLon) { super("RotatedPole", false); northPole = new ProjectionPointImpl(northPoleLon, northPoleLat); buildRotationMatrices(); addParameter(CF.GRID_MAPPING_NAME, CF.ROTATED_LATITUDE_LONGITUDE); addParameter(CF.GRID_NORTH_POLE_LATITUDE, northPoleLat); addParameter(CF.GRID_NORTH_POLE_LONGITUDE, northPoleLon); }
public boolean equals(Object proj) { if (!(proj instanceof RotatedPole)) { return false; } RotatedPole oo = (RotatedPole) proj; if ((this.getDefaultMapArea() == null) != (oo.defaultMapArea == null)) return false; // common case is that these are null if (this.getDefaultMapArea() != null && !this.defaultMapArea.equals(oo.defaultMapArea)) return false; return this.getNorthPole().equals(oo.getNorthPole()); }
@Test public void testRotatedPole() { testProjectionLonMax(new RotatedPole(37, 177), 360, 88); RotatedPole p = new RotatedPole(); RotatedPole p2 = (RotatedPole) p.constructCopy(); assert p.equals(p2); }
lonNorthPole = LatLonPointImpl.lonNormal(lonCentre); RotatedPole proj = new RotatedPole(latNorthPole, lonNorthPole); proj.latLonToProj(unrotated, rotated);
public boolean equals(Object proj) { if (!(proj instanceof RotatedPole)) { return false; } RotatedPole oo = (RotatedPole) proj; return this.getNorthPole().equals(oo.getNorthPole()); }
/** * copy constructor - avoid clone !! */ public ProjectionImpl constructCopy() { return new RotatedPole(northPole.getY(), northPole.getX()); }
/** * Constructor. * @param northPoleLat * @param northPoleLon */ public RotatedPole(double northPoleLat, double northPoleLon) { northPole = new ProjectionPointImpl(northPoleLon, northPoleLat); buildRotationMatrices(); addParameter(ATTR_NAME, "rotated_latitude_longitude"); addParameter("grid_north_pole_latitude", northPoleLat); addParameter("grid_north_pole_longitude", northPoleLon); }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new RotatedPole(northPole.getY(), northPole.getX()); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
/** * Constructor. * @param northPoleLat * @param northPoleLon */ public RotatedPole(double northPoleLat, double northPoleLon) { super("RotatedPole", false); northPole = new ProjectionPointImpl(northPoleLon, northPoleLat); buildRotationMatrices(); addParameter(CF.GRID_MAPPING_NAME, CF.ROTATED_LATITUDE_LONGITUDE); addParameter(CF.GRID_NORTH_POLE_LATITUDE, northPoleLat); addParameter(CF.GRID_NORTH_POLE_LONGITUDE, northPoleLon); }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new RotatedPole(northPole.getY(), northPole.getX()); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
/** * Constructor. * @param northPoleLat * @param northPoleLon */ public RotatedPole(double northPoleLat, double northPoleLon) { super("RotatedPole", false); northPole = new ProjectionPointImpl(northPoleLon, northPoleLat); buildRotationMatrices(); addParameter(CF.GRID_MAPPING_NAME, CF.ROTATED_LATITUDE_LONGITUDE); addParameter(CF.GRID_NORTH_POLE_LATITUDE, northPoleLat); addParameter(CF.GRID_NORTH_POLE_LONGITUDE, northPoleLon); }
public CoordinateTransform makeCoordinateTransform(NetcdfDataset ds, Variable ctv) { double lon = readAttributeDouble( ctv, CF.GRID_NORTH_POLE_LONGITUDE, Double.NaN); double lat = readAttributeDouble( ctv, CF.GRID_NORTH_POLE_LATITUDE, Double.NaN); ucar.unidata.geoloc.projection.RotatedPole proj = new ucar.unidata.geoloc.projection.RotatedPole( lat, lon); return new ProjectionCT(ctv.getShortName(), "FGDC", proj); }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new RotatedPole(northPole.getY(), northPole.getX()); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
public CoordinateTransform makeCoordinateTransform(NetcdfDataset ds, Variable ctv) { double lon = readAttributeDouble( ctv, CF.GRID_NORTH_POLE_LONGITUDE, Double.NaN); double lat = readAttributeDouble( ctv, CF.GRID_NORTH_POLE_LATITUDE, Double.NaN); ucar.unidata.geoloc.projection.RotatedPole proj = new ucar.unidata.geoloc.projection.RotatedPole( lat, lon); return new ProjectionCT(ctv.getShortName(), "FGDC", proj); }
public ProjectionCT makeCoordinateTransform(AttributeContainer ctv, String geoCoordinateUnits) { double lon = readAttributeDouble( ctv, CF.GRID_NORTH_POLE_LONGITUDE, Double.NaN); double lat = readAttributeDouble( ctv, CF.GRID_NORTH_POLE_LATITUDE, Double.NaN); ucar.unidata.geoloc.projection.RotatedPole proj = new ucar.unidata.geoloc.projection.RotatedPole( lat, lon); return new ProjectionCT(ctv.getName(), "FGDC", proj); }
public GdsHorizCoordSys makeHorizCoordSys() { RotatedPole proj = new RotatedPole(latNorthPole, lonNorthPole); // LOOK dont transform - works for grib1 Q:/cdmUnitTest/transforms/HIRLAMhybrid.grib // LatLonPoint startLL = proj.projToLatLon(new ProjectionPointImpl(lo1, la1)); //double startx = startLL.getLongitude(); //double starty = startLL.getLatitude(); return new GdsHorizCoordSys(getNameShort(), template, getOctet4(7), scanMode, proj, lo1, deltaLon, la1, deltaLat, getNxRaw(), getNyRaw(), getNptsInLine()); }