class PrecisionModel extends Serializable with Comparable[PrecisionModel]
- Annotations
- @SerialVersionUID()
- Alphabetic
- By Inheritance
- PrecisionModel
- Comparable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new PrecisionModel(pm: PrecisionModel)
Copy constructor to create a new
PrecisionModelfrom an existing one. - new PrecisionModel(scale: Double)
Creates a
PrecisionModelthat specifies Fixed precision.Creates a
PrecisionModelthat specifies Fixed precision. Fixed-precision coordinates are represented as precise internal coordinates, which are rounded to the grid defined by the scale factor.- scale
amount by which to multiply a coordinate after subtracting the offset, to obtain a precise coordinate
- new PrecisionModel(modelType: Type)
Creates a
PrecisionModelthat specifies an explicit precision model type.Creates a
PrecisionModelthat specifies an explicit precision model type. If the model type is FIXED the scale factor will default to 1.- modelType
the type of the precision model
- new PrecisionModel()
- new PrecisionModel(scale: Double, offsetX: Double, offsetY: Double)
Creates a
PrecisionModelthat specifies Fixed precision.Creates a
PrecisionModelthat specifies Fixed precision. Fixed-precision coordinates are represented as precise internal coordinates, which are rounded to the grid defined by the scale factor.- scale
amount by which to multiply a coordinate after subtracting the offset, to obtain a precise coordinate
- offsetX
not used.
- offsetY
not used.
- Deprecated
offsets are no longer supported, since internal representation is rounded floating point
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def compareTo(o: PrecisionModel): Int
Compares this {link PrecisionModel} object with the specified object for order.
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.
- o
the
PrecisionModelwith which thisPrecisionModelis being compared return a negative integer, zero, or a positive integer as thisPrecisionModelis less than, equal to, or greater than the specifiedPrecisionModel
- Definition Classes
- PrecisionModel → Comparable
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(other: Any): Boolean
- Definition Classes
- PrecisionModel → AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getMaximumSignificantDigits: Int
Returns the maximum number of significant digits provided by this precision model.
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 getMinimumDecimalPlaces, 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
- def getScale: Double
Returns the scale factor used to specify a fixed precision model.
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
- def getType: Type
Gets the type of this precision model
Gets the type of this precision model
return the type of this precision model
- See also
Type
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def isFloating: Boolean
Tests whether the precision model supports floating point
Tests whether the precision model supports floating point
return
trueif the precision model supports floating point - final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def makePrecise(coord: Coordinate): Unit
Rounds a Coordinate to the PrecisionModel grid.
- def makePrecise(val: Double): Double
Rounds a numeric value to the PrecisionModel grid.
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.
Note: Java's
Math#rintuses the "Banker's Rounding" algorithm, which is not suitable for precision operations elsewhere in JTS. - final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- PrecisionModel → AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Deprecated Value Members
- def getOffsetX: Int
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
- Deprecated
Offsets are no longer used
- def getOffsetY: Int
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
- Deprecated
Offsets are no longer used
- def toExternal(internal: Coordinate, external: Coordinate): Unit
Sets
externalto the external representation ofinternal.Sets
externalto the external representation ofinternal.- internal
the original coordinate
- external
the coordinate whose values will be changed to the external representation of
internal
- Deprecated
no longer needed, since internal representation is same as external representation
- def toExternal(internal: Coordinate): Coordinate
Returns the external representation of
internal.Returns the external representation of
internal.- internal
the original coordinate return the coordinate whose values will be changed to the external representation of
internal
- Deprecated
no longer needed, since internal representation is same as external representation
- def toInternal(external: Coordinate): Coordinate
Returns the precise representation of
external.Returns the precise representation of
external.- external
the original coordinate return the coordinate whose values will be changed to the precise representation of
external
- Deprecated
use makePrecise instead
- def toInternal(external: Coordinate, internal: Coordinate): Unit
Sets
internalto the precise representation ofexternal.Sets
internalto the precise representation ofexternal.- external
the original coordinate
- internal
the coordinate whose values will be changed to the precise representation of
external
- Deprecated
use makePrecise instead