private static double snapScaleTo_10_2_5(double scaleRaw){
  double pow10=Math.floor(MathUtil.log10(scaleRaw) + ROUND_ERROR_REMOVAL);
  double scaleRoundedToPow10=Math.pow(10,pow10);
  double scale=scaleRoundedToPow10;
  if (3.5 * scaleRoundedToPow10 <= scaleRaw)   scale=5 * scaleRoundedToPow10;
 else   if (2 * scaleRoundedToPow10 <= scaleRaw)   scale=2 * scaleRoundedToPow10;
  return scale;
}

private static double snapScaleTo_10_2_5 ( double scaleRaw ) { double pow10 = Math . floor ( MathUtil . log10 ( scaleRaw ) + ROUND_ERROR_REMOVAL ) ; double scaleRoundedToPow10 = Math . pow ( 10 , pow10 ) ; double scale = scaleRoundedToPow10 ; if ( 3.5 * scaleRoundedToPow10 <= scaleRaw ) scale = 5 * scaleRoundedToPow10 ; else if ( 2 * scaleRoundedToPow10 <= scaleRaw ) scale = 2 * scaleRoundedToPow10 ; return scale ; }
not used - scaling to multiples of 10 , 5 , 2 is too coarse .
