Ciao Jose',
unfortunately the version of GeoTools you are referring with is very old.
I recommend you update to a newer version of the code. Doing so, if
you provide me with an isolated testcase (code+ data) I would be able
to look into your problem.

Simone.

On Sun, Oct 12, 2008 at 7:37 AM, ze.sjrp <[EMAIL PROTECTED]> wrote:
>
> Hi mailing list members!
>
> First of all, I'm a newbie in GeoTools and this is my first post, so
> patience please... =^D
>
> Well, I'm using the RendererUtilities.worldToScreenTransform() method to get
> real coordinate from a GridCoverage2D, and then mapping this point on
> image's coordinate into other GridCoverage2D by a second transform. This
> coverages are not aligned. So, the same region would be matched on that two
> images, but in differents coordinates, of course. However, plotting each
> calculated point into corresponding images, different regions are
> referenced...
> The coverages have the same CRS. Actually, those images are obtained from
> LANDSAT5, band 4, on different epochs (2000 and 2008), so I'm think that
> they must have the same CRS, haven't? Furthermore, I has checked this
> through the GridCoverage2D's toWKT() method.
>
> Here is a snipe code from what I did:
>
> //Get the coverages...
> GridCoverage2D gc0 = ...;
> GridCoverage2D gc1 = ...;
> //Calculate a screenToWorld and a worldToScreen transforms to map a
> //point from a coverage to other else
> AffineTransform t0 = RendererUtilities.worldToScreenTransform(
>            new ReferencedEnvelope(
>                   gc0.getEnvelop2D(),
>                   gc0.getCoordinateReferenceSystem()
>               ),
>            gc0.getRenderedImage().getBounds()
>      ).createInverse();
> AffineTransform t1 = RendererUtilities.worldToScreenTransform(
>            new ReferencedEnvelope(
>                   gc1.getEnvelop2D(),
>                   gc1.getCoordinateReferenceSystem()
>               ),
>            gc1.getRenderedImage().getBounds()
>      );
> //Maps the first coverage's center into the second coverage.
> Point2D.Double p0 = new Point2D.Double(           //First coverage's
> center...
>      gc0.getWidth() / 2.d, gc0.getHeight() / 2.d
> );
> Point2D.Double p1 = (Point2D.Double)
>      t1.transform(
>          t0.transform(
>                p0, null
>          ), null
> );
>
> I already search on list but don't find a direct solution...
>
> PS: I'm using GeoTools 2.3.5 cause old code needs, and I not be able to
> change this...
>
> Thanks for any help!
> José
> --
> View this message in context: 
> http://n2.nabble.com/Problem-with-worldToScreenTransform-tp1321649p1321649.html
> Sent from the geotools-gt2-users mailing list archive at Nabble.com.
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>



-- 
-------------------------------------------------------
Eng. Simone Giannecchini
GeoSolutions S.A.S.
Owner - Software Engineer
Via Carignoni 51
55041  Camaiore (LU)
Italy

phone: +39 0584983027
fax:      +39 0584983027
mob:    +39 333 8128928


http://www.geo-solutions.it
http://www.geo-solutions.it/simone.giannecchini
http://www.linkedin.com/in/simonegiannecchini

-------------------------------------------------------

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to