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

This function scales the input geometry (`geometry`) to a new size. It does this by multiplying the coordinates of the input geometry with corresponding values from another geometry (`factor`) representing the scaling factors.

To scale the geometry relative to a point other than the true origin (e.g., scaling a polygon in place using its centroid), you can use the three-geometry variant of this function. This variant requires an additional geometry (`origin`) representing the "false origin" for the scaling operation. If no `origin` is provided, the scaling occurs relative to the true origin, with all coordinates of the input geometry simply multiplied by the corresponding scale factors.

<Note>
  This function is designed for scaling 2D geometries. While it currently doesn't support scaling the Z and M coordinates, it preserves these values during the scaling operation.
</Note>

<img src="https://mintcdn.com/wherobots/wLm_IRUSNlHZTHJP/images/sql-functions/ST_ScaleGeom/ST_ScaleGeom.svg?fit=max&auto=format&n=wLm_IRUSNlHZTHJP&q=85&s=cfe67c2b1000fed6c2006d3b590a7110" alt="ST_ScaleGeom" width="400" height="180" data-path="images/sql-functions/ST_ScaleGeom/ST_ScaleGeom.svg" />

## Signatures

```sql theme={"system"}
ST_ScaleGeom(geometry: Geometry, factor: Geometry, origin: Geometry)
```

```sql theme={"system"}
ST_ScaleGeom(geometry: Geometry, factor: Geometry)
```

## Parameters

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

<ParamField body="factor" type="Geometry" required>
  The factor value.
</ParamField>

<ParamField body="origin" type="Geometry">
  The origin value.
</ParamField>

## Return type

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

## Examples

```sql theme={"system"}
SELECT ST_Scale(
        ST_GeomFromWKT('POLYGON ((0 0, 0 1.5, 1.5 1.5, 1.5 0, 0 0))'),
       ST_Point(3, 2)
)
```

```
POLYGON ((0 0, 0 3, 4.5 3, 4.5 0, 0 0))
```

```sql theme={"system"}
SELECT ST_Scale(
        ST_GeomFromWKT('POLYGON ((0 0, 0 1.5, 1.5 1.5, 1.5 0, 0 0))'),
       ST_Point(3, 2), ST_Point(1, 2)
)
```

```
POLYGON ((-2 -2, -2 1, 2.5 1, 2.5 -2, -2 -2))
```
