/** * Check we are actually using the EPSG database for anything not in override * * @throws TransformException */ @Test public void testFallbackOnEPSGDatabaseStd() throws Exception { // Test CRSs CoordinateReferenceSystem source = CRS.decode("EPSG:3002"); CoordinateReferenceSystem target = CRS.decode("EPSG:4326"); CoordinateOperation co = CRS.getCoordinateOperationFactory(true).createOperation(source, target); ConcatenatedOperation cco = (ConcatenatedOperation) co; // the EPSG one only has two steps, the non EPSG one 4 assertEquals(2, cco.getOperations().size()); }
final Collection components = ((ConcatenatedOperation) operation).getOperations(); for (final Iterator it = components.iterator(); it.hasNext(); ) { final double candidate = Math.abs(getAccuracy((CoordinateOperation) it.next()));
final LinkedList<CoordinateOperation> inverted = new LinkedList<CoordinateOperation>(); for (final CoordinateOperation op : ((ConcatenatedOperation) operation).getOperations()) { inverted.addFirst(inverse(op));
} else if (op instanceof ConcatenatedOperation) { final ConcatenatedOperation cop = (ConcatenatedOperation) op; final List<SingleOperation> cops = cop.getOperations(); expand(cops.toArray(new CoordinateOperation[cops.size()]), target, factory, false); } else {
/** * Creates a new coordinate operation with the same values than the specified one. * This copy constructor provides a way to convert an arbitrary implementation into a SIS one * or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API. * * <p>This constructor performs a shallow copy, i.e. the properties are not cloned.</p> * * @param operation the coordinate operation to copy. * * @see #castOrCopy(ConcatenatedOperation) */ protected DefaultConcatenatedOperation(final ConcatenatedOperation operation) { super(operation); operations = operation.getOperations(); }
/** * Creates a new coordinate operation with the same values than the specified one. * This copy constructor provides a way to convert an arbitrary implementation into a SIS one * or a user-defined one (as a subclass), usually in order to leverage some implementation-specific API. * * <p>This constructor performs a shallow copy, i.e. the properties are not cloned.</p> * * @param operation the coordinate operation to copy. * * @see #castOrCopy(ConcatenatedOperation) */ protected DefaultConcatenatedOperation(final ConcatenatedOperation operation) { super(operation); operations = operation.getOperations(); }
final List<SingleOperation> c = ((ConcatenatedOperation) operation).getOperations(); final CoordinateOperation[] op = c.toArray(new CoordinateOperation[c.size()]); if (op.length != 0) {
/** * Compares this concatenated operation with the specified object for equality. If the {@code mode} argument * is {@link ComparisonMode#STRICT} or {@link ComparisonMode#BY_CONTRACT BY_CONTRACT}, then all available * properties are compared including the {@linkplain #getDomainOfValidity() domain of validity} and the * {@linkplain #getScope() scope}. * * @return {@inheritDoc} */ @Override public boolean equals(final Object object, final ComparisonMode mode) { if (object == this) { return true; // Slight optimization. } if (super.equals(object, mode)) { if (mode == ComparisonMode.STRICT) { return Objects.equals(operations, ((DefaultConcatenatedOperation) object).operations); } else { return deepEquals(getOperations(), ((ConcatenatedOperation) object).getOperations(), mode); } } return false; }
operations.addAll(((ConcatenatedOperation) operation).getOperations()); } else { operations.add(operation);
operations.addAll(((ConcatenatedOperation) operation).getOperations()); } else { operations.add(operation);
/** * Compares this concatenated operation with the specified object for equality. If the {@code mode} argument * is {@link ComparisonMode#STRICT} or {@link ComparisonMode#BY_CONTRACT BY_CONTRACT}, then all available * properties are compared including the {@linkplain #getDomainOfValidity() domain of validity} and the * {@linkplain #getScope() scope}. * * @return {@inheritDoc} */ @Override public boolean equals(final Object object, final ComparisonMode mode) { if (object == this) { return true; // Slight optimization. } if (super.equals(object, mode)) { if (mode == ComparisonMode.STRICT) { return Objects.equals(operations, ((DefaultConcatenatedOperation) object).operations); } else { return deepEquals(getOperations(), ((ConcatenatedOperation) object).getOperations(), mode); } } return false; }
/** * Returns the first coordinate operation which is a transformation. * The skipped part are the map projections, which is not the purpose of this test. */ private static Transformation getTransformation(final CoordinateOperation operation) { if (operation instanceof Transformation) { return (Transformation) operation; } if (operation instanceof ConcatenatedOperation) { for (final CoordinateOperation op : ((ConcatenatedOperation) operation).getOperations()) { final Transformation tr = getTransformation(op); if (tr != null) { return tr; } } } return null; } }
final List<? extends CoordinateOperation> operations = ((ConcatenatedOperation) operation).getOperations(); final CoordinateOperation[] inverted = new CoordinateOperation[operations.size()]; for (int i=0; i<inverted.length;) {
final List<? extends CoordinateOperation> operations = ((ConcatenatedOperation) operation).getOperations(); final CoordinateOperation[] inverted = new CoordinateOperation[operations.size()]; for (int i=0; i<inverted.length;) {
final List<? extends CoordinateOperation> c = ((ConcatenatedOperation) operation).getOperations(); final CoordinateOperation[] op = c.toArray(new CoordinateOperation[c.size()]); switch (op.length) {
for (final CoordinateOperation op : ((ConcatenatedOperation) step).getOperations()) { printOperations(op, isNext); isNext = true;
for (final CoordinateOperation op : ((ConcatenatedOperation) operation).getOperations()) { if (op instanceof Transformation) { count++;
final boolean isUsingEpsgFactory = verifyParametersNTF(((ConcatenatedOperation) operation).getOperations(), 1); assertEquals("linearAccuracy", isUsingEpsgFactory ? 2 : PositionalAccuracyConstant.UNKNOWN_ACCURACY, CRS.getLinearAccuracy(operation), STRICT);
final boolean isUsingEpsgFactory = verifyParametersNTF(((ConcatenatedOperation) operation).getOperations(), 2); assertEquals("linearAccuracy", isUsingEpsgFactory ? 2 : PositionalAccuracyConstant.UNKNOWN_ACCURACY, CRS.getLinearAccuracy(operation), STRICT);
final List<? extends CoordinateOperation> steps = ((ConcatenatedOperation) operation).getOperations(); assertEquals("Operation should have two steps.", 2, steps.size()); final SingleOperation step1 = (SingleOperation) steps.get(0);