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    
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to