# pgRouting Manual (3.0-rc1)

## pgr_alphaShape

`pgr_alphaShape` — Polygon part of an alpha shape.

Availability

- Version 3.0.0
  - Breaking change on signature
  - Old signature no longer supported
- Version 2.1.0
  - Added alpha argument with default 0 (use optimal value)
  - Support to return multiple outer/inner ring
- Version 2.0.0
  - Official function
  - Renamed from version 1.x

Support

- Supported versions: current(3.0)
- Unsupported versions: 2.6 2.5 2.4 2.3 2.2 2.1 2.0

## Description

Returns the polygon part of an alpha shape.

Characteristics

- Input is a geometry and returns a geometry
- Uses PostGis ST_DelaunyTriangles
- Instead of using CGAL’s definition of alpha it use the `spoon_radius`
  - \(spoon\_radius = \sqrt alpha\)
- A Triangle area is considered part of the alpha shape when \(circumcenter\ radius < spoon\_radius\)
- When the total number of points is less than 3, returns an EMPTY geometry

## Signatures

Summary

    pgr_alphaShape(geometry,   [spoon_radius])
    RETURNS geometry

Example: passing a geometry collection with spoon radius \(1.5\) using the return variable `geom`

    SELECT ST_Area(pgr_alphaShape((SELECT ST_Collect(the_geom) FROM edge_table_vertices_pgr), 1.5));
     st_area
    ---------
        9.75
    (1 row)

## Parameters

Parameter | Type | Default | Description
--- | --- | --- | ---
geometry | `geometry` |  | Geometry with at least \(3\) points
spoon_radius | `FLOAT` |  | The radius of the spoon

## Return Value

Kind of geometry | Description
--- | ---
GEOMETRY COLLECTION | A Geometry collection of Polygons

## See Also

- pgr_drivingDistance
- Sample Data network.
- ST_ConcaveHull

Indices and tables

- Index
- Search Page