Andrea Aime a =E9crit :
> Nice but... as far as I remember, this is not the exact solution.=20
> Reprojection classes could, last time I checked, get a Shape implementa=
tion and reproject it=20
> creating exact (curved) reprojected lines. So the most accurate solutio=
n should be to get the=20
> box, reproject it as a Shape, and then get the bounds2d of the reprojec=
ted shape.
There is a MathTransform2D.createTransformedShape(Shape) which expect a=20
Java2D shape and returns a new (transformed) Java2D shape.
In pure ISO style, there is also a Geometry.transform(...) method. This=20
one is more generic (since it is not strictly 2D) and part of ISO=20
specification, but not yet implemented in Geotools.
In current Geotools implementation, only the Java2D method is=20
implemented. However, the default implementation has some approximations=20
too:
 We have not yet investigated the mathematic behind an exact
analytical solution for projected curves. I suspect that it
would not be trivial (I guess some good book must exist).
 Current Geotools implementation computes 3 points (the first
and the last one, and a middle point) and fits a quadratic
curve through those 3 points. It should be exact if we assume
that any straight line become a quadratic line (or an other
straight line, which I consider as a particular case of a
quadratic line with the coefficient of x=B2 set to 0) after the
projection. I don't know how accurate this assumption is.
 If we want yet more accuracy, we could fit a cubic line instead
of a quadratic line (we would then need 4 points instead of 3).
But it would require more mathematical background, or a good book
with formulas written for us.
 Java2D's Shape.getBounds2D() is itself approximative in the case of
quadratic and cubic lines. As of J2SE 1.5, it doesn't (yet) returns
the smallest bounding box, but returns instead a box which contains
the control points. See:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=3D4225281
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=3D4851378
However, the "curved lines" approach still probably a better approach in=20
the long run, since:
 We may improve the curve fitting accuracy over time.
 It is probably more efficient, since it transforms only 1 more point
(in addition to the vertex transformed anyway) and performs all
other computations (e.g. bounding box) analytically.
Martin.
