/** * 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. * * <p>This constructor performs a shallow copy, i.e. the properties are not cloned.</p> * * @param operation the coordinate operation to copy. */ protected AbstractSingleOperation(final SingleOperation operation) { super(operation); method = operation.getMethod(); parameters = Parameters.unmodifiable(operation.getParameterValues()); }
/** * 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. * * <p>This constructor performs a shallow copy, i.e. the properties are not cloned.</p> * * @param operation the coordinate operation to copy. */ protected AbstractSingleOperation(final SingleOperation operation) { super(operation); method = operation.getMethod(); parameters = Parameters.unmodifiable(operation.getParameterValues()); }
final SingleOperation that = (SingleOperation) object; return deepEquals(getMethod(), that.getMethod(), mode) && deepEquals(getParameterValues(), that.getParameterValues(), mode);
final SingleOperation that = (SingleOperation) object; return deepEquals(getMethod(), that.getMethod(), mode) && deepEquals(getParameterValues(), that.getParameterValues(), mode);
final Map<String,Object> merge = new HashMap<String,Object>( IdentifiedObjects.getProperties(single, CoordinateOperation.IDENTIFIERS_KEY)); merge.put(ReferencingServices.PARAMETERS_KEY, ((SingleOperation) single).getParameterValues()); if (single instanceof AbstractIdentifiedObject) { merge.put(ReferencingServices.OPERATION_TYPE_KEY, ((AbstractIdentifiedObject) single).getInterface());
final ParameterValueGroup parameters = source.getParameterValues(); final ParameterValueGroup copy = parameters.getDescriptor().createValue(); for (final GeneralParameterValue gp : parameters.values()) {
final ParameterValueGroup parameters = object.getParameterValues(); mandatory("Operation: ParameterValues are mandatory.", method); container.parameter.validate(parameters);
final ParameterValueGroup parameters = object.getParameterValues(); mandatory("Operation: ParameterValues are mandatory.", method); container.validate(parameters);
properties.put(ReferencingServices.PARAMETERS_KEY, single.getParameterValues()); if (method == null) { final int sourceDimensions = transform.getSourceDimensions();
properties.put(ReferencingServices.PARAMETERS_KEY, single.getParameterValues()); if (method == null) { final int sourceDimensions = transform.getSourceDimensions();
/** * Verifies the datum shift parameters in the <cite>"NTF to WGS 84 (1)"</cite> transformation. * Those parameters depends on whether an EPSG database have been used or not. * * @param steps the list returned by {@link DefaultConcatenatedOperation#getOperations()}. * @param datumShiftIndex index of the datum shift operations in the {@code steps} list. * @return the {@link #isUsingEpsgFactory()} value, returned for convenience. */ private static boolean verifyParametersNTF(final List<? extends CoordinateOperation> steps, final int datumShiftIndex) throws FactoryException { if (isUsingEpsgFactory()) { final SingleOperation step1 = (SingleOperation) steps.get(datumShiftIndex); final SingleOperation step2 = (SingleOperation) steps.get(datumShiftIndex + 1); assertEpsgNameAndIdentifierEqual("NTF (Paris) to NTF (1)", 1763, step1); assertEpsgNameAndIdentifierEqual("NTF to WGS 84 (1)", 1193, step2); final ParameterValueGroup p1 = step1.getParameterValues(); final ParameterValueGroup p2 = step2.getParameterValues(); assertEquals("Longitude offset", 2.5969213, p1.parameter("Longitude offset") .doubleValue(), STRICT); assertEquals("X-axis translation", -168, p2.parameter("X-axis translation").doubleValue(), STRICT); assertEquals("Y-axis translation", -60, p2.parameter("Y-axis translation").doubleValue(), STRICT); assertEquals("Z-axis translation", 320, p2.parameter("Z-axis translation").doubleValue(), STRICT); return true; } else { assertSame(CoordinateOperationFinder.ELLIPSOID_CHANGE, steps.get(datumShiftIndex).getName()); return false; } }
throws FactoryException final ParameterValueGroup parameters = operation.getParameterValues(); if (parameters != null) { CoordinateReferenceSystem crs;
throws FactoryException final ParameterValueGroup parameters = operation.getParameterValues(); if (parameters != null) { CoordinateReferenceSystem crs;
final MathTransform mt = factorySIS.getMathTransformFactory().createConcatenatedTransform(mt1, mt2); main = createFromMathTransform(new HashMap<String,Object>(IdentifiedObjects.getProperties(main)), sourceCRS, targetCRS, mt, op.getMethod(), op.getParameterValues(), (main instanceof Transformation) ? Transformation.class : (main instanceof Conversion) ? Conversion.class : SingleOperation.class);
final MathTransform mt = factorySIS.getMathTransformFactory().createConcatenatedTransform(mt1, mt2); main = createFromMathTransform(new HashMap<>(IdentifiedObjects.getProperties(main)), sourceCRS, targetCRS, mt, op.getMethod(), op.getParameterValues(), (main instanceof Transformation) ? Transformation.class : (main instanceof Conversion) ? Conversion.class : SingleOperation.class);
assertEquals("Method 2", "Geocentric translations (" + domain + ')', step2.getMethod().getName().getCode()); final ParameterValueGroup p1 = step1.getParameterValues(); final ParameterValueGroup p2 = step2.getParameterValues(); assertEquals("Longitude offset", 2.5969213, p1.parameter("Longitude offset") .doubleValue(), STRICT); assertEquals("X-axis translation", -168, p2.parameter("X-axis translation").doubleValue(), STRICT);
assertInstanceOf("operation", Conversion.class, operation); final ParameterValueGroup parameters = ((SingleOperation) operation).getParameterValues(); assertEquals("parameters.descriptor", "Geographic3D to 2D conversion", parameters.getDescriptor().getName().getCode()); assertTrue ("parameters.isEmpty", parameters.values().isEmpty());
operation = createOperation(sourceCRS, targetCRS); assertEpsgNameWithoutIdentifierEqual("Martinique 1938 to RGAF09 (1)", operation); final ParameterValueGroup p = ((SingleOperation) operation).getParameterValues();
assertInstanceOf("operation", Conversion.class, operation); final ParameterValueGroup parameters = ((SingleOperation) operation).getParameterValues(); assertEquals("parameters.descriptor", "Geographic2D to 3D conversion", parameters.getDescriptor().getName().getCode()); assertEquals("parameters.height", 0, parameters.parameter("height").doubleValue(), STRICT);
assertInstanceOf("operation", Projection.class, operation); final ParameterValueGroup param = ((SingleOperation) operation).getParameterValues(); assertEquals("semi_major", 6370997, param.parameter("semi_major" ).doubleValue(), STRICT); assertEquals("semi_minor", 6370997, param.parameter("semi_minor" ).doubleValue(), STRICT);