ArgumentChecks.ensureNonNull("derivedCS", derivedCS); final Context context = ReferencingUtilities.createTransformContext(baseCRS, null, null); context.setTarget(derivedCS); return createParameterizedTransform(parameters, context);
ensureCompatibleParameters(false); // Invoke only after we set 'provider' to its final instance. case 1: return setEllipsoid(getSourceEllipsoid(), Constants.SEMI_MAJOR, Constants.SEMI_MINOR, true, null); case 2: return setEllipsoid(getTargetEllipsoid(), Constants.SEMI_MAJOR, Constants.SEMI_MINOR, true, null); case 3: { RuntimeException failure = null; if (sourceCS != null) try { ensureCompatibleParameters(true); final ParameterValue<?> p = parameters.parameter("dim"); // Really 'parameters', not 'userParams'. if (p.getValue() == null) { failure = e; failure = setEllipsoid(getSourceEllipsoid(), "src_semi_major", "src_semi_minor", false, failure); failure = setEllipsoid(getTargetEllipsoid(), "tgt_semi_major", "tgt_semi_minor", false, failure); return failure;
break; Matrix matrix = super.getMatrix(role); if (rotation != 0) { if (inverse) rotation = -rotation;
final CoordinateSystem sourceCS = context.getSourceCS(); final CoordinateSystem targetCS = context.getTargetCS(); if (equalsIgnoreMetadata(sourceDatum, targetDatum)) { final boolean isGeocentricToGeographic; before = mtFactory.createCoordinateSystemChange(sourceCS, normalized, sourceDatum.getEllipsoid()); after = mtFactory.createCoordinateSystemChange(normalized, targetCS, targetDatum.getEllipsoid()); context.setSource(normalized); context.setTarget(normalized); context.setSource(targetCS);
final CoordinateSystem sourceCS = context.getSourceCS(); final CoordinateSystem targetCS = context.getTargetCS(); if (equalsIgnoreMetadata(sourceDatum, targetDatum)) { final boolean isGeocentricToGeographic; before = mtFactory.createCoordinateSystemChange(sourceCS, normalized, sourceDatum.getEllipsoid()); after = mtFactory.createCoordinateSystemChange(normalized, targetCS, targetDatum.getEllipsoid()); context.setSource(normalized); context.setTarget(normalized); context.setSource(targetCS);
failure = context.completeParameters(this, method, parameters); parameters = context.parameters; method = context.provider;
failure = context.completeParameters(this, method, parameters); parameters = context.parameters; method = context.provider;
ensureCompatibleParameters(true); ParameterValue<?> mismatchedParam = null; double mismatchedValue = 0; final double a = getValue(ap, unit); final double b = getValue(bp, unit); final double tol = Units.METRE.getConverterTo(unit).convert(ELLIPSOID_PRECISION); if (ensureSet(ap, a, ellipsoid.getSemiMajorAxis(), unit, tol)) { mismatchedParam = ap; mismatchedValue = a; if (ensureSet(bp, b, ellipsoid.getSemiMinorAxis(), unit, tol)) { mismatchedParam = bp; mismatchedValue = b;
ensureCompatibleParameters(true); ParameterValue<?> mismatchedParam = null; double mismatchedValue = 0; final double a = getValue(ap, unit); final double b = getValue(bp, unit); final double tol = Units.METRE.getConverterTo(unit).convert(ELLIPSOID_PRECISION); if (ensureSet(ap, a, ellipsoid.getSemiMajorAxis(), unit, tol)) { mismatchedParam = ap; mismatchedValue = a; if (ensureSet(bp, b, ellipsoid.getSemiMinorAxis(), unit, tol)) { mismatchedParam = bp; mismatchedValue = b;
ensureCompatibleParameters(false); // Invoke only after we set 'provider' to its final instance. case 1: return setEllipsoid(getSourceEllipsoid(), Constants.SEMI_MAJOR, Constants.SEMI_MINOR, true, null); case 2: return setEllipsoid(getTargetEllipsoid(), Constants.SEMI_MAJOR, Constants.SEMI_MINOR, true, null); case 3: { RuntimeException failure = null; if (sourceCS != null) try { ensureCompatibleParameters(true); final ParameterValue<?> p = parameters.parameter("dim"); // Really 'parameters', not 'userParams'. if (p.getValue() == null) { failure = e; failure = setEllipsoid(getSourceEllipsoid(), "src_semi_major", "src_semi_minor", false, failure); failure = setEllipsoid(getTargetEllipsoid(), "tgt_semi_major", "tgt_semi_minor", false, failure); return failure;
if (target instanceof GeneralDerivedCRS) { context = ReferencingUtilities.createTransformContext(source, null, null); context.setTarget(target.getCoordinateSystem()); // Using 'target' would be unsafe here. } else { context = ReferencingUtilities.createTransformContext(source, target, null); parameters = Parameters.unmodifiable(context.getCompletedParameters()); } else { final DefaultMathTransformFactory.Context context = new DefaultMathTransformFactory.Context(); context.setSource(source.getCoordinateSystem()); context.setTarget(target.getCoordinateSystem()); // See comment on the other setTarget(…) call. transform = ((DefaultMathTransformFactory) factory).swapAndScaleAxes(transform, context); } else {
if (target instanceof GeneralDerivedCRS) { context = ReferencingUtilities.createTransformContext(source, null, null); context.setTarget(target.getCoordinateSystem()); // Using 'target' would be unsafe here. } else { context = ReferencingUtilities.createTransformContext(source, target, null); parameters = Parameters.unmodifiable(context.getCompletedParameters()); } else { final DefaultMathTransformFactory.Context context = new DefaultMathTransformFactory.Context(); context.setSource(source.getCoordinateSystem()); context.setTarget(target.getCoordinateSystem()); // See comment on the other setTarget(…) call. transform = ((DefaultMathTransformFactory) factory).swapAndScaleAxes(transform, context); } else {
default: throw new IllegalArgumentException(Errors.format(Errors.Keys.IllegalArgumentValue_2, "role", role)); case INVERSE_NORMALIZATION: inverse = true; // Fall through case NORMALIZATION: specified = getSourceCS(); break; case INVERSE_DENORMALIZATION: inverse = true; // Fall through case DENORMALIZATION: inverse = !inverse; specified = getTargetCS(); break;
final Context context = new Context(); final EllipsoidalCS cs; final String operation; if (isEllipsoidalSource) { operation = GeographicToGeocentric.NAME; context.setSource(cs = (EllipsoidalCS) source, ellipsoid); context.setTarget(target); } else { operation = GeocentricToGeographic.NAME; context.setSource(source); context.setTarget(cs = (EllipsoidalCS) target, ellipsoid);
break; Matrix matrix = super.getMatrix(role); if (rotation != 0) { if (inverse) rotation = -rotation;
final Context context = new Context(); final EllipsoidalCS cs; final String operation; if (isEllipsoidalSource) { operation = GeographicToGeocentric.NAME; context.setSource(cs = (EllipsoidalCS) source, ellipsoid); context.setTarget(target); } else { operation = GeocentricToGeographic.NAME; context.setSource(source); context.setTarget(cs = (EllipsoidalCS) target, ellipsoid);
default: throw new IllegalArgumentException(Errors.format(Errors.Keys.IllegalArgumentValue_2, "role", role)); case INVERSE_NORMALIZATION: inverse = true; // Fall through case NORMALIZATION: specified = getSourceCS(); break; case INVERSE_DENORMALIZATION: inverse = true; // Fall through case DENORMALIZATION: inverse = !inverse; specified = getTargetCS(); break;