/** * Returns all available operations from a single to a compound coordinate reference system. * * @param sourceCRS Input coordinate reference system. * @param targetCRS Output coordinate reference system. * @param limit The maximum number of operations to be returned. Use -1 to return all the * available operations. Use 1 to return just one operations. Currently, the behavior for * other values of {@code limit} is undefined. * @return A {@code Set} of coordinate operations from {@code sourceCRS} to {@code targetCRS}. * @throws FactoryException If the operation can't be constructed. */ protected Set<CoordinateOperation> findOperationSteps( final SingleCRS sourceCRS, final CompoundCRS targetCRS, int limit) throws FactoryException { final List<SingleCRS> targets = DefaultCompoundCRS.getSingleCRS(targetCRS); if (targets.size() == 1) { return findOperations(sourceCRS, targets.get(0), limit); } /* * This method has almost no chance to succeed (we can't invent ordinate values!) unless * 'sourceCRS' is a 3D-geodetic CRS and 'targetCRS' is a 2D + 1D one. Test for this case. * Otherwise, the 'createOperationStep' invocation will throws the appropriate exception. */ final CoordinateReferenceSystem target3D = getFactoryContainer().toGeodetic3D(targetCRS); if (target3D != targetCRS) { return findOperations(sourceCRS, target3D, limit); } final List<SingleCRS> sources = Collections.singletonList(sourceCRS); return Collections.singleton(createOperationStep(sourceCRS, sources, targetCRS, targets)); }
if (needsGeodetic3D(sources, target)) { final ReferencingFactoryContainer factories = getFactoryContainer(); final CoordinateReferenceSystem source3D = factories.toGeodetic3D(sourceCRS); final CoordinateReferenceSystem target3D = factories.toGeodetic3D(targetCRS); if (source3D != sourceCRS || target3D != targetCRS) { return findOperations(source3D, target3D, limit);
final CoordinateReferenceSystem source3D = getFactoryContainer().toGeodetic3D(sourceCRS); if (source3D != sourceCRS) { return findOperations(source3D, targetCRS, limit);
toGeodetic3D(count == 2 ? crs : null, horizontal, vertical, xyFirst); if (count == 2) { return single;
final GeographicCRS base2D = sourceCRS.getBaseCRS(); final GeographicCRS base3D = (GeographicCRS) toGeodetic3D(null, base2D, vertical, xyFirst); final Matrix prepend = toStandard(base2D, false); final Matrix append = toStandard(sourceCRS, true);