> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ST_IsValid

Test if a geometry is well-formed. The function can be invoked with just the geometry or with an additional flag (from `v1.5.1`). The flag alters the validity checking behavior. The flags parameter is a bitfield with the following options:

* 0 (default): Use usual OGC SFS (Simple Features Specification) validity semantics.
* 1: "ESRI flag", Accepts certain self-touching rings as valid, which are considered invalid under OGC standards.

<img src="https://mintcdn.com/wherobots/fqh3gPDE0J25Lra_/images/sql-functions/ST_IsValid/ST_IsValid.svg?fit=max&auto=format&n=fqh3gPDE0J25Lra_&q=85&s=a65909c7dacc826efb654c5701099dbe" alt="ST_IsValid" width="380" height="120" data-path="images/sql-functions/ST_IsValid/ST_IsValid.svg" />

## Signatures

```sql theme={"system"}
ST_IsValid (A: Geometry)
```

```sql theme={"system"}
ST_IsValid (A: Geometry, flag: Integer)
```

## Parameters

<ParamField body="A" type="Geometry" required>
  The input geometry.
</ParamField>

<ParamField body="flag" type="Integer">
  The validation flag.
</ParamField>

## Return type

<ResponseField type="Boolean">
  Returns `true` or `false`.
</ResponseField>

## Example

```sql theme={"system"}
SELECT ST_IsValid(ST_GeomFromWKT('POLYGON((0 0, 10 0, 10 10, 0 10, 0 0), (15 15, 15 20, 20 20, 20 15, 15 15))'))
```

```
false
```
