Package org.apache.sis.geometry
Class WraparoundInEnvelope.Controller
java.lang.Object
org.apache.sis.geometry.WraparoundInEnvelope.Controller
- All Implemented Interfaces:
Function<WraparoundTransform,
,WraparoundTransform> UnaryOperator<WraparoundTransform>
- Enclosing class:
- WraparoundInEnvelope
static final class WraparoundInEnvelope.Controller
extends Object
implements UnaryOperator<WraparoundTransform>
Helper class for transforming an envelope with special checks for wraparounds.
This class provides a translatable WraparoundTransform.transform(double[], int, double[], int, boolean) for enabling wraparounds that could not be applied
in previous
WraparoundInEnvelope.shift(double)
executions. The translation is applied by calls to the translate()
method, which should be invoked repetitively until it returns false
.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final org.opengis.referencing.operation.MathTransform
The potentially mutable transform to use for transforming envelope corners.private WraparoundInEnvelope[]
All wraparound steps found, ornull
if none. -
Constructor Summary
ConstructorsConstructorDescriptionController
(org.opengis.referencing.operation.MathTransform transform) Creates a new instance using the given transform. -
Method Summary
Modifier and TypeMethodDescriptionapply
(WraparoundTransform transform) Callback method for replacingWraparoundTransform
instances byWraparoundInEnvelope
instances inWraparoundTransform.transform(double[], int, double[], int, boolean)
.(package private) final boolean
Modifies the WraparoundTransform.transform(double[], int, double[], int, boolean) with a translation for enabling wraparounds that could not be applied in previousWraparoundInEnvelope.shift(double)
executions.
-
Field Details
-
transform
final org.opengis.referencing.operation.MathTransform transformThe potentially mutable transform to use for transforming envelope corners. This transform is derived from the transform specified at construction time and should not live longer than the time needed for transforming an envelope. -
wraparounds
All wraparound steps found, ornull
if none.
-
-
Constructor Details
-
Controller
Controller(org.opengis.referencing.operation.MathTransform transform) Creates a new instance using the given transform. If the given transform contains wraparound steps, then the transform stored in theWraparoundTransform.transform(double[], int, double[], int, boolean)
will be a different transform chains instance.
-
-
Method Details
-
apply
Callback method for replacingWraparoundTransform
instances byWraparoundInEnvelope
instances inWraparoundTransform.transform(double[], int, double[], int, boolean)
. This method is public as an implementation side-effect and should not be invoked directly (it is invoked byWraparoundTransform.replace(MathTransform, Function)
).- Specified by:
apply
in interfaceFunction<WraparoundTransform,
WraparoundTransform> - Parameters:
transform
- theWraparoundTransform
instance to replace by a translatable instance.- Returns:
- same wraparound operation but with a control on translations applied on corner coordinates.
-
translate
final boolean translate()Modifies the WraparoundTransform.transform(double[], int, double[], int, boolean) with a translation for enabling wraparounds that could not be applied in previousWraparoundInEnvelope.shift(double)
executions. If this method returnstrue
, then the transform will compute different output coordinates for the same input coordinates.Usage
This method can be invoked after transforming an envelope. If this method returnstrue
, then the same envelope should be transformed again and the new result added to the previous result (union).- Returns:
true
if the WraparoundTransform.transform(double[], int, double[], int, boolean) has been modified.
-