> ## 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_GeneratePoints

Generates a specified quantity of pseudo-random points within the boundaries of the provided polygonal geometry. When `seed` is either zero or not defined then output will be random.

<img src="https://mintcdn.com/wherobots/fqh3gPDE0J25Lra_/images/sql-functions/ST_GeneratePoints/ST_GeneratePoints.svg?fit=max&auto=format&n=fqh3gPDE0J25Lra_&q=85&s=3920ae42970e93a706d331829e6b7057" alt="ST_GeneratePoints" width="500" height="300" data-path="images/sql-functions/ST_GeneratePoints/ST_GeneratePoints.svg" />

## Signatures

```sql theme={"system"}
ST_GeneratePoints(geom: Geometry, numPoints: Integer, seed: Long = 0)
```

```sql theme={"system"}
ST_GeneratePoints(geom: Geometry, numPoints: Integer)
```

## Parameters

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

<ParamField body="numPoints" type="Integer" required>
  The number of points.
</ParamField>

<ParamField body="seed" type="Long" default="0">
  The seed value.
</ParamField>

## Return type

<ResponseField type="Geometry">
  The resulting geometry.
</ResponseField>

## Example

```sql theme={"system"}
SELECT ST_GeneratePoints(
        ST_GeomFromWKT('POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))'), 4
)
```

<Note>
  Due to the pseudo-random nature of point generation, the output of this function will vary between executions and may not match any provided examples.
</Note>

```
MULTIPOINT ((0.2393028905520183 0.9721563442837837), (0.3805848547053376 0.7546556656982678), (0.0950295778200995 0.2494334895495989), (0.4133520939987385 0.3447046312451945))
```
