/** copy constructor - avoid clone !! */ public ProjectionImpl constructCopy( ) { return new LambertAzimuthalEqualArea( getOriginLat(), getOriginLon(), getFalseEasting(), getFalseNorthing(), R); }
/** * Test * * @param args not used */ public static void main(String[] args) { LambertAzimuthalEqualArea a = new LambertAzimuthalEqualArea(40, -100); ProjectionPointImpl p = a.latLonToProj(-20, 100); System.out.println("proj point = " + p); LatLonPoint ll = a.projToLatLon(p); System.out.println("ll = " + ll); } }
/** * Set the origin latitude. * * @param lat the origin latitude. */ public void setOriginLat(double lat) { lat0 = Math.toRadians(lat); precalculate(); }
/** * Check for equality with the Object in question * * @param proj object to check * @return true if they are equal */ public boolean equals(Object proj) { if ( !(proj instanceof LambertAzimuthalEqualArea)) { return false; } LambertAzimuthalEqualArea oo = (LambertAzimuthalEqualArea) proj; return ((this.getOriginLat() == oo.getOriginLat()) && (this.getOriginLon() == oo.getOriginLon()) && this.defaultMapArea.equals(oo.defaultMapArea)); }
@Override protected LambertAzimuthalEqualArea createProjection(final ParameterValueGroup p) { if (p == null) return new LambertAzimuthalEqualArea(); return new LambertAzimuthalEqualArea(value(p, CF.LATITUDE_OF_PROJECTION_ORIGIN), value(p, CF.LONGITUDE_OF_PROJECTION_ORIGIN), value(p, CF.FALSE_EASTING) / KILOMETRE, value(p, CF.FALSE_NORTHING) / KILOMETRE, earthRadius(p) / KILOMETRE); } }
this.falseNorthing = false_northing; precalculate(); addParameter(CF.GRID_MAPPING_NAME, CF.LAMBERT_AZIMUTHAL_EQUAL_AREA); addParameter(CF.LATITUDE_OF_PROJECTION_ORIGIN, lat0); addParameter(CF.LONGITUDE_OF_PROJECTION_ORIGIN, lon0); addParameter(CF.EARTH_RADIUS, earthRadius * 1000); if ((false_easting != 0.0) || (false_northing != 0.0)) { addParameter(CF.FALSE_EASTING, false_easting); addParameter(CF.FALSE_NORTHING, false_northing); addParameter(CDM.UNITS, "km");
@Test public void testLA() { testProjection(new LambertAzimuthalEqualArea()); LambertAzimuthalEqualArea p = new LambertAzimuthalEqualArea(); LambertAzimuthalEqualArea p2 = (LambertAzimuthalEqualArea) p.constructCopy(); assert p.equals(p2); }
/** * Create a String of the parameters. * * @return a String of the parameters */ public String paramsToString() { return toString(); }
public ProjectionCT makeCoordinateTransform(AttributeContainer ctv, String geoCoordinateUnits) { readStandardParams(ctv, geoCoordinateUnits); ucar.unidata.geoloc.projection.LambertAzimuthalEqualArea proj = new ucar.unidata.geoloc.projection.LambertAzimuthalEqualArea(lat0, lon0, false_easting, false_northing, earth_radius); return new ProjectionCT(ctv.getName(), "FGDC", proj); } }
this.falseNorthing = false_northing; precalculate(); addParameter(CF.GRID_MAPPING_NAME, CF.LAMBERT_AZIMUTHAL_EQUAL_AREA); addParameter(CF.LATITUDE_OF_PROJECTION_ORIGIN, lat0); addParameter(CF.LONGITUDE_OF_PROJECTION_ORIGIN, lon0); addParameter(CF.EARTH_RADIUS, earthRadius * 1000); if ((false_easting != 0.0) || (false_northing != 0.0)) { addParameter(CF.FALSE_EASTING, false_easting); addParameter(CF.FALSE_NORTHING, false_northing); addParameter(CDM.UNITS, "km");
/** * Clone this projection. * * @return Clone of this */ public Object clone() { LambertAzimuthalEqualArea cl = (LambertAzimuthalEqualArea) super.clone(); cl.origin = new LatLonPointImpl(getOriginLat(), getOriginLon()); return cl; }
/** * Create a String of the parameters. * * @return a String of the parameters */ public String paramsToString() { return toString(); }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new LambertAzimuthalEqualArea(getOriginLat(), getOriginLon(), getFalseEasting(), getFalseNorthing(), R); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
/** * Test * * @param args not used */ public static void main(String[] args) { LambertAzimuthalEqualArea a = new LambertAzimuthalEqualArea(40, -100); ProjectionPoint p = a.latLonToProj(-20, 100); System.out.println("proj point = " + p); LatLonPoint ll = a.projToLatLon(p); System.out.println("ll = " + ll); } }
private CoordinateTransform makeLambertAzimuthalProjection(NetcdfDataset ds) { double lat0 = findAttributeDouble(ds, "YCENT"); double lon0 = findAttributeDouble(ds, "XCENT"); LambertAzimuthalEqualArea p = new LambertAzimuthalEqualArea(lat0, lon0, 0.0, 0.0, earthRadius); return new ProjectionCT("LambertAzimuthal", "FGDC", p); }
this.falseNorthing = false_northing; precalculate(); addParameter(CF.GRID_MAPPING_NAME, CF.LAMBERT_AZIMUTHAL_EQUAL_AREA); addParameter(CF.LATITUDE_OF_PROJECTION_ORIGIN, lat0); addParameter(CF.LONGITUDE_OF_PROJECTION_ORIGIN, lon0); addParameter(CF.EARTH_RADIUS, earthRadius * 1000); if ((false_easting != 0.0) || (false_northing != 0.0)) { addParameter(CF.FALSE_EASTING, false_easting); addParameter(CF.FALSE_NORTHING, false_northing); addParameter(CDM.UNITS, "km");
/** * Set the origin latitude. * * @param lat the origin latitude. */ public void setOriginLat(double lat) { lat0 = Math.toRadians(lat); precalculate(); }
/** * Create a String of the parameters. * * @return a String of the parameters */ public String paramsToString() { return toString(); }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new LambertAzimuthalEqualArea(getOriginLat(), getOriginLon(), getFalseEasting(), getFalseNorthing(), R); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
/** * Test * * @param args not used */ public static void main(String[] args) { LambertAzimuthalEqualArea a = new LambertAzimuthalEqualArea(40, -100); ProjectionPoint p = a.latLonToProj(-20, 100); System.out.println("proj point = " + p); LatLonPoint ll = a.projToLatLon(p); System.out.println("ll = " + ll); } }