geography.STIsValid
spatial predicate STIsValid
What changes
- Input
- one or two spatial instances
- Output or change
- bit
- Return type
- SQL Server return type: bit CLR return type: SqlBoolean
Syntax at a glance
.STIsValid ( )
Work example
Use geography.STIsValid to check whether a shape meets spatial validity rules.
Validate imported polygons before area and overlay calculations. Keep the geography type and SRID in the review.
Check your work The closed, non-self-intersecting sample polygon returns 1 for valid.
Practice SQL
Open in SQL FlowOpen the SQL for a walkthrough. Run the example in SQL Server to check its result.
SELECT p.shape.STIsValid() AS polygon_is_valid FROM (VALUES (geography::STGeomFromText('POLYGON((-122.358 47.653, -122.348 47.649, -122.348 47.658, -122.358 47.658, -122.358 47.653))', 4326))) AS p(shape);
Open Microsoft Learn for full syntax, permissions, and details for your version.