shapely.extract_unique_points#
- extract_unique_points(geometry, **kwargs)#
Return all distinct vertices of an input geometry as a multipoint.
Note that only 2 dimensions of the vertices are considered when testing for equality.
- Parameters:
- geometryGeometry or array_like
Geometry or geometries for which to extract unique points.
- **kwargs
See NumPy ufunc docs for other keyword arguments.
Examples
>>> import shapely >>> from shapely import LineString, MultiPoint, Point, Polygon >>> shapely.extract_unique_points(Point(0, 0)) <MULTIPOINT ((0 0))> >>> shapely.extract_unique_points(LineString([(0, 0), (1, 1), (1, 1)])) <MULTIPOINT ((0 0), (1 1))> >>> shapely.extract_unique_points(Polygon([(0, 0), (1, 0), (1, 1), (0, 1), (0, 0)])) <MULTIPOINT ((0 0), (1 0), (1 1), (0 1))> >>> shapely.extract_unique_points(MultiPoint([(0, 0), (1, 1), (0, 0)])) <MULTIPOINT ((0 0), (1 1))> >>> shapely.extract_unique_points(LineString()) <MULTIPOINT EMPTY>