reverse method

LinearRing reverse()

Reverses the LinearRing's coordinates. Example:

LinearRing ring = LinearRing([
  Coordinate(0, 0),
  Coordinate(0, 1),
  Coordinate(1, 1),
  Coordinate(1, 0),
  Coordinate(0, 0),
]);
print(ring.coordinates); // [Coordinate(0, 0), Coordinate(0, 1), Coordinate(1, 1), Coordinate(1, 0), Coordinate(0, 0)]
print(ring.reverse().coordinates); // [Coordinate(0, 0), Coordinate(1, 0), Coordinate(1, 1), Coordinate(0, 1), Coordinate(0, 0)]

Implementation

LinearRing reverse() {
  return LinearRing(coordinates.reversed.toList());
}