Convert a list of points to a shape.

@param points list of points
@return a shape
339023
static Shape shapeOf(List<Point2D> points) {
        Path2D path = new Path2D.Double();
        if (!points.isEmpty()) {
            path.moveTo(points.get(0).getX(), points.get(0).getY());
            for (Point2D point : points)
                path.lineTo(point.getX(), point.getY());
            path.closePath();
        }
        return path;
    }
1118798
public static LinearRing of(Iterable<Point> points) {
        LinearPositions.Builder builder = LinearPositions.builder();
        for(Point point : points) {
            builder.addSinglePosition(point.positions());
        }
        return new LinearRing(builder.build());
    }
1050277
public static List<Point> spin(Point[] points, double angle) {
        return spin(Arrays.asList(points), angle);
    }
217432
def multipoint(self, points):
        """"""
        shapeType = MULTIPOINT
        points = [points] # nest the points inside a list to be compatible with the generic shapeparts method
        self._shapeparts(parts=points, shapeType=shapeType)
676386
public Box fromPoints (IVector3... points) {
        setToEmpty();
        for (IVector3 point : points) {
            addLocal(point);
        }
        return this;
    }
1101101
def from_points(cls, list_of_lists):
        
        result = []
        for l in list_of_lists:
            curve = []
            for point in l:
                curve.append((point.lon, point.lat))
            result.append(curve)
        return Polygon(result)
1053059
private Circle toShapePoint(Geometry point) {
		if (point.getCoordinates() != null && point.getCoordinates().length == 1) {
			Coordinate first = point.getCoordinates()[0];
			Circle circle = new Circle(first.getX(), first.getY(), 5);
			circle.setFixedSize(true);
			return circle;
		}
		return null;
	}
1123471
public static Point2d convert(Tuple2D<?> tuple) {
		if (tuple instanceof Point2d) {
			return (Point2d) tuple;
		}
		return new Point2d(tuple.getX(), tuple.getY());
	}
592399
function (points) {
                var iMap = new HashMap();
                var newPoints = [];
                var intersections = [];
                var polygons = [];
                var iMaps = [];
                var poleIndex = -1;

                var pole = this.findIntersectionAndPole(points, newPoints, intersections, iMap);

                if (intersections.length === 0) {
                    polygons.push(newPoints);
                    iMaps.push(iMap);
                    return this.formatContourOutput(polygons, pole, poleIndex, iMaps);
                }

                if (intersections.length > 2) {
                    intersections.sort(function (a, b) {
                        return b.latitude - a.latitude;
                    });
                }

                if (pole !== Location.poles.NONE) {
                    newPoints = this.handleOnePole(newPoints, intersections, iMap, pole);
                    iMap = this.reindexIntersections(intersections, iMap, this.poleIndexOffset);
                }
                if (intersections.length === 0) {
                    polygons.push(newPoints);
                    iMaps.push(iMap);
                    poleIndex = 0;
                    return this.formatContourOutput(polygons, pole, poleIndex, iMaps);
                }

                this.linkIntersections(intersections, iMap);

                poleIndex = this.makePolygons(newPoints, intersections, iMap, polygons, iMaps);

                return this.formatContourOutput(polygons, pole, poleIndex, iMaps);
            }
1138422
private Point asPoint(List coords, CrsId crsId) throws IOException {
        if (coords != null && coords.size() >= 2) {
            ArrayList<List> coordinates = new ArrayList<List>();
            coordinates.add(coords);
            return new Point(getPointSequence(coordinates, crsId));
        } else {
            throw new IOException("A point must has exactly one coordinate (an x, a y and possibly a z value). Additional numbers in the coordinate are permitted but ignored.");
        }
    }
116318
protected static List<double[]> mergeInitPoints(List<double[]> basePoints,
            List<double[]> targetPoints)
    {
        List<double[]> mergedFeatures = new ArrayList<>();
        mergedFeatures.addAll(basePoints);
        mergedFeatures.addAll(targetPoints);

        return mergedFeatures;
    }
895990
private Shape[] combine(Shape target, Shape other, boolean subtract) {
		if (subtract) {
			ArrayList shapes = new ArrayList();
			ArrayList used = new ArrayList();
			
			// remove any points that are contianed in the shape we're removing, these
			// are implicitly used
			for (int i=0;i<target.getPointCount();i++) {
				float[] point = target.getPoint(i);
				if (other.contains(point[0], point[1])) {
					used.add(new Vector2f(point[0], point[1]));
					if (listener != null) {
						listener.pointExcluded(point[0], point[1]);
					}
				}
			}

			for (int i=0;i<target.getPointCount();i++) {
				float[] point = target.getPoint(i);
				Vector2f pt = new Vector2f(point[0], point[1]);
				
				if (!used.contains(pt)) {
					Shape result = combineSingle(target, other, true, i);
					shapes.add(result);
					for (int j=0;j<result.getPointCount();j++) {
						float[] kpoint = result.getPoint(j);
						Vector2f kpt = new Vector2f(kpoint[0], kpoint[1]);
						used.add(kpt);
					}
				}
			}
			
			return (Shape[]) shapes.toArray(new Shape[0]);
		} else {
			for (int i=0;i<target.getPointCount();i++) {
				if (!other.contains(target.getPoint(i)[0], target.getPoint(i)[1])) {
					if (!other.hasVertex(target.getPoint(i)[0], target.getPoint(i)[1])) {
						Shape shape = combineSingle(target, other, false, i);
						return new Shape[] {shape};
					}
				}
			}
			
			return new Shape[] {other};
		}
	}
1281864
public TriangulationPoint pointCCW( TriangulationPoint point )
    {
        if( point == points[0] )
        {
            return points[1];
        }
        else if( point == points[1] )
        {
            return points[2];
        }
        else if( point == points[2] )
        {
            return points[0];
        }
        logger.error( "point location error" );
        throw new RuntimeException("[FIXME] point location error");
    }
554043
public List<Polygon> polygons() {
    List<List<List<Point>>> coordinates = coordinates();
    List<Polygon> polygons = new ArrayList<>(coordinates.size());
    for (List<List<Point>> points : coordinates) {
      polygons.add(Polygon.fromLngLats(points));
    }
    return polygons;
  }
810095
public boolean isOnBorder(Point<?> points) {
    boolean		result;
    Point<Integer>	locations;
    int		i;

    if (points.dimensions() != dimensions())
      throw new IllegalArgumentException(
        "Dimension mismatch: space=" + dimensions()
          + ", points=" + points.dimensions());

    if (!(points.getValue(0) instanceof Integer))
      locations = getLocations((Point<Object>) points);
    else
      locations = (Point<Integer>) points;

    result = false;
    for (i = 0; i < dimensions(); i++) {
      if (getDimension(i).isOnBorder(locations.getValue(i))) {
        result = true;
        break;
      }
    }

    return result;
  }
643591
public void setFromPoints(Point2D[] points) {
		if (points == null || points.length == 0) {
			setEmpty();
			return;
		}

		Point2D pt = points[0];
		setCoords(pt.x, pt.y);
		for (int i = 1; i < points.length; i++) {
			Point2D pt2d = points[i];
			mergeNE(pt2d.x, pt2d.y);
		}
	}
1190707
public TimeSeries setPoint(Point point) {
    Utils.checkNotNull(point, "point");
    return new AutoValue_TimeSeries(getLabelValues(), Collections.singletonList(point), null);
  }