ST_Summary

更新时间:
复制 MD 格式

Returns a text summary of a geometry object or geography object.

Syntax

text ST_Summary(geometry g);
text ST_Summary(geography g);

Parameters

ParameterDescription
gThe geometry object or geography object.

Output flags

The text summary includes a set of flags in square brackets after the geometry type name. Each flag indicates a property of the input object:

FlagMeaning
MThe summary contains m coordinates.
ZThe summary contains z coordinates.
BThe summary contains cached bounding boxes.
GThe input is a geography object.
SThe summary contains the spatial reference system in which the object resides.

Usage notes

ST_Summary supports circular strings, curves, polyhedral surfaces, triangles, triangulated irregular network (TIN) surfaces, and 3D objects.

Examples

Get a summary of a geometry object

The following example returns the text summary of a MultiPolygon with two Polygon elements. The [B] flag indicates that the object has a cached bounding box.

SELECT ST_Summary('MULTIPOLYGON(((1 0,0 3,3 0,1 0)),((1 0,2 0,0 2,1 0)))'::geometry);

Output:

           st_summary
---------------------------------
 MultiPolygon[B] with 2 elements+
   Polygon[] with 1 rings       +
    ring 0 has 4 points         +
   Polygon[] with 1 rings       +
    ring 0 has 4 points
(1 row)