Package org.apache.sis.geometry
Class EnvelopeReducer
java.lang.Object
org.apache.sis.geometry.EnvelopeReducer
Applies union or intersection operations on a sequence of envelopes.
This utility class infers the a common coordinate reference system
for performing the reduce operation.
- Since:
- 1.0
- Version:
- 1.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
The public method fromEnvelopes
which is using this envelope reducer.(package private) static final EnvelopeReducer
A reducer performing the intersection operation.(package private) static final EnvelopeReducer
A reducer performing the union operation. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
reduce
(GeneralEnvelope result, org.opengis.geometry.Envelope other) Applies the reduce operation on the givenresult
envelope.(package private) void
reduce
(DefaultGeographicBoundingBox result, org.opengis.metadata.extent.GeographicBoundingBox other) Applies the reduce operation on the givenresult
bounding box.(package private) final GeneralEnvelope
reduce
(org.opengis.geometry.Envelope[] envelopes) Reduces all given envelopes, transforming them to a common CRS if necessary.
-
Field Details
-
UNION
A reducer performing the union operation.- See Also:
-
INTERSECT
A reducer performing the intersection operation.- See Also:
-
caller
The public method fromEnvelopes
which is using this envelope reducer.
-
-
Constructor Details
-
EnvelopeReducer
EnvelopeReducer(String caller) Creates a new reducer. We should have a singleton instance for each type of reduce operation.
-
-
Method Details
-
reduce
Applies the reduce operation on the givenresult
envelope. The result is modified in-place. -
reduce
void reduce(DefaultGeographicBoundingBox result, org.opengis.metadata.extent.GeographicBoundingBox other) Applies the reduce operation on the givenresult
bounding box. The result is modified in-place. -
reduce
final GeneralEnvelope reduce(org.opengis.geometry.Envelope[] envelopes) throws org.opengis.referencing.operation.TransformException Reduces all given envelopes, transforming them to a common CRS if necessary. If all envelopes use the same CRS (ignoring metadata) or if the CRS of all envelopes isnull
, then the reduce operation is performed without transforming any envelope. Otherwise all envelopes are transformed to a common CRS before reduction. The CRS of the returned envelope may different than the CRS of all given envelopes.- Parameters:
envelopes
- the envelopes for which to perform the reduce operation. Null elements are ignored.- Returns:
- result of reduce operation, or
null
if the given array does not contain non-null elements. - Throws:
org.opengis.referencing.operation.TransformException
- if this method cannot determine a common CRS, or if a transformation failed.
-