@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new EquidistantAzimuthalProjection(lat0, lon0, falseEasting, falseNorthing, earth); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
public EquidistantAzimuthalProjection(double lat0, double lon0, double falseEasting, double falseNorthing, Earth earth) { super("EquidistantAzimuthalProjection", false); this.lat0 = lat0; this.lon0 = lon0; this.projectionLatitude = Math.toRadians(lat0); this.projectionLongitude = Math.toRadians(lon0); this.falseEasting = falseEasting; this.falseNorthing = falseNorthing; this.earth = earth; this.e = earth.getEccentricity(); this.es = earth.getEccentricitySquared(); this.one_es = 1 - es; this.totalScale = earth.getMajor() * .001; // scale factor for cartesion coords in km. addParameter(CF.GRID_MAPPING_NAME, CF.AZIMUTHAL_EQUIDISTANT); addParameter(CF.LATITUDE_OF_PROJECTION_ORIGIN, lat0); addParameter(CF.LONGITUDE_OF_CENTRAL_MERIDIAN, lon0); if ((falseEasting != 0.0) || (falseNorthing != 0.0)) { addParameter(CF.FALSE_EASTING, falseEasting); addParameter(CF.FALSE_NORTHING, falseNorthing); addParameter(CDM.UNITS, "km"); } addParameter(CF.SEMI_MAJOR_AXIS, earth.getMajor()); addParameter(CF.INVERSE_FLATTENING, 1.0/earth.getFlattening()); initialize(); }
@Test public void testEAP() { testProjection(new EquidistantAzimuthalProjection()); EquidistantAzimuthalProjection p = new EquidistantAzimuthalProjection(); EquidistantAzimuthalProjection p2 = (EquidistantAzimuthalProjection) p.constructCopy(); assert p.equals(p2); }
public EquidistantAzimuthalProjection(double lat0, double lon0, double falseEasting, double falseNorthing, Earth earth) { super("EquidistantAzimuthalProjection", false); this.lat0 = lat0; this.lon0 = lon0; this.projectionLatitude = Math.toRadians(lat0); this.projectionLongitude = Math.toRadians(lon0); this.falseEasting = falseEasting; this.falseNorthing = falseNorthing; this.earth = earth; this.e = earth.getEccentricity(); this.es = earth.getEccentricitySquared(); this.one_es = 1 - es; this.totalScale = earth.getMajor() * .001; // scale factor for cartesion coords in km. addParameter(CF.GRID_MAPPING_NAME, CF.AZIMUTHAL_EQUIDISTANT); addParameter(CF.LATITUDE_OF_PROJECTION_ORIGIN, lat0); addParameter(CF.LONGITUDE_OF_CENTRAL_MERIDIAN, lon0); if ((falseEasting != 0.0) || (falseNorthing != 0.0)) { addParameter(CF.FALSE_EASTING, falseEasting); addParameter(CF.FALSE_NORTHING, falseNorthing); addParameter(CDM.UNITS, "km"); } addParameter(CF.SEMI_MAJOR_AXIS, earth.getMajor()); addParameter(CF.INVERSE_FLATTENING, 1.0 / earth.getFlattening()); initialize(); }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new EquidistantAzimuthalProjection(lat0, lon0, falseEasting, falseNorthing, earth); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
public EquidistantAzimuthalProjection(double lat0, double lon0, double falseEasting, double falseNorthing, Earth earth) { super("EquidistantAzimuthalProjection", false); Objects.requireNonNull(earth, "Azimuthal equidistant constructor requires non-null Earth"); this.lat0 = lat0; this.lon0 = lon0; this.projectionLatitude = Math.toRadians(lat0); this.projectionLongitude = Math.toRadians(lon0); this.falseEasting = falseEasting; this.falseNorthing = falseNorthing; this.earth = earth; this.e = earth.getEccentricity(); this.es = earth.getEccentricitySquared(); this.one_es = 1 - es; this.totalScale = earth.getMajor() * .001; // scale factor for cartesion coords in km. addParameter(CF.GRID_MAPPING_NAME, CF.AZIMUTHAL_EQUIDISTANT); addParameter(CF.LATITUDE_OF_PROJECTION_ORIGIN, lat0); addParameter(CF.LONGITUDE_OF_CENTRAL_MERIDIAN, lon0); if ((falseEasting != 0.0) || (falseNorthing != 0.0)) { addParameter(CF.FALSE_EASTING, falseEasting); addParameter(CF.FALSE_NORTHING, falseNorthing); addParameter(CDM.UNITS, "km"); } addParameter(CF.SEMI_MAJOR_AXIS, earth.getMajor()); addParameter(CF.INVERSE_FLATTENING, 1.0 / earth.getFlattening()); initialize(); }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new EquidistantAzimuthalProjection(lat0, lon0, falseEasting, falseNorthing, earth); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
public CoordinateTransform makeCoordinateTransform(NetcdfDataset ds, Variable ctv) { readStandardParams(ds, ctv); ucar.unidata.geoloc.ProjectionImpl proj = new EquidistantAzimuthalProjection(lat0, lon0, false_easting, false_northing, earth); return new ProjectionCT(ctv.getShortName(), "FGDC", proj); } }
public CoordinateTransform makeCoordinateTransform(NetcdfDataset ds, Variable ctv) { readStandardParams(ds, ctv); ucar.unidata.geoloc.ProjectionImpl proj = new EquidistantAzimuthalProjection(lat0, lon0, false_easting, false_northing, earth); return new ProjectionCT(ctv.getShortName(), "FGDC", proj); } }
public ProjectionCT makeCoordinateTransform(AttributeContainer ctv, String geoCoordinateUnits) { readStandardParams(ctv, geoCoordinateUnits); // create spherical Earth obj if not created by readStandardParams w radii, flattening if (earth == null) { if (earth_radius > 0.) { // Earth radius obtained in readStandardParams is in km, but Earth object wants m earth = new Earth(earth_radius * 1000.); } else { earth = new Earth(); } } ProjectionImpl proj = new EquidistantAzimuthalProjection(lat0, lon0, false_easting, false_northing, earth); return new ProjectionCT(ctv.getName(), "FGDC", proj); } }