Class DomainDefinition
Current implementation does not yet provide ways to describe how a domain is decided.
A future version may, for example, allows to specify a maximal deformation tolerated for map projections.
In current implementation, the estimation can be customized by overriding the
estimate(MathTransform)
or intersect(Envelope)
methods.
Each DomainDefinition
instance should be used only once for an AbstractMathTransform
instance, unless that transform is a chain of concatenated transforms (this case is handled automatically
by Apache SIS). Usage example:
AbstractMathTransform transform = …;
transform.getDomain(new DomainDefinition()).ifPresent((domain) -> {
// Do something here with the transform domain.
});
MathTransforms.getDomain(MathTransform)
convenience method can be used
when the default implementation is sufficient.- Since:
- 1.3
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
estimate
(MathTransform evaluated) Estimates the domain of the given math transform and intersects it with previously computed domains.void
Sets the domain to the intersection of current domain with the specified envelope.result()
Returns the domain computed so far by this instance.Returns a string representation for debugging purposes.
-
Constructor Details
-
DomainDefinition
public DomainDefinition()Creates a new instance using default configuration.
-
-
Method Details
-
estimate
Estimates the domain of the given math transform and intersects it with previously computed domains. The result can be obtained by a call toresult()
.The default implementation invokes
AbstractMathTransform.getDomain(DomainDefinition)
if possible, or does nothing otherwise. The domain provided by the transform is given tointersect(Envelope)
. Subclasses can override for modifying this behavior.- Parameters:
evaluated
- the transform for which to estimate the domain.- Throws:
TransformException
- if the domain cannot be estimated.
-
intersect
Sets the domain to the intersection of current domain with the specified envelope. The envelope coordinates shall be in units of the inputs of the firstMathTransform
given toestimate(MathTransform)
. If that method is invoked recursively in a chain of transforms, callers are responsible for converting the envelope.- Parameters:
domain
- the domain to intersect with.
-
result
Returns the domain computed so far by this instance. The envelope is in units of the inputs of the transform given in the first call toestimate(MathTransform)
.- Returns:
- the domain of the transform being evaluated.
-
toString
Returns a string representation for debugging purposes.
-