/** * Constructs a scale info object with the specified numerator and denominator values. The scale should be * interpreted as the more familiar pure number scale, i.e. 1 meter on the screen divided by 1 meter on the map. * * @param numerator * typically value is 1 or > 1 for large scales * @param denominator * typically values are 100, 1000, ... or 1 for large scales */ public ScaleInfo(double numerator, double denominator) { this.numerator = numerator; this.denominator = denominator; if (denominator <= 0) { throw new IllegalArgumentException("Scale denominator must be positive"); } setNumerator(numerator); setDenominator(denominator); }
/** * Copy constructor. Creates a deep copy of the specified {@link ScaleInfo} object. * * @param other the scale info to copy * @since 1.11.0 */ public ScaleInfo(ScaleInfo other) { setDenominator(other.getDenominator()); setNumerator(other.getNumerator()); setPixelPerUnit(other.getPixelPerUnit()); // must copy all state setPixelPerUnitBased(other.isPixelPerUnitBased()); }