Class AbstractSingleOperation
- All Implemented Interfaces:
Serializable,Formattable,Parameterized,Deprecable,LenientComparable,org.opengis.referencing.IdentifiedObject,org.opengis.referencing.operation.CoordinateOperation,org.opengis.referencing.operation.SingleOperation
- Direct Known Subclasses:
DefaultConversion,DefaultTransformation
DefaultConversion and DefaultTransformation.
Does not need to be public, as users should handle only conversions or transformations.
Note: this class is not strictly equivalent to <gml:AbstractSingleOperationType>
because the GML schema does not define the method and parameters in this base class. Instead, they
repeat those two elements in the <gml:Conversion> and <gml:Transformation> subtypes.
Another difference is that SIS does not use AbstractSingleOperation as the base class of
DefaultPassThroughOperation.
- Since:
- 0.6
- Version:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.opengis.referencing.operation.OperationMethodThe operation method.(package private) org.opengis.parameter.ParameterValueGroupThe parameter values, ornullfor inferring it from the math transform.private static final longSerial number for inter-operability with different versions.Fields inherited from class org.apache.sis.referencing.operation.AbstractCoordinateOperation
coordinateOperationAccuracy, domainOfValidity, sourceCRS, targetCRS, transformFields inherited from class org.apache.sis.referencing.AbstractIdentifiedObject
DEPRECATED_KEY, LOCALE_KEYFields inherited from interface org.opengis.referencing.operation.CoordinateOperation
COORDINATE_OPERATION_ACCURACY_KEY, DOMAIN_OF_VALIDITY_KEY, OPERATION_VERSION_KEY, SCOPE_KEYFields inherited from interface org.opengis.referencing.IdentifiedObject
ALIAS_KEY, IDENTIFIERS_KEY, NAME_KEY, REMARKS_KEY -
Constructor Summary
ConstructorsModifierConstructorDescription(package private)Constructs a new object in which every attributes are set to a null value.AbstractSingleOperation(Map<String, ?> properties, org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS, org.opengis.referencing.crs.CoordinateReferenceSystem interpolationCRS, org.opengis.referencing.operation.OperationMethod method, org.opengis.referencing.operation.MathTransform transform) Creates a coordinate operation from the given properties.(package private)AbstractSingleOperation(Map<String, ?> properties, org.opengis.referencing.operation.OperationMethod method) Creates a new coordinate operation initialized from the given properties.protectedAbstractSingleOperation(org.opengis.referencing.operation.SingleOperation operation) Creates a new coordinate operation with the same values than the specified one. -
Method Summary
Modifier and TypeMethodDescription(package private) final voidafterUnmarshal(Unmarshaller unmarshaller, Object parent) Invoked by JAXB after unmarshalling.booleanequals(Object object, ComparisonMode mode) Compares this coordinate operation with the specified object for equality.org.opengis.referencing.operation.OperationMethodReturns a description of the operation method, including a list of expected parameter names.org.opengis.parameter.ParameterDescriptorGroupReturns a description of the parameters.private org.opengis.parameter.GeneralParameterValue[]Invoked by JAXB for getting the parameters to marshal.org.opengis.parameter.ParameterValueGroupReturns the parameter values.private voidsetMethod(org.opengis.referencing.operation.OperationMethod value) Invoked by JAXB at unmarshalling time.private voidsetParameters(org.opengis.parameter.GeneralParameterValue[] values) Invoked by JAXB for setting the unmarshalled parameters.(package private) final voidsetParameterValues(org.opengis.parameter.ParameterValueGroup definition, Map<String, Boolean> ignore) Sets the parameter values to a copy of given parameters, making sure that the parameters are compatible with the ones expected by the operation method.Methods inherited from class org.apache.sis.referencing.operation.AbstractCoordinateOperation
castOrCopy, checkDimensions, computeHashCode, computeTransientFields, formatTo, getCoordinateOperationAccuracy, getDomainOfValidity, getInterface, getInterpolationCRS, getInterpolationCRS, getLinearAccuracy, getMathTransform, getOperationVersion, getParameterDescriptors, getScope, getSourceCRS, getTargetCRS, getWrapAroundChanges, isDefiningConversionMethods inherited from class org.apache.sis.referencing.AbstractIdentifiedObject
castOrCopy, equals, formatTo, getAlias, getDescription, getIdentifiers, getName, getRemarks, hashCode, isDeprecated, isHeuristicMatchForNameMethods inherited from class org.apache.sis.io.wkt.FormattableObject
print, toString, toString, toWKTMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.opengis.referencing.operation.CoordinateOperation
getCoordinateOperationAccuracy, getDomainOfValidity, getMathTransform, getOperationVersion, getScope, getSourceCRS, getTargetCRSMethods 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:
-
method
private org.opengis.referencing.operation.OperationMethod methodThe operation method.Consider this field as final! This field is modified only at unmarshalling time by
setMethod(OperationMethod).- See Also:
-
parameters
org.opengis.parameter.ParameterValueGroup parametersThe parameter values, ornullfor inferring it from the math transform.Consider this field as final! This field is non-final only for the convenience of constructors and for initialization at XML unmarshalling time by
setParameters(GeneralParameterValue[]).
-
-
Constructor Details
-
AbstractSingleOperation
public AbstractSingleOperation(Map<String, ?> properties, org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS, org.opengis.referencing.crs.CoordinateReferenceSystem interpolationCRS, org.opengis.referencing.operation.OperationMethod method, org.opengis.referencing.operation.MathTransform transform) Creates a coordinate operation from the given properties. This constructor would be public ifAbstractSingleOperationwas public. -
AbstractSingleOperation
AbstractSingleOperation(Map<String, ?> properties, org.opengis.referencing.operation.OperationMethod method) Creates a new coordinate operation initialized from the given properties. It is caller's responsibility to set the following fields: -
AbstractSingleOperation
protected AbstractSingleOperation(org.opengis.referencing.operation.SingleOperation 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.
-
AbstractSingleOperation
AbstractSingleOperation()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
-
getMethod
public org.opengis.referencing.operation.OperationMethod getMethod()Returns a description of the operation method, including a list of expected parameter names. The returned object does not contains any parameter value.- Specified by:
getMethodin interfaceorg.opengis.referencing.operation.SingleOperation- Overrides:
getMethodin classAbstractCoordinateOperation- Returns:
- a description of the operation method.
-
getParameterDescriptors
public org.opengis.parameter.ParameterDescriptorGroup getParameterDescriptors()Returns a description of the parameters. The default implementation performs the following choice:- If parameter values were specified explicitly at construction time, then the descriptor of those parameters is returned.
- Otherwise if this method can infer the parameter descriptor from the math transform, then that descriptor is returned.
- Otherwise fallback on the method parameters.
Note: the two parameter descriptions (from theMathTransformor from theOperationMethod) should be very similar. If they differ, it should be only in minor details like remarks, default values or units of measurement.- Specified by:
getParameterDescriptorsin interfaceParameterized- Overrides:
getParameterDescriptorsin classAbstractCoordinateOperation- Returns:
- a description of the parameters.
- See Also:
-
getParameterValues
public org.opengis.parameter.ParameterValueGroup getParameterValues()Returns the parameter values. The default implementation performs the following choice:- If parameter values were specified explicitly at construction time, then they are returned as an unmodifiable parameter group.
- Otherwise if this method can infer the parameter values from the math transform, then those parameters are returned.
- Otherwise throw
UnsupportedImplementationException.
- Specified by:
getParameterValuesin interfaceParameterized- Specified by:
getParameterValuesin interfaceorg.opengis.referencing.operation.SingleOperation- Overrides:
getParameterValuesin classAbstractCoordinateOperation- Returns:
- the parameter values.
- Throws:
UnsupportedOperationException- if the parameter values cannot be determined for the current math transform implementation.- See Also:
-
setParameterValues
final void setParameterValues(org.opengis.parameter.ParameterValueGroup definition, Map<String, Boolean> ignore) Sets the parameter values to a copy of given parameters, making sure that the parameters are compatible with the ones expected by the operation method. This method should be invoked by constructors only, aftermethodhas been initialized.If
ignoreis non-null, then parameters associated toBoolean.TRUEmay be hidden. This situation happens when this operation has been initialized from a defining conversion and the caller refined the parameters using information provided by the math transform factory. On one hand, we want to take advantage of additional information present indefinitionsuch as OGC aliases (those information are often missing inmethodif the latter is not aMathTransformProvider). But on the other hand,definitionmay contain contextual parameters (ellipsoid semi-axis lengths) which are unknown tomethodand would cause anInvalidParameterValueExceptionif we try to set them. We could replacemethod, but if the latter was created from EPSG database it also contains metadata not present indefinitiondescriptor. The compromise applied in this method is to keepmethodas provided by user, also keepdefinitiondescriptor as supplied even if it is different thanmethoddescriptor, but hide (not remove) parameters that are known to be redundant with information that can be inferred from the context.- Parameters:
definition- the parameter to set, ornullif none.ignore- parameters to hide when the associated value isBoolean.TRUE, ornullfor no filtering. This map may be modified in-place.
-
equals
Compares this coordinate operation with the specified object for equality. If themodeargument isComparisonMode.STRICTorBY_CONTRACT, then all available properties are compared including the domain of validity and the scope.- Specified by:
equalsin interfaceLenientComparable- Overrides:
equalsin classAbstractCoordinateOperation- Parameters:
object- the object to compare tothis.mode-STRICTfor performing a strict comparison, orIGNORE_METADATAfor ignoring properties that do not make a difference in the numerical results of coordinate operations.- Returns:
trueif both objects are equal for the given comparison mode.- See Also:
-
setMethod
private void setMethod(org.opengis.referencing.operation.OperationMethod value) Invoked by JAXB at unmarshalling time.- See Also:
-
getParameters
private org.opengis.parameter.GeneralParameterValue[] getParameters()Invoked by JAXB for getting the parameters to marshal. This method usually marshals the sequence of parameters without theirParameterValueGroupwrapper, because GML is defined that way. TheParameterValueGroupwrapper is a GeoAPI addition done for allowing usage of its methods as a convenience (e.g.ParameterValueGroup.parameter(String)).However, it could happen that the user really wanted to specify a
ParameterValueGroupas the sole<gml:parameterValue>element. We currently have no easy way to distinguish those cases. SeeDefaultOperationMethod.getDescriptors()for more discussion.- See Also:
-
setParameters
private void setParameters(org.opengis.parameter.GeneralParameterValue[] values) Invoked by JAXB for setting the unmarshalled parameters. This method wraps the given parameters in aParameterValueGroup, unless the given descriptors was already aParameterValueGroup. -
afterUnmarshal
Invoked by JAXB after unmarshalling. This method needs information provided by:- Overrides:
afterUnmarshalin classAbstractCoordinateOperation- See Also:
-