STPointOnSurface (geometry)

STPointOnSurface (geometry)#

Returns an arbitrary point located within the interior of a geometry instance.

Syntax#

.STPointOnSurface ()

Return type#

geometry

Remarks#

This method returns null if the instance is empty.

Example#

Create a Polygon instance and use STPointOnSurface() to find a point on the instance.

DECLARE @g geometry;
SET @g = geometry::STGeomFromText('POLYGON((0 0, 3 0, 3 3, 0 3, 0 0),(2 2, 2 1, 1 1, 1 2, 2 2))', 0);
SELECT @g.STPointOnSurface().ToString();

See Also#