- Companion
- object
Value members
Constructors
Creates a <code>PrecisionModel</code> that specifies an explicit precision model type. If the model type is FIXED the scale factor will default to 1.
Creates a <code>PrecisionModel</code> that specifies an explicit precision model type. If the model type is FIXED the scale factor will default to 1.
- Value Params
- modelType
the type of the precision model
Creates a <code>PrecisionModel</code> that specifies Fixed precision. Fixed-precision coordinates are represented as precise internal coordinates, which are rounded to the grid defined by the scale factor.
Creates a <code>PrecisionModel</code> that specifies Fixed precision. Fixed-precision coordinates are represented as precise internal coordinates, which are rounded to the grid defined by the scale factor.
- Value Params
- offsetX
not used.
- offsetY
not used.
- scale
amount by which to multiply a coordinate after subtracting the offset, to obtain a precise coordinate
Creates a <code>PrecisionModel</code> that specifies Fixed precision. Fixed-precision coordinates are represented as precise internal coordinates, which are rounded to the grid defined by the scale factor.
Creates a <code>PrecisionModel</code> that specifies Fixed precision. Fixed-precision coordinates are represented as precise internal coordinates, which are rounded to the grid defined by the scale factor.
- Value Params
- scale
amount by which to multiply a coordinate after subtracting the offset, to obtain a precise coordinate
Concrete methods
Compares this {link PrecisionModel} object with the specified object for order. A PrecisionModel is greater than another if it provides greater precision. The comparison is based on the value returned by the {link #getMaximumSignificantDigits} method. This comparison is not strictly accurate when comparing floating precision models to fixed models; however, it is correct when both models are either floating or fixed.
Compares this {link PrecisionModel} object with the specified object for order. A PrecisionModel is greater than another if it provides greater precision. The comparison is based on the value returned by the {link #getMaximumSignificantDigits} method. This comparison is not strictly accurate when comparing floating precision models to fixed models; however, it is correct when both models are either floating or fixed.
- Value Params
- o
the <code>PrecisionModel</code> with which this <code>PrecisionModel</code> is being compared return a negative integer, zero, or a positive integer as this <code>PrecisionModel</code> is less than, equal to, or greater than the specified <code>PrecisionModel</code>
- Definition Classes
- Comparable
Returns the maximum number of significant digits provided by this precision model. Intended for use by routines which need to print out decimal representations of precise values (such as {link WKTWriter}).
Returns the maximum number of significant digits provided by this precision model. Intended for use by routines which need to print out decimal representations of precise values (such as {link WKTWriter}).
This method would be more correctly called <tt>getMinimumDecimalPlaces</tt>, since it actually computes the number of decimal places that is required to correctly display the full precision of an ordinate value.
Since it is difficult to compute the required number of decimal places for scale factors which are not powers of 10, the algorithm uses a very rough approximation in this case. This has the side effect that for scale factors which are powers of 10 the value returned is 1 greater than the true value.
return the maximum number of decimal places provided by this precision model
Returns the x-offset used to obtain a precise coordinate.
Returns the x-offset used to obtain a precise coordinate.
return the amount by which to subtract the x-coordinate before multiplying by the scale
Returns the y-offset used to obtain a precise coordinate.
Returns the y-offset used to obtain a precise coordinate.
return the amount by which to subtract the y-coordinate before multiplying by the scale
Returns the scale factor used to specify a fixed precision model. The number of decimal places of precision is equal to the base-10 logarithm of the scale factor. Non-integral and negative scale factors are supported. Negative scale factors indicate that the places of precision is to the left of the decimal point.
Returns the scale factor used to specify a fixed precision model. The number of decimal places of precision is equal to the base-10 logarithm of the scale factor. Non-integral and negative scale factors are supported. Negative scale factors indicate that the places of precision is to the left of the decimal point.
return the scale factor for the fixed precision model
Gets the type of this precision model
Gets the type of this precision model
return the type of this precision model
- See also
Type
Tests whether the precision model supports floating point
Tests whether the precision model supports floating point
return <code>true</code> if the precision model supports floating point
Rounds a numeric value to the PrecisionModel grid. Asymmetric Arithmetic Rounding is used, to provide uniform rounding behaviour no matter where the number is on the number line.
Rounds a numeric value to the PrecisionModel grid. Asymmetric Arithmetic Rounding is used, to provide uniform rounding behaviour no matter where the number is on the number line.
This method has no effect on NaN values.
<b>Note:</b> Java's <code>Math#rint</code> uses the "Banker's Rounding" algorithm, which is not suitable for precision operations elsewhere in JTS.
Returns the external representation of <code>internal</code>.
Returns the external representation of <code>internal</code>.
- Value Params
- internal
the original coordinate return the coordinate whose values will be changed to the external representation of <code>internal</code>
Sets <code>external</code> to the external representation of <code>internal</code>.
Sets <code>external</code> to the external representation of <code>internal</code>.
- Value Params
- external
the coordinate whose values will be changed to the external representation of <code>internal</code>
- internal
the original coordinate
Sets <code>internal</code> to the precise representation of <code>external</code>.
Sets <code>internal</code> to the precise representation of <code>external</code>.
- Value Params
- external
the original coordinate
- internal
the coordinate whose values will be changed to the precise representation of <code>external</code>