operator [] method

  1. @override
int operator [](
  1. int i
)
override

A coordinate value by the coordinate axis index i.

Returns zero when a coordinate axis is not available.

For projected or cartesian coordinates, the coordinate ordering is: (x, y), (x, y, m), (x, y, z) or (x, y, z, m).

For geographic coordinates, the coordinate ordering is: (lon, lat), (lon, lat, m), (lon, lat, elev) or (lon, lat, elev, m).

Implementation

@override
int operator [](int i) {
  switch (i) {
    case 0:
      return x;
    case 1:
      return y;
    default:
      return 0;
  }
}