* @param dest An optionnaly pre-allocated direct position.
* @return The {@code dest} argument, or a new object if {@code dest} was null.
* @throws IndexOutOfBoundsException if an index is out of bounds.
*/
public DirectPosition get(int row, int column, DirectPosition dest) throws IndexOutOfBoundsException {
DirectPosition target = new DirectPositionImpl(getInternal( row, column ));
if (dest == null || !dest.getCoordinateReferenceSystem().equals(target.getCoordinateReferenceSystem())){
return target;
}
for (int i = 0; i < target.getDimension(); i++) {
dest.setOrdinate(i, target.getOrdinate(i));
}
return dest;
}