STIsValid (geometry)#
Returns true if a geometry instance is well-formed, based on its Open Geospatial Consortium (OGC) type. Returns false if a geometry instance is not well-formed.
Syntax#
.STIsValid ()
Return type#
bit
Remarks#
The OGC type of a geometry instance can be determined by invoking STGeometryType().
Querona produces only valid geometry instances, but allows for the storage and retrieval of invalid instances. A valid instance representing the same point set of any invalid instance can be retrieved using the MakeValid() method.
Example#
Create a geometry instance and use STIsValid() to test if the instance is valid.
DECLARE @g geometry;
SET @g = geometry::STGeomFromText('LINESTRING(0 0, 2 2, 1 0)', 0);
SELECT @g.STIsValid();