public void closeRing() {
    int size = size();
    if (size >= 1) {
      double firstX = getX(0);
      double firstY = getY(0);
      double lastX = getX(size - 1);
      double lastY = getY(size - 1);
      if (firstX != lastX || firstY != lastY) {
        points.add(firstX, firstY);
      }
    }
  }
Adds the starting coordinate to the end of this sequence if it has not already been added.
planetiler-core/src/main/java/com/onthegomap/planetiler/geo/MutableCoordinateSequence.java