/** * Constructs a coordinate operation factory using the specified hints and priority. This * constructor recognizes the {@link Hints#CRS_FACTORY CRS}, {@link Hints#CS_FACTORY CS}, {@link * Hints#DATUM_FACTORY DATUM} and {@link Hints#MATH_TRANSFORM_FACTORY MATH_TRANSFORM} {@code * FACTORY} hints. * * @param userHints The hints, or {@code null} if none. * @param priority The priority for this factory, as a number between {@link #MINIMUM_PRIORITY * MINIMUM_PRIORITY} and {@link #MAXIMUM_PRIORITY MAXIMUM_PRIORITY} inclusive. * @since 2.2 */ public AbstractCoordinateOperationFactory(final Hints userHints, final int priority) { super(priority); factories = ReferencingFactoryContainer.instance(userHints); mtFactory = factories.getMathTransformFactory(); }
/** * Creates a transform from a group of parameters. This method delegates the work to the * {@linkplain #getMathTransformFactory underlying math transform factory} and keep trace of the * {@linkplain OperationMethod operation method} used. The later can be obtained by a call to * {@link #getLastUsedMethod}. * * @param parameters The parameter values. * @return The parameterized transform. * @throws NoSuchIdentifierException if there is no transform registered for the method. * @throws FactoryException if the object creation failed. This exception is thrown if some * required parameter has not been supplied, or has illegal value. * @see MathTransformFactory#createParameterizedTransform * @deprecated Use the {@link MathTransformFactory} interface instead. */ @Deprecated public MathTransform createParameterizedTransform(ParameterValueGroup parameters) throws NoSuchIdentifierException, FactoryException { return getMathTransformFactory().createParameterizedTransform(parameters); }
/** * Returns the operation method for the last call to a {@code create} method in the currently * running thread. This method may be invoked after any of the following methods: * * <p> * * <ul> * <li>{@link #createParameterizedTransform} * <li>{@link #createBaseToDerived} * </ul> * * @return The operation method for the last call to a {@code create} method, or {@code null} if * none. * @see MathTransformFactory#getLastMethodUsed * @deprecated Moved to the {@link MathTransformFactory} interface. */ @Deprecated public OperationMethod getLastUsedMethod() { return getMathTransformFactory().getLastMethodUsed(); }
/** * Creates a {@linkplain #createParameterizedTransform parameterized transform} from a base CRS * to a derived CS. If the {@code "semi_major"} and {@code "semi_minor"} parameters are not * explicitly specified, they will be inferred from the {@linkplain Ellipsoid ellipsoid} and * added to {@code parameters}. In addition, this method performs axis switch as needed. * * <p>The {@linkplain OperationMethod operation method} used can be obtained by a call to {@link * #getLastUsedMethod}. * * @param baseCRS The source coordinate reference system. * @param parameters The parameter values for the transform. * @param derivedCS the target coordinate system. * @return The parameterized transform. * @throws NoSuchIdentifierException if there is no transform registered for the method. * @throws FactoryException if the object creation failed. This exception is thrown if some * required parameter has not been supplied, or has illegal value. * @see MathTransformFactory#createBaseToDerived * @deprecated Moved to the {@link MathTransformFactory} interface. */ @Deprecated public MathTransform createBaseToDerived( final CoordinateReferenceSystem baseCRS, final ParameterValueGroup parameters, final CoordinateSystem derivedCS) throws NoSuchIdentifierException, FactoryException { return getMathTransformFactory().createBaseToDerived(baseCRS, parameters, derivedCS); }
/** * If the specified factory is an instance of {@code AbstractCoordinateOperationFactory}, fetch * the {@link FactoryGroup} from this instance instead of from the hints. This constructor is * strictly reserved for factory subclasses that are wrapper around an other factory, like * {@link BufferedCoordinateOperationFactory}. */ AbstractCoordinateOperationFactory( final CoordinateOperationFactory factory, final Hints hints, final int priority) { super(priority); if (factory instanceof AbstractCoordinateOperationFactory) { factories = ((AbstractCoordinateOperationFactory) factory).getFactoryContainer(); } else { factories = ReferencingFactoryContainer.instance(hints); } mtFactory = factories.getMathTransformFactory(); }
/** * Forces the initialisation of all factories. Implementation note: we try to create the * factories in typical dependency order (CRS all because it has the greatest chances to depends * on other factories). */ private void initialize() { mtFactory = getMathTransformFactory(); datumFactory = getDatumFactory(); csFactory = getCSFactory(); crsFactory = getCRSFactory(); }
/** * Constructs a parser for the specified set of symbols using the specified set of factories. * * @param symbols The symbols for parsing and formatting numbers. * @param factories The factories to use. */ public Parser(final Symbols symbols, final ReferencingFactoryContainer factories) { this( symbols, factories.getDatumFactory(), factories.getCSFactory(), factories.getCRSFactory(), factories.getMathTransformFactory()); }
final MathTransformFactory mtFactory = getMathTransformFactory(); if (mtFactory instanceof DefaultMathTransformFactory) {
mt = factories.getMathTransformFactory().createFromWKT(WKT); } catch (FactoryException e) { (DefaultMathTransformFactory) factories.getMathTransformFactory(); MathTransform mt2 = mtf.createBaseToDerived(source, mt, target.getCoordinateSystem());
/** * Creates a coordinate reference system from the specified code. The default implementation * creates a {@linkplain ParameterValueGroup parameter group} for the {@linkplain * #getClassification projection classification}, and then invokes {@link * #setProjectionParameters} in order to fill the parameter values. */ public final ProjectedCRS create(final Code code, final ReferencingFactoryContainer factories) throws FactoryException { final String classification = getClassification(); final ParameterValueGroup parameters; parameters = factories.getMathTransformFactory().getDefaultParameters(classification); setProjectionParameters(parameters, code); final String name = getName(); final DefiningConversion conversion = new DefiningConversion(name, parameters); return factories .getCRSFactory() .createProjectedCRS( Collections.singletonMap(IdentifiedObject.NAME_KEY, name), DefaultGeographicCRS.WGS84, conversion, DefaultCartesianCS.PROJECTED); }
try { ParameterValueGroup pvg = factories.getMathTransformFactory().getDefaultParameters(name); if (pvg != null && pvg.getDescriptor() != null
parameters = factories.getMathTransformFactory().getDefaultParameters(classe); fillParameterValues(methodCode, epsg, parameters); .getMathTransformFactory() .createBaseToDerived( sourceCRS, parameters, targetCRS.getCoordinateSystem());
parameters = factories.getMathTransformFactory().getDefaultParameters(classe); fillParameterValues(methodCode, epsg, parameters); .getMathTransformFactory() .createBaseToDerived( sourceCRS, parameters, targetCRS.getCoordinateSystem());
assertSame(csFactory, container.getCSFactory()); assertSame(crsFactory, container.getCRSFactory()); assertSame(mtFactory, container.getMathTransformFactory());
Conversion projection = sourceCRS.getConversionFromBase(); if (!prepend.isIdentity() || !append.isIdentity()) { final MathTransformFactory mtFactory = getMathTransformFactory(); MathTransform mt = projection.getMathTransform(); mt =