public void computeMetricScaleExtremes(
        int UTMZone, String hemisphere, GridElement ge, double size) {
      if (UTMZone != this.zone) return;
      if (size < 1 || size > this.maxResolution) return;

      UTMExtremes levelExtremes = this.extremes[(int) Math.log10(size) - 1];

      if (ge.type.equals(GridElement.TYPE_LINE_EASTING)
          || ge.type.equals(GridElement.TYPE_LINE_EAST)
          || ge.type.equals(GridElement.TYPE_LINE_WEST)) {
        levelExtremes.minX = ge.value < levelExtremes.minX ? ge.value : levelExtremes.minX;
        levelExtremes.maxX = ge.value > levelExtremes.maxX ? ge.value : levelExtremes.maxX;
      } else if (ge.type.equals(GridElement.TYPE_LINE_NORTHING)
          || ge.type.equals(GridElement.TYPE_LINE_SOUTH)
          || ge.type.equals(GridElement.TYPE_LINE_NORTH)) {
        if (hemisphere.equals(levelExtremes.minYHemisphere))
          levelExtremes.minY = ge.value < levelExtremes.minY ? ge.value : levelExtremes.minY;
        else if (hemisphere.equals(AVKey.SOUTH)) {
          levelExtremes.minY = ge.value;
          levelExtremes.minYHemisphere = hemisphere;
        }
        if (hemisphere.equals(levelExtremes.maxYHemisphere))
          levelExtremes.maxY = ge.value > levelExtremes.maxY ? ge.value : levelExtremes.maxY;
        else if (hemisphere.equals(AVKey.NORTH)) {
          levelExtremes.maxY = ge.value;
          levelExtremes.maxYHemisphere = hemisphere;
        }
      }
    }
 public void clear() {
   int numLevels = (int) Math.log10(this.maxResolution);
   this.extremes = new UTMExtremes[numLevels];
   for (int i = 0; i < numLevels; i++) {
     this.extremes[i] = new UTMExtremes();
     this.extremes[i].clear();
   }
 }