assertEquals(transformed.getMaximum(0), 1.236739621845986E7, 1d);
}
public void testTransformPolarStereographicWgs84() throws Exception {
CoordinateReferenceSystem crs = CRS.decode("EPSG:3031", true);
Envelope2D envelope = new Envelope2D(crs);
// random bbox that does include the pole
envelope.add(-4223632.8125, -559082.03125);
envelope.add(5053710.9375, 3347167.96875);
Envelope transformed = CRS.transform(envelope, DefaultGeographicCRS.WGS84);
// check we got the whole range of longitudes, since the original bbox contains the pole
assertEquals(-180d, transformed.getMinimum(0), 0d);
assertEquals(180d, transformed.getMaximum(0), 0d);
// another bbox
envelope = new Envelope2D(crs);
// random bbox that does not include the pole, but it's really just slightly off it
envelope.add(-10718812.640513, -10006238.053703);
envelope.add(12228504.561708, -344209.75803081);
transformed = CRS.transform(envelope, DefaultGeographicCRS.WGS84);
assertEquals(-90, transformed.getMinimum(1), 0.1d);
}