Training
MultiPoint
Applies to:
SQL Server
Azure SQL Database
Azure SQL Managed Instance
SQL analytics endpoint in Microsoft Fabric
Warehouse in Microsoft Fabric
SQL database in Microsoft Fabric
A MultiPoint is a collection of zero or more points. The boundary of a MultiPoint instance is empty.
The following example creates a geometry MultiPoint
instance with SRID 23 and two points: one point with the coordinates (2, 3), one point with the coordinates (7, 8), and a Z value of 9.5.
DECLARE @g geometry;
SET @g = geometry::STGeomFromText('MULTIPOINT((2 3), (7 8 9.5))', 23);
The following example expresses the MultiPoint
instance using STMPointFromText()
.
DECLARE @g geometry;
SET @g = geometry::STMPointFromText('MULTIPOINT((2 3), (7 8 9.5))', 23);
The following example uses the method STGeometryN()
to retrieve a description of the first point in the collection.
SELECT @g.STGeometryN(1).STAsText();
Additional resources
Documentation
-
GeometryCollection - SQL Server
GeometryCollection is a collection of zero or more geometry or geography instances in SQL Database Engine spatial data.
-
LineString is a one-dimensional object representing a sequence of points and the line segments connecting them in SQL Database Engine spatial data.
-
Create, construct, and query geometry instances - SQL Server
Geometry instances represent data in a Euclidean (flat) coordinate system. Learn how to create, construct, and query geometry data in SQL Database Engine spatial data.