Y. J. Chun a écrit :
> 1. Create mercator ProjectedCRS
> 2. Create AffineTransform to transform resulting meters into pixel
> positions. basically scale and translate
Right.
> 2.1. Create AffineTransform to transform my mercator map to
> ProjectedCRS. the image data has xy to lonlat reference points so i
> can use GridToEnvelopeMapper?
I'm not sure to understand this part. What do you mean by "Mercator map"
exactly? It should be the ProjectedCRS already, so there is no transformation
here.
> 3. Create DerivedCRS with 2) which will be screen crs
Right.
> 4. Create world2screen MathTransform from ProjectedCRS to ScreenCRS
> vice versa for image2world.
Could be done before 3. This "world2screen" (or "objective to display" in GO-1
terminology) is the affine transform created at step 2, so you already have it.
> - How do I create baseToDerived Conversion?
You can wraps your AffineTransform computed at step 2 in a MathTransform using
ProjectiveTransform.create(...) method. Then you can give this MathTransform to
a DefiningConversion constructor.
> - If i want to zoom/pan, I have to modify 2) AffineTransform. does it
> affect screen crs and world2screen on the fly?
> or do i have to create world2screen again every time i zoom/pan?
You have to recreate the CRS every time because all CRS are immutable by
design.
For performance reason it is better to recreate them on a "lazy" basis, i.e.
only when you need it.
Martin
-------------------------------------------------------------------------
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