int gridLineInterval) {
OMGraphicList list = new OMGraphicList();
// Used to calculate the endpoints of the horizontal lines.
UTMPoint utm1 = new UTMPoint(utm);
UTMPoint utm2 = new UTMPoint(utm);
LatLonPoint point1 = new LatLonPoint();
LatLonPoint point2 = new LatLonPoint();
// Used to calculate the pieces of the vertical lines.
UTMPoint utmp = new UTMPoint(utm);
LatLonPoint llp = new LatLonPoint();
int i;
OMLine line;
BasicGeometry poly;
float lat2;
int endNorthing = (int) Math.floor(utm.northing / INTERVAL_100K) + 10;
int startNorthing = (int) Math.floor(utm.northing / INTERVAL_100K) - 10;
int numVertLines = 9;
int numHorLines = endNorthing - startNorthing;
float[][] vertPoints = new float[numVertLines][numHorLines * 2];
if (UTM_DEBUG_VERBOSE) {
Debug.output("Array is [" + vertPoints.length + "]["
+ vertPoints[0].length + "]");
}
int coordCount = 0;
boolean doPolys = true;
utm1.easting = INTERVAL_100K;
utm2.easting = 9 * INTERVAL_100K;
// Horizontal lines
for (i = startNorthing; i < endNorthing; i++) {
utm1.northing = (float) i * gridLineInterval;
utm2.northing = utm1.northing;
utmp.northing = utm1.northing;
if (doPolys) {
for (int j = 0; j < numVertLines; j++) {
utmp.easting = (float) (j + 1) * gridLineInterval;
llp = utmp.toLatLonPoint(Ellipsoid.WGS_84, llp);
vertPoints[j][coordCount] = llp.getLatitude();
vertPoints[j][coordCount + 1] = llp.getLongitude();
if (UTM_DEBUG_VERBOSE) {