Class DefaultPassThroughOperation
java.lang.Object
org.apache.sis.io.wkt.FormattableObject
org.apache.sis.referencing.AbstractIdentifiedObject
org.apache.sis.referencing.operation.AbstractCoordinateOperation
org.apache.sis.referencing.operation.DefaultPassThroughOperation
- All Implemented Interfaces:
Serializable
,Formattable
,Deprecable
,LenientComparable
,org.opengis.referencing.IdentifiedObject
,org.opengis.referencing.operation.CoordinateOperation
,org.opengis.referencing.operation.PassThroughOperation
,org.opengis.referencing.operation.SingleOperation
public class DefaultPassThroughOperation
extends AbstractCoordinateOperation
implements org.opengis.referencing.operation.PassThroughOperation
Specifies that a subset of a coordinate tuple is subject to a specific coordinate operation.
- Since:
- 0.6
- Version:
- 1.3
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.opengis.referencing.operation.SingleOperation
The operation to apply on the subset of a coordinate tuple.private static final long
Serial number for inter-operability with different versions.Fields inherited from class org.apache.sis.referencing.operation.AbstractCoordinateOperation
coordinateOperationAccuracy, domainOfValidity, sourceCRS, targetCRS, transform
Fields inherited from class org.apache.sis.referencing.AbstractIdentifiedObject
DEPRECATED_KEY, LOCALE_KEY
Fields inherited from interface org.opengis.referencing.operation.CoordinateOperation
COORDINATE_OPERATION_ACCURACY_KEY, DOMAIN_OF_VALIDITY_KEY, OPERATION_VERSION_KEY, SCOPE_KEY
Fields inherited from interface org.opengis.referencing.IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Constructs a new object in which every attributes are set to a null value.DefaultPassThroughOperation
(Map<String, ?> properties, org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS, org.opengis.referencing.operation.SingleOperation operation, int firstAffectedCoordinate, int numTrailingCoordinates) Constructs a pass-through operation from a set of properties.protected
DefaultPassThroughOperation
(org.opengis.referencing.operation.PassThroughOperation operation) Creates a new coordinate operation with the same values than the specified one. -
Method Summary
Modifier and TypeMethodDescription(package private) void
afterUnmarshal
(Unmarshaller unmarshaller, Object parent) Invoked by JAXB after unmarshalling.static DefaultPassThroughOperation
castOrCopy
(org.opengis.referencing.operation.PassThroughOperation object) Returns a SIS coordinate operation implementation with the values of the given arbitrary implementation.protected long
Invoked byhashCode()
for computing the hash code when first needed.boolean
equals
(Object object, ComparisonMode mode) Compares this concatenated operation with the specified object for equality.protected String
Formats this coordinate operation in a pseudo-Well Known Text (WKT) format.private int[]
Invoked by JAXB at marshalling time for getting the modified coordinates.Class<? extends org.opengis.referencing.operation.PassThroughOperation>
Returns the GeoAPI interface implemented by this class.org.opengis.referencing.operation.OperationMethod
Deprecated.May be removed in GeoAPI 4.0 since it does not apply to pass-through operations.int[]
Returns the ordered sequence of indices in a source coordinate tuple of the coordinates affected by this pass-through operation.org.opengis.referencing.operation.SingleOperation
Returns the operation to apply on the subset of a coordinate tuple.org.opengis.parameter.ParameterValueGroup
Deprecated.May be removed in GeoAPI 4.0 since it does not apply to pass-through operations.private void
setIndices
(int[] dimensions) Invoked by JAXB at unmarshalling time for setting the modified coordinates.private void
setOperation
(org.opengis.referencing.operation.SingleOperation op) Invoked by JAXB at unmarshalling time for setting the coordinate operation applied on the subset of a coordinate tuple.Methods inherited from class org.apache.sis.referencing.operation.AbstractCoordinateOperation
castOrCopy, checkDimensions, computeTransientFields, getCoordinateOperationAccuracy, getDomainOfValidity, getInterpolationCRS, getInterpolationCRS, getLinearAccuracy, getMathTransform, getOperationVersion, getParameterDescriptors, getParameterDescriptors, getScope, getSourceCRS, getTargetCRS, getWrapAroundChanges, isDefiningConversion
Methods inherited from class org.apache.sis.referencing.AbstractIdentifiedObject
castOrCopy, equals, formatTo, getAlias, getDescription, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForName
Methods inherited from class org.apache.sis.io.wkt.FormattableObject
print, toString, toString, toWKT
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opengis.referencing.operation.CoordinateOperation
getCoordinateOperationAccuracy, getDomainOfValidity, getMathTransform, getOperationVersion, getScope, getSourceCRS, getTargetCRS
Methods inherited from interface org.opengis.referencing.IdentifiedObject
getAlias, getIdentifiers, getName, getRemarks, toWKT
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial number for inter-operability with different versions.- See Also:
-
operation
private org.opengis.referencing.operation.SingleOperation operationThe operation to apply on the subset of a coordinate tuple.Consider this field as final! This field is modified only at unmarshalling time by
setOperation(CoordinateOperation)
- See Also:
-
-
Constructor Details
-
DefaultPassThroughOperation
public DefaultPassThroughOperation(Map<String, ?> properties, org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS, org.opengis.referencing.operation.SingleOperation operation, int firstAffectedCoordinate, int numTrailingCoordinates) Constructs a pass-through operation from a set of properties. The properties given in argument follow the same rules than for the super-class constructor. The following table is a reminder of main (not all) properties:Recognized properties (non exhaustive list) Property name Value type Returned by "name" Identifier
orString
AbstractIdentifiedObject.getName()
"identifiers" Identifier
(optionally as array)AbstractIdentifiedObject.getIdentifiers()
- Parameters:
properties
- the properties to be given to the identified object.sourceCRS
- the source CRS.targetCRS
- the target CRS.operation
- the operation to apply on the subset of a coordinate tuple.firstAffectedCoordinate
- index of the first affected coordinate.numTrailingCoordinates
- number of trailing coordinates to pass through.
-
DefaultPassThroughOperation
protected DefaultPassThroughOperation(org.opengis.referencing.operation.PassThroughOperation operation) Creates a new coordinate operation with the same values than the specified one. This copy constructor provides a way to convert an arbitrary implementation into a SIS one or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API.This constructor performs a shallow copy, i.e. the properties are not cloned.
- Parameters:
operation
- the coordinate operation to copy.- See Also:
-
DefaultPassThroughOperation
private DefaultPassThroughOperation()Constructs a new object in which every attributes are set to a null value. This is not a valid object. This constructor is strictly reserved to JAXB, which will assign values to the fields using reflection.
-
-
Method Details
-
castOrCopy
public static DefaultPassThroughOperation castOrCopy(org.opengis.referencing.operation.PassThroughOperation object) Returns a SIS coordinate operation implementation with the values of the given arbitrary implementation. If the given object is already an instance ofDefaultPassThroughOperation
, then it is returned unchanged. Otherwise a newDefaultPassThroughOperation
instance is created using the copy constructor and returned. Note that this is a shallow copy operation, because the other properties contained in the given object are not recursively copied.- Parameters:
object
- the object to get as a SIS implementation, ornull
if none.- Returns:
- a SIS implementation containing the values of the given object (may be the
given object itself), or
null
if the argument was null.
-
getInterface
Returns the GeoAPI interface implemented by this class. The SIS implementation returnsPassThroughOperation.class
.Note for implementers: Subclasses usually do not need to override this method since GeoAPI does not definePassThroughOperation
sub-interface. Overriding possibility is left mostly for implementers who wish to extend GeoAPI with their own set of interfaces.- Overrides:
getInterface
in classAbstractCoordinateOperation
- Returns:
PassThroughOperation.class
or a user-defined sub-interface.
-
getMethod
Deprecated.May be removed in GeoAPI 4.0 since it does not apply to pass-through operations.Description copied from class:AbstractCoordinateOperation
Returns the operation method. This apply only toAbstractSingleOperation
subclasses, which will make this method public.- Specified by:
getMethod
in interfaceorg.opengis.referencing.operation.SingleOperation
- Overrides:
getMethod
in classAbstractCoordinateOperation
- Returns:
null
.
-
getParameterValues
Deprecated.May be removed in GeoAPI 4.0 since it does not apply to pass-through operations.Description copied from class:AbstractCoordinateOperation
Returns the parameter values. The default implementation infers the parameter values from the AbstractCoordinateOperation.transform, if possible.- Specified by:
getParameterValues
in interfaceorg.opengis.referencing.operation.SingleOperation
- Overrides:
getParameterValues
in classAbstractCoordinateOperation
- Returns:
null
.
-
getOperation
public org.opengis.referencing.operation.SingleOperation getOperation()Returns the operation to apply on the subset of a coordinate tuple.Upcoming API change
This method is conformant to ISO 19111:2003. But the ISO 19111:2007 revision changed the type fromSingleOperation
toCoordinateOperation
. This change may be applied in GeoAPI 4.0. This is necessary for supporting usage ofPassThroughOperation
withConcatenatedOperation
.- Specified by:
getOperation
in interfaceorg.opengis.referencing.operation.PassThroughOperation
- Returns:
- the operation to apply on the subset of a coordinate tuple.
- See Also:
-
getModifiedCoordinates
public int[] getModifiedCoordinates()Returns the ordered sequence of indices in a source coordinate tuple of the coordinates affected by this pass-through operation.- Specified by:
getModifiedCoordinates
in interfaceorg.opengis.referencing.operation.PassThroughOperation
- Returns:
- zero-based indices of the modified source coordinates.
- See Also:
-
equals
Compares this concatenated operation with the specified object for equality. If themode
argument isComparisonMode.STRICT
orBY_CONTRACT
, then all available properties are compared including the domain of validity and the scope.- Specified by:
equals
in interfaceLenientComparable
- Overrides:
equals
in classAbstractCoordinateOperation
- Parameters:
object
- the object to compare tothis
.mode
-STRICT
for performing a strict comparison, orIGNORE_METADATA
for ignoring properties that do not make a difference in the numerical results of coordinate operations.- Returns:
true
if both objects are equal for the given comparison mode.- See Also:
-
computeHashCode
protected long computeHashCode()Invoked byhashCode()
for computing the hash code when first needed. SeeAbstractIdentifiedObject.computeHashCode()
for more information.- Overrides:
computeHashCode
in classAbstractCoordinateOperation
- Returns:
- the hash code value. This value may change in any future Apache SIS version.
-
formatTo
Formats this coordinate operation in a pseudo-Well Known Text (WKT) format. Current format is specific to Apache SIS and may change in any future version if a standard format for pass through operations is defined.- Overrides:
formatTo
in classAbstractCoordinateOperation
- Parameters:
formatter
- the formatter to use.- Returns:
- currently
"PassThroughOperation"
(may change in any future version). - Since:
- 0.7
- See Also:
-
setOperation
private void setOperation(org.opengis.referencing.operation.SingleOperation op) Invoked by JAXB at unmarshalling time for setting the coordinate operation applied on the subset of a coordinate tuple.- See Also:
-
getIndices
private int[] getIndices()Invoked by JAXB at marshalling time for getting the modified coordinates. This method converts the zero-based indices to 1-based indices.- See Also:
-
setIndices
private void setIndices(int[] dimensions) Invoked by JAXB at unmarshalling time for setting the modified coordinates. This method needs to be invoked last, even if the<gml:modifiedCoordinate>
elements are not last in the GML document. It is the case when using JAXB because multiple occurrences of<gml:modifiedCoordinate>
are aggregated in an array. -
afterUnmarshal
Invoked by JAXB after unmarshalling. If needed, this method tries to infer source/target CRS of the nested operation from the source/target CRS if the enclosing pass-through operation.- Overrides:
afterUnmarshal
in classAbstractCoordinateOperation
-