@Override public double getPrecision() { // Precision of this iterative operation is difficult to guess // because we don't know it uses radians, degrees or meters // We just suppose it is less than the base transformation return op.getPrecision()/2.0; }
/** * Return a pessimistic estimation of the precision where precision * of every sub-operation is simply added to the previous. * @return */ public double getPrecision() { double combinedPrecision = 0.0; for (CoordinateOperation op : sequence) { combinedPrecision += op.getPrecision(); } return combinedPrecision; }
/** * Returns the most precise among the list of {@link org.cts.op.CoordinateOperation}s. * @param ops * @return */ public static CoordinateOperation getMostPrecise(Collection<? extends CoordinateOperation> ops) { CoordinateOperation preciseOp = null; double currentPrecision = Double.MAX_VALUE; for (CoordinateOperation op : ops) { if (op.getPrecision() < currentPrecision) { preciseOp = op; currentPrecision = op.getPrecision(); } } return preciseOp; }
/** * Returns the most precise among the list of {@link org.cts.op.CoordinateOperation}s. * @param ops * @return */ public static CoordinateOperation getMostPrecise3DTransformation(Collection<? extends CoordinateOperation> ops) { CoordinateOperation preciseOp = null; double currentPrecision = Double.MAX_VALUE; for (CoordinateOperation op : ops) { if (op.getPrecision() < currentPrecision && op instanceof GeocentricTransformation) { preciseOp = op; currentPrecision = op.getPrecision(); } } return preciseOp; }
/** * Create a CoordinateOperationSequence from an identifier and a List of * {@linkplain org.cts.op.CoordinateOperation CoordinateOperations}. Precision * of this sequence is considered as the sum of all single * {@link org.cts.op.CoordinateOperation}. * * @param identifier this operation sequence identifier * @param list a list containing ordered operations to apply to coordinates */ public CoordinateOperationSequence(Identifier identifier, List<CoordinateOperation> list) { super(identifier); this.sequence = list.toArray(new CoordinateOperation[list.size()]); this.sequence = cleanSequence(sequence); for (CoordinateOperation op : sequence) { precision += op.getPrecision(); } }
/** * Create a CoordinateOperationSequence from an identifier and an array of * {@linkplain org.cts.op.CoordinateOperation CoordinateOperations}. Precision * of this sequence is considered as the sum of all single * {@link org.cts.op.CoordinateOperation}. * * @param identifier this operation sequence identifier * @param sequence an array containing ordered operations to apply to * coordinates */ public CoordinateOperationSequence(Identifier identifier, CoordinateOperation... sequence) { super(identifier); this.sequence = sequence; this.sequence = cleanSequence(sequence); for (CoordinateOperation op : sequence) { precision += op.getPrecision(); } }