next up previous contents
Next: getInAxes()getOutAxes() Up: Converting Between Multiple Coordinate Previous: Use Outside of a

Implementing New CoordTransform Classes

If you want to create new tranform classes that may be attached to a coordinate system, you should extend the abstract CoordTransform class. At a minimum, the only methods that you will need to implement are the four forward() and reverse() methods. This is usually the case when it does not matter how many axes there are in the input position and what order they are in. In this case, the default Axis Index List that forward(doub[]) and reverse(double[]) methods is usually just {0, 1, 2 ..}, up to the length of the input position.

Suppose however that your transform should only be applied to certain axes, such as longitude and latitude. Then, you may need to consider overriding the default implemations of other CoordTransform methods. Before you do, you should first define for your class what kinds of axes your transform will need to operate on and in what default order you should expect them to be in. For instance, you may assume that by default, the first axis will be longitude and the second axis will be latitude. In the paragraphs below, we examine in order the methods you may need to override.





Ray Plante
Mon Aug 25 15:16:12 CDT 1997