// get the bounds for the unrotated map area
final ReferencedEnvelope mapBounds = this.transformer.getBounds().toReferencedEnvelope(
new Rectangle(this.transformer.getMapSize()), this.dpi);
// then rotate the geometry around its center
final Coordinate center = mapBounds.centre();
final AffineTransform affineTransform = AffineTransform.getRotateInstance(
this.transformer.getRotation(), center.x, center.y);
final MathTransform mathTransform = new AffineTransform2D(affineTransform);
try {