Пример #1
0
 /**
  * Creates a LineString instance from the specified points
  *
  * @param first The first point
  * @param second The second point
  * @param morePoints The rest of the points
  * @return A new LineString instance
  */
 public static LineString lineString(Point first, Point second, Point... morePoints) {
   Point[] points = new Point[2 + morePoints.length];
   points[0] = Assert.argumentNotNull(first, "first");
   points[1] = Assert.argumentNotNull(second, "second");
   for (int i = 0; i < morePoints.length; i++) points[i + 2] = morePoints[i];
   return lineString(points);
 }
Пример #2
0
  /**
   * Creates a Polygon instance from the specified points
   *
   * @param first The first point
   * @param second The second point
   * @param third The third point
   * @param morePoints The rest of the points
   * @return A new Polygon instance
   */
  public static Polygon polygon(Point first, Point second, Point third, Point... morePoints) {
    Point[] points = new Point[3 + morePoints.length];
    points[0] = Assert.argumentNotNull(first, "first");
    points[1] = Assert.argumentNotNull(second, "second");
    points[2] = Assert.argumentNotNull(third, "third");
    for (int i = 0; i < morePoints.length; i++) points[i + 3] = morePoints[i];

    return polygon(points);
  }