class GeographicBoundingBox implements BoundingBox<GeographicPosition>, Comparable<GeographicBoundingBox>, Serializable {

    public String toGridString(int gridSize)
    {
        double level = -Math.log(getWidth() / gridSize) / Math.log(2.);
        double lonD = getLowerLeft().getLatLonAlt().getLonD() + 180;
        double latD = getLowerLeft().getLatLonAlt().getLatD() + 90;
        StringBuilder sbx = new StringBuilder();
        StringBuilder sby = new StringBuilder();
        for (int i = 0; i <= level; ++i)
        {
            double div = gridSize * Math.pow(2., -i);
            int x = (int)(lonD / div);
            int y = (int)(latD / div);
            sbx.append(x);
            sby.append(y);
            if (i == 0)
            {
                sbx.append('.');
                sby.append('.');
            }
            lonD -= x * div;
            latD -= y * div;
        }

        return sbx.append('/').append(sby).toString();
    }

    public  GeographicBoundingBox(GeographicPosition lowerLeftCorner, GeographicPosition upperRightCorner);
    public  GeographicBoundingBox(LatLonAlt lowerLeftCorner, LatLonAlt upperRightCorner);

}