final CoordinateReferenceSystem targetCRS = getCoordinateReferenceSystem();
final CoordinateOperation operation;
try {
operation = factory.createOperation(crs, targetCRS);
} catch (FactoryException exception) {
throw new TransformException(exception.getLocalizedMessage(), exception);
}
/*
* Note: 'sourceCRS' must be set last, when we are sure that all other fields
* are set to their correct value. This is in order to keep this instance in
* a consistent state in case an exception is thrown.