[geotk] Envelope/bbox transformation

Martin Desruisseaux martin.desruisseaux at geomatys.fr
Thu Mar 10 17:06:43 EST 2011

Hello Aaron

A patch has been deployed, which should fix the NoninvertibleTransformException. 
Please let me know if there is other issues after the one which has been fixed.

Le 10/03/11 05:37, Aaron Braeckel a écrit :
> are there any existing methods for transforming an entire Envelope into 
> another CRS?  This is not a trivial process given the potential non-linear 
> relationships between different CRSs.  We have previously dealt with this by 
> subsampling along the edges of the envelope, applying a number of tests (like 
> isNAN() on each point, and ensuring the edges of the subsampled polygon do not 
> cross one another) getting the min/max of these coordinates, and so on.  
> Before I head off and re-implement it, does anything like this exist in Geotk 
> right now?

    * The CRS.transform(MathTransform, Envelope) method performs a similar work,
      subsampling only the corners and the centers of each edges.
    * The CRS.transform(CoordinateOperation, Envelope) is like above, with
      additional checks for poles. It is recommanded over the previous method
      every time the CoordinateOperation object is available.
    * The CRS.transform(Envelope, CoordinateReferenceSystem) method just
      delegates to the above. It is more efficient to use the above methods if
      there is many envelopes to transform to the same CRS.


A better approach could be implemented, now that Geotk supports the derivative 
of some projections. We could use some of the well-known numerical methods for 
finding minimums or maximum inside an interval. This has not yet been done in 
part because the MathTransform.derivative(DirectPosition) method is not yet 
implemented for all projections (but it is implemented for the most common ones 



More information about the Geotoolkit mailing list