* its variants raise an exception for "Outer Space" values.
*/
protected OMRaster buildRaster() {
// initialize the return
OMRaster ret = null;
Projection projection = getProjection();
// work with the slopeMap
if (slopeMap != null) {
// compute our deltas
int width = projection.getWidth();
int height = projection.getHeight();
// create int array to hold colors
int[] colors = new int[width * height];
// compute scalers for lat/lon indicies
float scy = (float) bufferHeight / 180F;
float scx = (float) bufferWidth / 360F;
// starting and ending indices
int sx = 0, sy = 0, ex = width, ey = height;
// handle CADRG
if (projection instanceof CADRG) {
// get corners
LatLonPoint ul = projection.getUpperLeft();
LatLonPoint lr = projection.getLowerRight();
// set start/end indicies
Point ulp = projection.forward(ul);
Point lrp = projection.forward(lr);
sx = (int) ulp.getX();
ex = (int) lrp.getX();
sy = (int) ulp.getY();
ey = (int) lrp.getY();
}
// get the center lat/lon (used by the HACK, see above in
// method description)
LatLonPoint center = projection.getCenter();
LatLonPoint llp = new LatLonPoint();
// build array
for (int y = sy; y < ey; y++) {
// process each column
for (int x = sx; x < ex; x++) {
// inverse project x,y to lon,lat
projection.inverse(x, y, llp);
// get point values
float lat = llp.getLatitude();
float lon = llp.getLongitude();