/** * Invoked by JAXB at unmarshalling time for storing the result temporarily. * * @param method the unmarshalled element. */ public void setElement(final DefaultOperationMethod method) { if (!CC_GeneralOperationParameter.isValid(method.getParameters())) { /* * Parameters are mandatory and SIS classes need them. Provide an error message * here instead than waiting for a NullPointerException in some arbitrary place. */ throw new IllegalArgumentException(Errors.format(Errors.Keys.MissingValueForProperty_1, "parameters")); } metadata = method; }
/** * Invoked by JAXB at unmarshalling time for storing the result temporarily. * * @param method the unmarshalled element. */ public void setElement(final DefaultOperationMethod method) { if (!CC_GeneralOperationParameter.isValid(method.getParameters())) { /* * Parameters are mandatory and SIS classes need them. Provide an error message * here instead than waiting for a NullPointerException in some arbitrary place. */ throw new IllegalArgumentException(Errors.format(Errors.Keys.MissingValueForProperty_1, "parameters")); } metadata = method; }
/** * Returns the parameters for the operation method. * * @param name shall be the operation method name. * @return the parameters. * @throws NoSuchIdentifierException if the given name is not the name * of the operation method known to this factory. */ @Override public ParameterValueGroup getDefaultParameters(final String name) throws NoSuchIdentifierException { if (method.isHeuristicMatchForName(name)) { return method.getParameters().createValue(); } throw new NoSuchIdentifierException(null, name); }
return Objects.equals(getSourceDimensions(), that.getSourceDimensions()) && Objects.equals(getTargetDimensions(), that.getTargetDimensions()) && Utilities.deepEquals(getParameters(), that.getParameters(), mode);
return Objects.equals(getSourceDimensions(), that.getSourceDimensions()) && Objects.equals(getTargetDimensions(), that.getTargetDimensions()) && Utilities.deepEquals(getParameters(), that.getParameters(), mode);
/** * Initializes a complete projection (including conversion from degrees to radians) for the given provider. */ final void createCompleteProjection(final DefaultOperationMethod provider, final double semiMajor, final double semiMinor, final double centralMeridian, final double latitudeOfOrigin, final double standardParallel1, final double standardParallel2, final double scaleFactor, final double falseEasting, final double falseNorthing) throws FactoryException { final Parameters values = Parameters.castOrWrap(provider.getParameters().createValue()); values.parameter(Constants.SEMI_MAJOR).setValue(semiMajor); values.parameter(Constants.SEMI_MINOR).setValue(semiMinor); if (semiMajor == WGS84_A && semiMinor == WGS84_B) { values.parameter(Constants.INVERSE_FLATTENING).setValue(298.257223563); } if (!isNaN(centralMeridian)) values.parameter(Constants.CENTRAL_MERIDIAN) .setValue(centralMeridian); if (!isNaN(latitudeOfOrigin)) values.parameter(Constants.LATITUDE_OF_ORIGIN) .setValue(latitudeOfOrigin); if (!isNaN(standardParallel1)) values.parameter(Constants.STANDARD_PARALLEL_1).setValue(standardParallel1); if (!isNaN(standardParallel2)) values.parameter(Constants.STANDARD_PARALLEL_2).setValue(standardParallel2); if (!isNaN(scaleFactor)) values.parameter(Constants.SCALE_FACTOR) .setValue(scaleFactor); if (!isNaN(falseEasting)) values.parameter(Constants.FALSE_EASTING) .setValue(falseEasting); if (!isNaN(falseNorthing)) values.parameter(Constants.FALSE_NORTHING) .setValue(falseNorthing); transform = new MathTransformFactoryMock(provider).createParameterizedTransform(values); validate(); }
/** * Returns the parameters to use for instantiating the projection to test. * The parameters are initialized with the ellipse semi-axis lengths. * * @param provider the provider of the projection to test. * @param ellipse {@code false} for a sphere, or {@code true} for WGS84 ellipsoid. * @return the parameters to use for instantiating the projection. */ static Parameters parameters(final DefaultOperationMethod provider, final boolean ellipse) { final Parameters parameters = Parameters.castOrWrap(provider.getParameters().createValue()); final Ellipsoid ellipsoid = (ellipse ? GeodeticDatumMock.WGS84 : GeodeticDatumMock.SPHERE).getEllipsoid(); parameters.parameter(Constants.SEMI_MAJOR).setValue(ellipsoid.getSemiMajorAxis()); parameters.parameter(Constants.SEMI_MINOR).setValue(ellipsoid.getSemiMinorAxis()); if (ellipse) { parameters.parameter(Constants.INVERSE_FLATTENING).setValue(ellipsoid.getInverseFlattening()); } return parameters; }