/** * LambertConformal should accept latitude-at-origin that is at either pole. */ @Test public void acceptCenterLatAtAPole() { LambertConformal sp = new LambertConformal (-90., 0., 45., 45.); LambertConformal np = new LambertConformal ( 90., 0., 45., 45.); }
/** * LambertConformal should reject standard parallel #2 set to +90. */ @Test(expected=IllegalArgumentException.class) public void rejectParallel2AtNorthPole() { LambertConformal lc = new LambertConformal (45., 0., 45., 90.); } }
/** * LambertConformal should reject latitude-at-origin less than -90. */ @Test(expected=IllegalArgumentException.class) public void rejectCenterLatTooNegative() { LambertConformal lc = new LambertConformal (-91., 0., 30., 45.); }
/** * LambertConformal should reject standard parallel #1 set to -90. */ @Test(expected=IllegalArgumentException.class) public void rejectParallel1AtSouthPole() { LambertConformal lc = new LambertConformal (45., 0., -90., -45.); }
/** * LambertConformal should reject standard parallel #1 set to +90. */ @Test(expected=IllegalArgumentException.class) public void rejectParallel1AtNorthPole() { LambertConformal lc = new LambertConformal (45., 0., 90., 45.); }
/** * LambertConformal should reject standard parallel #2 set to -90. */ @Test(expected=IllegalArgumentException.class) public void rejectParallel2AtSouthPole() { LambertConformal lc = new LambertConformal (45., 0., -45., -90.); }
/** * LambertConformal should reject latitude-at-origin greater than +90. */ @Test(expected=IllegalArgumentException.class) public void rejectCenterLatTooPositive() { LambertConformal lc = new LambertConformal (+91., 0., 30., 45.); }
public void testLC() { doTests(new LambertConformal(40.0, 0, 20.0, 60.0), 0); }
@Override protected LambertConformal createProjection(final ParameterValueGroup p) { if (p == null) return new LambertConformal(); return new LambertConformal(value(p, CF.LATITUDE_OF_PROJECTION_ORIGIN), value(p, CF.LONGITUDE_OF_CENTRAL_MERIDIAN), value(p, CF.STANDARD_PARALLEL + "[1]"), value(p, CF.STANDARD_PARALLEL + "[2]"), value(p, CF.FALSE_EASTING) / KILOMETRE, value(p, CF.FALSE_NORTHING) / KILOMETRE, earthRadius(p) / KILOMETRE); } }
@Test public void testLC() { testProjection(new LambertConformal()); LambertConformal lc = new LambertConformal(); LambertConformal lc2 = (LambertConformal) lc.constructCopy(); assert lc.equals(lc2); }
private CoordinateTransform makeLCProjection(NetcdfDataset ds) { double par1 = findAttributeDouble(ds, "P_ALP"); double par2 = findAttributeDouble(ds, "P_BET"); double lon0 = findAttributeDouble(ds, "XCENT"); double lat0 = findAttributeDouble(ds, "YCENT"); LambertConformal lc = new LambertConformal(lat0, lon0, par1, par2, 0.0, 0.0, earthRadius); return new ProjectionCT("LambertConformalProjection", "FGDC", lc); }
private CoordinateTransform makeLCProjection(NetcdfDataset ds) { double par1 = findAttributeDouble(ds, "P_ALP"); double par2 = findAttributeDouble(ds, "P_BET"); double lon0 = findAttributeDouble(ds, "XCENT"); double lat0 = findAttributeDouble(ds, "YCENT"); LambertConformal lc = new LambertConformal(lat0, lon0, par1, par2, 0.0, 0.0, earthRadius); return new ProjectionCT("LambertConformalProjection", "FGDC", lc); }
private CoordinateTransform makeLCProjection(NetcdfDataset ds) { double par1 = findAttributeDouble(ds, "P_ALP"); double par2 = findAttributeDouble(ds, "P_BET"); double lon0 = findAttributeDouble(ds, "XCENT"); double lat0 = findAttributeDouble(ds, "YCENT"); LambertConformal lc = new LambertConformal(lat0, lon0, par1, par2, 0.0, 0.0, earthRadius); return new ProjectionCT("LambertConformalProjection", "FGDC", lc); }
public ProjectionImpl constructCopy() { return new LambertConformal(getOriginLat(), getOriginLon(), getParallelOne(), getParallelTwo(), getFalseEasting(), getFalseNorthing()); }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new LambertConformal(getOriginLat(), getOriginLon(), getParallelOne(), getParallelTwo(), getFalseEasting(), getFalseNorthing(), earth_radius); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new LambertConformal(getOriginLat(), getOriginLon(), getParallelOne(), getParallelTwo(), getFalseEasting(), getFalseNorthing(), earth_radius); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new LambertConformal(getOriginLat(), getOriginLon(), getParallelOne(), getParallelTwo(), getFalseEasting(), getFalseNorthing(), earth_radius); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
public void utestProblem() { ProjectionImpl p = new LambertConformal(40.0, 0, 20.0, 60.0); LatLonPointImpl ptL = new LatLonPointImpl(-10, 135); LatLonPointImpl ptL2 = new LatLonPointImpl(10, 157.5); LatLonRect llbb = new LatLonRect(ptL, ptL2); ProjectionPoint pt1 = p.latLonToProj(ptL); ProjectionPoint pt2 = p.latLonToProj(ptL2); System.out.println("pt1 = "+pt1); System.out.println("pt2 = "+pt2); ProjectionPoint lr = p.latLonToProj(llbb.getLowerRightPoint()); System.out.println("lr = "+lr); if (!p.crossSeam(pt1, pt2)) doTest(p, llbb); } }
@Test public void testLCseam() { // test seam crossing LambertConformal lc = new LambertConformal(40.0, 180.0, 20.0, 60.0); ProjectionPointImpl p1 = (ProjectionPointImpl) lc.latLonToProj(new LatLonPointImpl(0.0, -1.0), new ProjectionPointImpl()); ProjectionPointImpl p2 = (ProjectionPointImpl) lc.latLonToProj(new LatLonPointImpl(0.0, 1.0), new ProjectionPointImpl()); if (show) { System.out.printf(" p1= x=%f y=%f%n", p1.getX(), p1.getY()); System.out.printf(" p2= x=%f y=%f%n", p2.getX(), p2.getY()); } assert lc.crossSeam(p1, p2); }
public GdsHorizCoordSys makeHorizCoordSys() { ProjectionImpl proj = null; Earth earth = getEarth(); if (earth.isSpherical()) { proj = new ucar.unidata.geoloc.projection.LambertConformal(latin1, lov, latin1, latin2, 0.0, 0.0, earth.getEquatorRadius() * .001); } else { proj = new ucar.unidata.geoloc.projection.proj4.LambertConformalConicEllipse(latin1, lov, latin1, latin2, 0.0, 0.0, earth); } LatLonPointImpl startLL = new LatLonPointImpl(la1, lo1); ProjectionPointImpl start = (ProjectionPointImpl) proj.latLonToProj(startLL); return new GdsHorizCoordSys(getNameShort(), template, 0, scanMode, proj, start.getX(), getDx(), start.getY(), getDy(), getNx(), getNy(), null); }