This topic describes the ST_Dump function. This function returns a set of geometry_dump rows of the input geometry object.

Syntax

geometry_dump[]  ST_Dump(geometry  g1);

Parameters

Parameter Description
g1 The geometry object that you want to specify.

Description

  • This function extracts the components of the input geometry object and returns a set of geometry_dump rows of the input geometry object. Each value of a row contains a geometry object and an array of integers. The geometry object is represented as geom and the array of integers is represented as path.
    • If you specify a point object, LineString object, or polygon object, this function returns a single record that consists of an empty path array and the input geometry as geom.
    • If you specify a collection object or MULTI object, this function returns the components of the collection and an array of integers that represents the position of each component.
  • This function is useful for expanding geometry objects. The ST_Dump function is the reverse of a GROUP BY clause. For example, you can use this function to expand a MultiPolygon object to a polygon object.
  • This function supports circular strings, curves, polyhedral surfaces, triangles, triangulated irregular network (TIN) surfaces, and 3D objects.

Examples

Results returned by using the default parameter settings:
SELECT (t.dump).path,ST_AsText((t.dump).geom) from (select ST_Dump('MULTILINESTRING((0 0,0 2),(0 1,0 3))'::geometry) as dump) as t;
 path |      st_astext
------+---------------------
 {1}  | LINESTRING(0 0,0 2)
 {2}  | LINESTRING(0 1,0 3)
(2 rows)