Andrea Aime a écrit :
> Sounds good. Let me know when you have something I can test in Geoserver :)
Commited to Geotools trunk as of revision 25779 (took me the whole day). Not
sure if it is directly usable for Geoserver however (see below).
Using the Envelope given in previous Andrea's email for testing purpose (Andrea
said that this envelope "is everything beneath a certain parallel, probably the
-40° one, towards the pole"), I got:
Before the fix:
-178.5 to 137.6 in longitude and -40.9 to -88.99 in latitude
After the fix:
-180.0 to 180.0 in longitude and -40.9 to 90.0 in latitude.
The 180.0 and 90.0 bounding are exact (no rounding errors).
which seems consistent with expectation.
-------------------------------
HOWEVER
-------------------------------
We don't get this improvement for free in all cases. We don't get any
improvement when using the following methods, which are unmodified (except for a
notice I added in the javadoc):
- CRS.transform(MathTransform, ... anything ...)
- JTS.transform(...anything...)
You get this improvement for free when using the following methods, which are
the *only* ones capable to leverage the improvement in current API:
- ReferencingEnvelope.transform(CoordinateReferenceSystem, ... anything ...)
In addition, I added the following methods which provides the improved
algorithm. Since it is new API, of course existing Geoserver code don't leverage
it yet.
CRS.transform(CoordinateOperation, ... anything ...)
-------------------------------
CAUSE
-------------------------------
This is because MathTransform do not provides suffisient informations. We need
to use CoordinateOperation instead, which contains a MathTransform together with
some metadata.
I know that most Geotools code work directly with MathTransform, maybe because
CoordinateOperation looked useless to most users. I didn't said anything about
that, but I was expecting that soon or later it will cause us some trouble.
Those days are comming. So my suggestion to all Geotools developers:
Keep the CoordinateOperation object when you have it. Do not
just extract the MathTransform from it and throw away the
CoordinateOperation. Soon or later it will be useful.
I don't know how much deeply it impact code like the Streaming Renderer however.
Martin
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel