Hi everyone,

I have created a DefaultDerivedCRS that is a rotation of a ProjectedCRS (called 
selectedCRS) like this:

> CoordinateReferenceSystem transformedCRS = selectedCRS;
> 
> if (getAngleRadians() != 0.0) {
>       // Create the rotation transform
>       final AffineTransform rotation = new AffineTransform();
>       rotation.rotate(getAngleRadians(), getRotationProjCenter().x, 
> getRotationProjCenter().y);
> 
>       // Creates the math transform
>       final MathTransform transform = ProjectiveTransform.create(rotation);
> 
>       // Sets the new CRS name
>       String crsName = selectedCRS.getName().toString();
>       if (getAngleRadians() != 0) {
>               final DecimalFormat formatter = new DecimalFormat("#.##");
>               final String rotationText = 
> formatter.format(Math.toDegrees(getAngleRadians()));
>               crsName += " / Rotation: " + rotationText + "°";
>       }
> 
> // Rotates the CRS
> transformedCRS = new DefaultDerivedCRS(crsName, selectedCRS, transform, 
> selectedCRS.getCoordinateSystem());
                
My problem is that this method is expected to return a ProjectedCRS and if I 
simply cast the DefaultDerivedCRS to ProjectedCRS, I get a ClassCastException.

How can I create such a rotated ProjectedCRS from another ProjectedCRS ?

Kind regards,
Ben

----
Dr Benoît Thiébault
Project Manager

  Artenum Toulouse - Science & Groupware
  http://www.artenum.com

Bâtiment Calfocenter
10, rue Marguerite Long
31 320 Castanet Tolosan
Phone: +33 (0)5 62 19 32 22


------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to