*/
private void bursaWolfs(final PrintWriter out, final String[] args) throws FactoryException {
final NumberFormat nf = NumberFormat.getNumberInstance();
nf.setMinimumFractionDigits(3);
nf.setMaximumFractionDigits(3);
final TableWriter table = new TableWriter(out);
table.writeHorizontalSeparator();
final String[] titles = {
Vocabulary.format(VocabularyKeys.TARGET),
"dx", "dy", "dz", "ex", "ey", "ez", "ppm"
};
for (int i=0; i<titles.length; i++) {
table.write(titles[i]);
table.nextColumn();
table.setAlignment(TableWriter.ALIGN_CENTER);
}
table.writeHorizontalSeparator();
for (int i=0; i<args.length; i++) {
IdentifiedObject object = factory.createObject(args[i]);
if (object instanceof CoordinateReferenceSystem) {
object = CRSUtilities.getDatum((CoordinateReferenceSystem) object);
}
if (object instanceof DefaultGeodeticDatum) {
final BursaWolfParameters[] params =
((DefaultGeodeticDatum) object).getBursaWolfParameters();
for (int j=0; j<params.length; j++) {
final BursaWolfParameters p = params[j];
table.setAlignment(TableWriter.ALIGN_LEFT);
table.write(p.targetDatum.getName().getCode());
table.nextColumn();
table.setAlignment(TableWriter.ALIGN_RIGHT);
double v;
for (int k=0; k<7; k++) {
switch (k) {
case 0: v = p.dx; break;
case 1: v = p.dy; break;
case 2: v = p.dz; break;
case 3: v = p.ex; break;
case 4: v = p.ey; break;
case 5: v = p.ez; break;
case 6: v = p.ppm; break;
default: throw new AssertionError(k);
}
table.write(nf.format(v));
table.nextColumn();
}
table.nextLine();
}
table.writeHorizontalSeparator();
}
}
try {
table.flush();
} catch (IOException e) {
// Should never happen, since we are backed by PrintWriter
throw new AssertionError(e);
}
}