##
Variable Numbers of Coordinates

In our earlier examples, we have used a fixed number of input and output coordinates when registering a coordinate transformation function. It is not necessary to impose this restriction, however, if the transformation function can cope with a variable number of coordinates (as with the example in §20.4). We indicate the acceptability of a variable number when registering the transformation function by supplying the value AST__ANY for the number of input and/or output coordinates, as follows:

284#284

The result is that an IntraMapIntraMap may now be created with any number of input and output coordinates. For example:

285#285

It is possible to fix either the number of input or output coordinates (by supplying an explicit number to astIntraRegastIntraReg), but more subtle restrictions on the number of coordinates, such as requiring that NinNin and NoutNout be equal, are not supported. This means that:

286#286

will be accepted without error, although the transformation function cannot actually handle such a combination sensibly. If this is important, it would be worth adding a check within the transformation function itself, so that the error would be detected when it came to be used.