// double YOrigin = spatialReference.getYOrigin();
// XYScale = 40075017 / 360 = ~111319, where 40075017 is the circumference of the earth
// at the ecuator and 360 the map units at the ecuator
// final double xyScale = spatialReference.getXYScale();
final TileOrigin tileOrigin = tileCacheInfo.getTileOrigin();// top left coordinate
double xmin = tileOrigin.getX();
double ymax = tileOrigin.getY();
double ymin = layerBounds.getMinY();
double xmax = layerBounds.getMaxX();
// make it so the gridset height matches an integer number of tiles in order for
// clients (OpenLayers) assuming the tile origin is the lower left corner instead of