Hello,
I'm trying to rotate a map using the information in an earlier discussion:
MapContent content = new MapContent();
// add layer(s), then...
ReferencedEnvelope bounds = source.getBounds();
CoordinateReferenceSystem srcCRS =bounds.getCoordinateReferenceSystem();
// rotation by 45 degrees CCW
AffineTransform rotation = AffineTransform.getRotateInstance(Math.PI /
4);
MathTransform tr = new
AffineTransform2D(rotation);
// create a derived CRS (WARNING: LAST ARG IS A HACK !)
DefaultDerivedCRS rotatedCRS =
new DefaultDerivedCRS("rotated", srcCRS,
tr,srcCRS.getCoordinateSystem());
// set the bounds of the viewport with the new CRS
ReferencedEnvelope rotatedBounds = bounds.transform(rotatedCRS, true);
MapViewport viewport = content.getViewport();
viewport.setBounds(rotatedBounds);
The problem is that AffineTransform2D(rotation) does not return a MathTransform.
How can I do that?
I tried ProjectiveTransform but this distorts the final image. I'm using CRS
28992 (Dutch RD).
It is in the context of StreamingRenderer:
renderer.paint(graphics, imageBounds, rotatedBounds);
Thanks for all your help.
Ron
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users