class AbstractGeographicProjection extends AbstractProjection {

    @Override
    public Sphere getBoundingSphere(BoundingBox<GeographicPosition> bbox, Vector3d modelCenter, boolean forceGenerate)
    {
        GeographicBoundingBox geoBox = (GeographicBoundingBox)bbox;
        Vector3d[] modelCorners = new Vector3d[4];
        modelCorners[0] = convertToModel(geoBox.getLowerLeft(), modelCenter);
        modelCorners[1] = convertToModel(geoBox.getUpperRight(), modelCenter);
        modelCorners[2] = convertToModel(geoBox.getLowerRight(), modelCenter);
        modelCorners[3] = convertToModel(geoBox.getUpperLeft(), modelCenter);

        double x0 = Double.MAX_VALUE;
        double x1 = -Double.MAX_VALUE;
        double y0 = Double.MAX_VALUE;
        double y1 = -Double.MAX_VALUE;
        double z0 = Double.MAX_VALUE;
        double z1 = -Double.MAX_VALUE;

        for (Vector3d corner : modelCorners)
        {
            x0 = Math.min(x0, corner.getX());
            x1 = Math.max(x1, corner.getX());
            y0 = Math.min(y0, corner.getY());
            y1 = Math.max(y1, corner.getY());
            z0 = Math.min(z0, corner.getZ());
            z1 = Math.max(z1, corner.getZ());
        }

        double x = (x0 + x1) * .5f;
        double y = (y0 + y1) * .5f;
        double z = (z0 + z1) * .5f;
        Vector3d center = new Vector3d(x, y, z);
        double radius = 0;
        for (Vector3d corner : modelCorners)
        {
            radius = Math.max(radius, center.distance(corner));
        }
        return new DefaultSphere(center, radius);
    }

}