protected int evaluateSpacing(float up,float down,float left,float right){
  int ret=SHOW_TENS;
  if (!showOneAndFiveLines && !showBelowOneLines) {
    return ret;
  }
  float nsdiff=up - down;
  float ewdiff;
  if ((left > 0 && right < 0) || (left > right) || (Math.abs(left - right) < 1)) {
    ewdiff=(180.0f - left) + (right + 180.0f);
  }
 else {
    ewdiff=right - left;
  }
  float diff=(nsdiff < ewdiff) ? nsdiff : ewdiff;
  if ((diff / 10) <= (float)threshold)   ret=SHOW_FIVES;
  if ((diff / 5) <= (float)threshold)   ret=SHOW_ONES;
  return ret;
}

protected int evaluateSpacing ( float up , float down , float left , float right ) { int ret = SHOW_TENS ; if ( ! showOneAndFiveLines && ! showBelowOneLines ) { return ret ; } float nsdiff = up - down ; float ewdiff ; if ( ( left > 0 && right < 0 ) || ( left > right ) || ( Math . abs ( left - right ) < 1 ) ) { ewdiff = ( 180.0f - left ) + ( right + 180.0f ) ; } else { ewdiff = right - left ; } float diff = ( nsdiff < ewdiff ) ? nsdiff : ewdiff ; if ( ( diff / 10 ) <= ( float ) threshold ) ret = SHOW_FIVES ; if ( ( diff / 5 ) <= ( float ) threshold ) ret = SHOW_ONES ; return ret ; }
figure out which graticule lines should be drawn based on the treshold set in the layer , and the coordinates of the screen . method checks for crossing of the dateline , but still assumes that the up and down latitude coordinates are less than abs ( + / - 80 ) . this is because the projection shouldn ' t give anything above 90 degrees , and we limit the lines to less than 80 . .
