/** * Creates the object which will perform the actual task of finding a coordinate operation path between two CRS. * This method is invoked by {@link #createOperation(CoordinateReferenceSystem, CoordinateReferenceSystem, * CoordinateOperationContext) createOperation(…)} when no operation was found in the cache. * The default implementation is straightforward: * * {@preformat java * return new CoordinateOperationFinder(registry, this, context); * } * * Subclasses can override this method is they want to modify the way coordinate operations are inferred. * * @param registry the factory to use for creating operations as defined by authority, or {@code null} if none. * @param context the area of interest and desired accuracy, or {@code null} if none. * @return a finder of conversion or transformation path from a source CRS to a target CRS. * @throws FactoryException if an error occurred while initializing the {@code CoordinateOperationFinder}. * * @since 0.8 */ protected CoordinateOperationFinder createOperationFinder( final CoordinateOperationAuthorityFactory registry, final CoordinateOperationContext context) throws FactoryException { return new CoordinateOperationFinder(registry, this, context); }
/** * Creates the object which will perform the actual task of finding a coordinate operation path between two CRS. * This method is invoked by {@link #createOperation(CoordinateReferenceSystem, CoordinateReferenceSystem, * CoordinateOperationContext) createOperation(…)} when no operation was found in the cache. * The default implementation is straightforward: * * {@preformat java * return new CoordinateOperationFinder(registry, this, context); * } * * Subclasses can override this method is they want to modify the way coordinate operations are inferred. * * @param registry the factory to use for creating operations as defined by authority, or {@code null} if none. * @param context the area of interest and desired accuracy, or {@code null} if none. * @return a finder of conversion or transformation path from a source CRS to a target CRS. * @throws FactoryException if an error occurred while initializing the {@code CoordinateOperationFinder}. * * @since 0.8 */ protected CoordinateOperationFinder createOperationFinder( final CoordinateOperationAuthorityFactory registry, final CoordinateOperationContext context) throws FactoryException { return new CoordinateOperationFinder(registry, this, context); }
/** * Creates a new test case. * * @throws FactoryException if an error occurred while initializing the finder to test. */ public CoordinateOperationFinderTest() throws FactoryException { finder = new CoordinateOperationFinder(null, factory, null); }
/** * Implementation of {@link #testIdentityTransform()} using the given CRS. */ private void testIdentityTransform(final CoordinateReferenceSystem crs) throws FactoryException { final CoordinateOperation operation = finder.createOperation(crs, crs); assertSame ("sourceCRS", crs, operation.getSourceCRS()); assertSame ("targetCRS", crs, operation.getTargetCRS()); assertTrue ("isIdentity", operation.getMathTransform().isIdentity()); assertTrue ("accuracy", operation.getCoordinateOperationAccuracy().isEmpty()); assertInstanceOf("operation", Conversion.class, operation); finder = new CoordinateOperationFinder(null, factory, null); // Reset for next call. }