ST_Summary — Returns a text summary of the contents of the
ST_Geometry.
text ST_Summary(geometry g);
Returns a text summary of the contents of the geometry.
This function supports 3d and will not drop the z-index.
SELECT ST_Summary(ST_GeomFromText('LINESTRING(0 0, 1 1)')) As good_line,
ST_Summary(ST_GeomFromText('POLYGON((0 0, 1 1, 1 2, 1 1, 0 0))')) As bad_poly
--results
good_line | bad_poly
----------------------+-------------------------
|
Line[B] with 2 points : Polygon[B] with 1 rings
: ring 0 has 5 points
:
--3d polygon
SELECT ST_Summary(ST_GeomFromEWKT('LINESTRING(0 0 1, 1 1 1)')) As good_line,
ST_Summary(ST_GeomFromEWKT('POLYGON((0 0 1, 1 1 2, 1 2 3, 1 1 1, 0 0 1))')) As poly
--results
good_line | poly
----------------------+-------------------------
|
Line[ZB] with 2 points : Polygon[ZB] with 1 rings
: ring 0 has 5 points
: