@Test public void testCircumscribeFullDisk_Ellipsoidal() throws TransformException, FactoryException { final Envelope2D circumscribed = GeostationarySatellite.circumscribeFullDisk(ellipsoidalGeosCRS); assertThat(circumscribed, is(notNullValue())); final DirectPosition2D p = new DirectPosition2D(); p.setLocation(circumscribed.getCenterX(), circumscribed.getMaxY()); ellipsoidalGeosToGeog.transform(p, p); assertThat(p, is(notNullValue())); geogToEllipsoidalGeos.transform(p, p); assertThat(p, is(notNullValue())); p.setLocation(circumscribed.getCenterX(), circumscribed.getMinY()); ellipsoidalGeosToGeog.transform(p, p); assertThat(p, is(notNullValue())); geogToEllipsoidalGeos.transform(p, p); assertThat(p, is(notNullValue())); p.setLocation(circumscribed.getMaxX(), circumscribed.getCenterY()); ellipsoidalGeosToGeog.transform(p, p); assertThat(p, is(notNullValue())); geogToEllipsoidalGeos.transform(p, p); assertThat(p, is(notNullValue())); p.setLocation(circumscribed.getMinX(), circumscribed.getCenterY()); ellipsoidalGeosToGeog.transform(p, p); assertThat(p, is(notNullValue())); geogToEllipsoidalGeos.transform(p, p); assertThat(p, is(notNullValue())); final double tickle = 1; expectProjectionException( new Testable() { public void test() throws Exception { p.setLocation(circumscribed.getCenterX(), circumscribed.getMaxY() + tickle); ellipsoidalGeosToGeog.transform(p, p); } }); expectProjectionException( new Testable() { public void test() throws Exception { p.setLocation(circumscribed.getCenterX(), circumscribed.getMinY() - tickle); ellipsoidalGeosToGeog.transform(p, p); } }); expectProjectionException( new Testable() { public void test() throws Exception { p.setLocation(circumscribed.getMinX() - tickle, circumscribed.getCenterY()); ellipsoidalGeosToGeog.transform(p, p); } }); expectProjectionException( new Testable() { public void test() throws Exception { p.setLocation(circumscribed.getMaxX() + tickle, circumscribed.getCenterY()); ellipsoidalGeosToGeog.transform(p, p); } }); expectProjectionException( new Testable() { public void test() throws Exception { p.setLocation(circumscribed.getMaxX(), circumscribed.getMaxY()); ellipsoidalGeosToGeog.transform(p, p); } }); expectProjectionException( new Testable() { public void test() throws Exception { p.setLocation(circumscribed.getMaxX(), circumscribed.getMinY()); ellipsoidalGeosToGeog.transform(p, p); } }); expectProjectionException( new Testable() { public void test() throws Exception { p.setLocation(circumscribed.getMinX(), circumscribed.getMaxY()); ellipsoidalGeosToGeog.transform(p, p); } }); expectProjectionException( new Testable() { public void test() throws Exception { p.setLocation(circumscribed.getMinX(), circumscribed.getMinY()); ellipsoidalGeosToGeog.transform(p, p); } }); }
public static Envelope2D circumscribeFullDisk(CoordinateReferenceSystem geosCRS) throws TransformException, FactoryException { if (!isGeostationaryCRS(geosCRS)) { return null; } MathTransform mt = CRS.findMathTransform(geosCRS, CRS.getProjectedCRS(geosCRS).getBaseCRS(), true); MathTransform imt = mt.inverse(); ParameterValueGroup parameters = CRS.getMapProjection(geosCRS).getParameterValues(); double semiMajorAxis = parameters.parameter("semi_major").doubleValue(); double satelliteHeight = parameters.parameter("satellite_height").doubleValue(); double centralMeridian = parameters.parameter("central_meridian").doubleValue(); DirectPosition2D dp2d = new DirectPosition2D(); double halfFoVRadians = Math.acos(semiMajorAxis / (satelliteHeight + semiMajorAxis)); double halfFoVDegrees = Math.toDegrees(halfFoVRadians); dp2d.setLocation(centralMeridian - halfFoVDegrees, 0.); imt.transform(dp2d, dp2d); double xMin = dp2d.getX(); dp2d.setLocation(centralMeridian + halfFoVDegrees, 0.); imt.transform(dp2d, dp2d); double xMax = dp2d.getX(); dp2d.setLocation(centralMeridian, -halfFoVDegrees); imt.transform(dp2d, dp2d); double yMin = dp2d.getY(); dp2d.setLocation(centralMeridian, halfFoVDegrees); imt.transform(dp2d, dp2d); double yMax = dp2d.getY(); return new Envelope2D(geosCRS, xMin, yMin, xMax - xMin, yMax - yMin); }
GeostationarySatellite extends MapProjection { public static Envelope2D circumscribeFullDisk(CoordinateReferenceSystem geosCRS) throws TransformException, FactoryException { if (!isGeostationaryCRS(geosCRS)) { return null; } MathTransform mt = CRS.findMathTransform(geosCRS, CRS.getProjectedCRS(geosCRS).getBaseCRS(), true); MathTransform imt = mt.inverse(); ParameterValueGroup parameters = CRS.getMapProjection(geosCRS).getParameterValues(); double semiMajorAxis = parameters.parameter("semi_major").doubleValue(); double satelliteHeight = parameters.parameter("satellite_height").doubleValue(); double centralMeridian = parameters.parameter("central_meridian").doubleValue(); DirectPosition2D dp2d = new DirectPosition2D(); double halfFoVRadians = Math.acos(semiMajorAxis / (satelliteHeight + semiMajorAxis)); double halfFoVDegrees = Math.toDegrees(halfFoVRadians); dp2d.setLocation(centralMeridian - halfFoVDegrees, 0.); imt.transform(dp2d, dp2d); double xMin = dp2d.getX(); dp2d.setLocation(centralMeridian + halfFoVDegrees, 0.); imt.transform(dp2d, dp2d); double xMax = dp2d.getX(); dp2d.setLocation(centralMeridian, -halfFoVDegrees); imt.transform(dp2d, dp2d); double yMin = dp2d.getY(); dp2d.setLocation(centralMeridian, halfFoVDegrees); imt.transform(dp2d, dp2d); double yMax = dp2d.getY(); return new Envelope2D(geosCRS, xMin, yMin, xMax - xMin, yMax - yMin); } }
GeostationarySatellite extends MapProjection { public static Envelope2D circumscribeFullDisk(CoordinateReferenceSystem geosCRS) throws TransformException, FactoryException { if (!isGeostationaryCRS(geosCRS)) { return null; } MathTransform mt = CRS.findMathTransform(geosCRS, CRS.getProjectedCRS(geosCRS).getBaseCRS(), true); MathTransform imt = mt.inverse(); ParameterValueGroup parameters = CRS.getMapProjection(geosCRS).getParameterValues(); double semiMajorAxis = parameters.parameter("semi_major").doubleValue(); double satelliteHeight = parameters.parameter("satellite_height").doubleValue(); double centralMeridian = parameters.parameter("central_meridian").doubleValue(); DirectPosition2D dp2d = new DirectPosition2D(); double halfFoVRadians = Math.acos(semiMajorAxis / (satelliteHeight + semiMajorAxis)); double halfFoVDegrees = Math.toDegrees(halfFoVRadians); dp2d.setLocation(centralMeridian - halfFoVDegrees, 0.); imt.transform(dp2d, dp2d); double xMin = dp2d.getX(); dp2d.setLocation(centralMeridian + halfFoVDegrees, 0.); imt.transform(dp2d, dp2d); double xMax = dp2d.getX(); dp2d.setLocation(centralMeridian, -halfFoVDegrees); imt.transform(dp2d, dp2d); double yMin = dp2d.getY(); dp2d.setLocation(centralMeridian, halfFoVDegrees); imt.transform(dp2d, dp2d); double yMax = dp2d.getY(); return new Envelope2D(geosCRS, xMin, yMin, xMax - xMin, yMax - yMin); } GeostationarySatellite(ParameterValueGroup parameters); }
GeostationarySatellite extends MapProjection { public static Envelope2D circumscribeFullDisk(CoordinateReferenceSystem geosCRS) throws TransformException, FactoryException { if (!isGeostationaryCRS(geosCRS)) { return null; } MathTransform mt = CRS.findMathTransform(geosCRS, CRS.getProjectedCRS(geosCRS).getBaseCRS(), true); MathTransform imt = mt.inverse(); ParameterValueGroup parameters = CRS.getMapProjection(geosCRS).getParameterValues(); double semiMajorAxis = parameters.parameter("semi_major").doubleValue(); double satelliteHeight = parameters.parameter("satellite_height").doubleValue(); double centralMeridian = parameters.parameter("central_meridian").doubleValue(); DirectPosition2D dp2d = new DirectPosition2D(); double halfFoVRadians = Math.acos(semiMajorAxis / (satelliteHeight + semiMajorAxis)); double halfFoVDegrees = Math.toDegrees(halfFoVRadians); dp2d.setLocation(centralMeridian - halfFoVDegrees, 0.); imt.transform(dp2d, dp2d); double xMin = dp2d.getX(); dp2d.setLocation(centralMeridian + halfFoVDegrees, 0.); imt.transform(dp2d, dp2d); double xMax = dp2d.getX(); dp2d.setLocation(centralMeridian, -halfFoVDegrees); imt.transform(dp2d, dp2d); double yMin = dp2d.getY(); dp2d.setLocation(centralMeridian, halfFoVDegrees); imt.transform(dp2d, dp2d); double yMax = dp2d.getY(); return new Envelope2D(geosCRS, xMin, yMin, xMax - xMin, yMax - yMin); } GeostationarySatellite(ParameterValueGroup parameters); @Override ParameterDescriptorGroup getParameterDescriptors(); @Override ParameterValueGroup getParameterValues(); static Envelope2D circumscribeFullDisk(CoordinateReferenceSystem geosCRS); static Envelope2D inscribeFullDiskEstimate(CoordinateReferenceSystem geosCRS); }
GeostationarySatellite extends MapProjection { public static Envelope2D circumscribeFullDisk(CoordinateReferenceSystem geosCRS) throws TransformException, FactoryException { if (!isGeostationaryCRS(geosCRS)) { return null; } MathTransform mt = CRS.findMathTransform(geosCRS, CRS.getProjectedCRS(geosCRS).getBaseCRS(), true); MathTransform imt = mt.inverse(); ParameterValueGroup parameters = CRS.getMapProjection(geosCRS).getParameterValues(); double semiMajorAxis = parameters.parameter("semi_major").doubleValue(); double satelliteHeight = parameters.parameter("satellite_height").doubleValue(); double centralMeridian = parameters.parameter("central_meridian").doubleValue(); DirectPosition2D dp2d = new DirectPosition2D(); double halfFoVRadians = Math.acos(semiMajorAxis / (satelliteHeight + semiMajorAxis)); double halfFoVDegrees = Math.toDegrees(halfFoVRadians); dp2d.setLocation(centralMeridian - halfFoVDegrees, 0.); imt.transform(dp2d, dp2d); double xMin = dp2d.getX(); dp2d.setLocation(centralMeridian + halfFoVDegrees, 0.); imt.transform(dp2d, dp2d); double xMax = dp2d.getX(); dp2d.setLocation(centralMeridian, -halfFoVDegrees); imt.transform(dp2d, dp2d); double yMin = dp2d.getY(); dp2d.setLocation(centralMeridian, halfFoVDegrees); imt.transform(dp2d, dp2d); double yMax = dp2d.getY(); return new Envelope2D(geosCRS, xMin, yMin, xMax - xMin, yMax - yMin); } GeostationarySatellite(ParameterValueGroup parameters); @Override ParameterDescriptorGroup getParameterDescriptors(); @Override ParameterValueGroup getParameterValues(); static Envelope2D circumscribeFullDisk(CoordinateReferenceSystem geosCRS); static Envelope2D inscribeFullDiskEstimate(CoordinateReferenceSystem geosCRS);  }