Skip to content

Latest commit

 

History

History
55 lines (41 loc) · 2.12 KB

stisvalid-geography-data-type.md

File metadata and controls

55 lines (41 loc) · 2.12 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic ms.custom helpviewer_keywords dev_langs
STIsValid (geography Data Type)
STIsValid (geography Data Type)
MladjoA
mlandzic
03/14/2017
sql
t-sql
reference
ignite-2024
STIsValid method (geography)
TSQL

STIsValid (geography Data Type)

[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance FabricSQLDB]

Returns true if a geography instance is well-formed and recognized as a valid geography object based on its Open Geospatial Consortium (OGC) type. Returns false if a geography instance is not well-formed. This method is precise.

This geography data type method supports FullGlobe instances or spatial instances that are larger than a hemisphere.

Syntax

  
.STIsValid ( )  

Return Types

[!INCLUDEssNoVersion] return type: bit

CLR return type: SqlBoolean

Remarks

The OGC type of a geography instance can be determined by invoking STGeometryType().

[!INCLUDEssNoVersion] produces only valid geography instances, but allows for the storage and retrieval of invalid instances. A valid instance representing the same point set of an invalid instance can be retrieved using the MakeValid() method.

Examples

The following example creates a geography instance and uses STIsValid() to test if the instance is valid.

DECLARE @g geography = geography::STGeomFromText('LINESTRING(0 0, 2 2, 1 0)', 4326);  
SELECT @g.STIsValid();  
DECLARE @g geography  

See Also

STGeometryType (geography Data Type)
MakeValid (geography Data Type)
OGC Methods on Geography Instances