class GridUtility {

    @Deprecated
    public static Range[] getXYRangesFromLatLonRect(LatLonRect llr, GridCoordSystem gcs)
            throws InvalidRangeException
    {

		double[][] coords = {
			{ llr.getLatMin(), llr.getLonMin() },
			{ llr.getLatMin(), llr.getLonMax() },
			{ llr.getLatMax(), llr.getLonMax() },
			{ llr.getLatMax(), llr.getLonMin() },
		};
		int[] currentIndices = new int[2];
		int lowerX = Integer.MAX_VALUE;
		int upperX = Integer.MIN_VALUE;
		int lowerY = Integer.MAX_VALUE;
		int upperY = Integer.MIN_VALUE;
		for (int i = 0; i < coords.length; ++i) {
			// seem to need this for CoordinateAxis2D instances
			gcs.findXYindexFromLatLon(coords[i][0], coords[i][1], currentIndices);
			if (currentIndices[0] < lowerX) { lowerX = currentIndices[0] ; }
			if (currentIndices[0] > upperX) { upperX = currentIndices[0] ; }
			if (currentIndices[1] < lowerY) { lowerY = currentIndices[1] ; }
			if (currentIndices[1] > upperY) { upperY = currentIndices[1] ; }
		}

		return bufferXYRanges(gcs, new Range[] {
            new Range(lowerX, upperX),
            new Range(lowerY, upperY),
        } );
    }

    private  GridUtility();

}