STIsClosed (geography Data Type)
Returns 1 if the start and end points of the given geography instance are the same. Returns 1 for geography collection types if each contained geography instance is closed. Returns 0 if the instance is not closed.
This geography data type method supports FullGlobe instances or spatial instances that are larger than a hemisphere.
The following example creates a Polygon instance and uses STIsClosed() to test if the Polygon is closed.
DECLARE @g geography; SET @g = geography::STGeomFromText('POLYGON((-122.358 47.653, -122.348 47.649, -122.348 47.658, -122.358 47.658, -122.358 47.653))', 4326); SELECT @g.STIsClosed();