if ( reader.hasMoreChildren() ) {
reader.moveDown(); //transform or crs
}
AffineTransform2D gridToCRS = null;
if ( "transform".equals( reader.getNodeName() ) ) {
double sx,sy,shx,shy,tx,ty;
reader.moveDown(); //scaleX
sx = Double.parseDouble( reader.getValue() );
reader.moveUp();
reader.moveDown(); //scaleY
sy = Double.parseDouble( reader.getValue() );
reader.moveUp();
reader.moveDown(); //shearX
shx = Double.parseDouble( reader.getValue() );
reader.moveUp();
reader.moveDown(); //shearY
shy = Double.parseDouble( reader.getValue() );
reader.moveUp();
reader.moveDown(); //translateX
tx = Double.parseDouble( reader.getValue() );
reader.moveUp();
reader.moveDown(); //translateY
ty = Double.parseDouble( reader.getValue() );
reader.moveUp();
// set tranform
gridToCRS = new AffineTransform2D(sx, shx, shy, sy, tx, ty);
reader.moveUp();
if ( reader.hasMoreChildren() ) {
reader.moveDown(); //crs
}
}