/** * Calculates the resolution (world units / pixel) for the given scale denominator (1 / map scale) and unit system. * * @param scaleDenominator * scale denominator (1 / map scale) * @param units * units, must not be <code>null</code> * @return resolution in world units per pixel */ public static double calcResolution( double scaleDenominator, IUnit units ) { if ( units.equals( METRE ) ) { return calcMetricResFromScale( scaleDenominator ); } else if ( units.equals( DEGREE ) ) { return calcDegreeResFromScale( scaleDenominator ); } String msg = "Unhandled unit type: " + units + ". Conversion from scale denominator to resolution not implemented"; throw new IllegalArgumentException( msg ); }