I've already done what I wanted to do: Transform among screen
coordinates and world coordinates (and back) using the code:

--
AffineTransform world2screen =
RendererUtilities.worldToScreenTransform(mapContext.getLayerBounds(),
new
Rectangle(panelMap.getWidth(), panelMap.getHeight()));
AffineTransform screen2world = world2screen.createInverse();
Point2D pointScreen = screen2world.transform(pointScreenAbsolute, null);
--

I understand that the whole manual page is focused to explain the last
point[1] and if I read the whole page to the end I understand that the
first example is to show users the _not so_ right way to get x,y axis.
But If a programmer that is beginning with GeoTools (like me) read there
howto get screen to world coordinates he will end thinking "Oh shit I
don't know how to get this variable, this method params do not match"
and stop reading.

And if he finally get the transform he will end with Long/Lat in UTM and
ignorant in how to transform UTM to Long/Lat in a geographic coordinate
system (spherical coordinate system) in degrees (If you know the answer
to this question please please send it to me).

With this I'm trying to explain why I think that the _working_ examples
in the user manual are very important, and if the example is vague
because is only a waypoint to explain another thing I think (always
IMHO, I thank you guys infinitely for the great work of creating
GeoTools) that a link to a working example must be provided.

If you show me the user manual guidelines I will be glad to document
carefully the things I achieve in the progress of my project.

Thanks!

[1] http://docs.codehaus.org/display/GEOTDOC/04+What+Axis+is
+X#04WhatAxisisX-LookinguptherightAxis
On jue, 2008-01-17 at 18:49 -0800, Jody Garnett wrote:
> Can we chat for a second about what you are wanting out of this example?
> 
> Having a look at it this is an example of the referencing module; so the 
> point of the page is to ask people to trust (and use!) the coordinate 
> reference system "metadata". Rather than just assuming new Point2D( 
> position.getOrdinate( 0 ), position.getOrdinate( 1 ) ).
> 
> Do you actually want to transform screen to Lat/Long?
> data - is unknown
> world - is this Lat/Long for you
> screen - is based on the view port model or some kind of world2screen 
> transformation used by the renderer
> 
> Jody
> 
> > I'm going to try fixing the example after dinner.
> >
> > On Thu, January 17, 2008 17:48, Jody Garnett wrote:
> >   
> >> I have updated that page with your code example:
> >> http://docs.codehaus.org/display/GEOTDOC/04+What+Axis+is+X
> >>
> >> Were you able to spot the error in the original instructions or should I
> >> just remove them?
> >>
> >>     
> >
> >
> >   
> 
-- 
Diego Fdez. Durán <[EMAIL PROTECTED]> | http://www.goedi.net
GPG : 925C 9A21 7A11 3B13 6E43 50DB F579 D119 90D2 66BB

Attachment: signature.asc
Description: Esta parte del mensaje está firmada digitalmente

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to