<refnamediv>
<refname>ST_Summary</refname>
- <refpurpose>Returns a text summary of the contents of the
- <varname>ST_Geometry</varname>.
+ <refpurpose>
+Returns a text summary of the contents of the geometry.
</refpurpose>
</refnamediv>
<funcsynopsis>
<funcprototype>
<funcdef>text <function>ST_Summary</function></funcdef>
-
<paramdef><type>geometry </type> <parameter>g</parameter></paramdef>
</funcprototype>
+ <funcprototype>
+ <funcdef>text <function>ST_Summary</function></funcdef>
+ <paramdef><type>geography </type> <parameter>g</parameter></paramdef>
+ </funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<title>Description</title>
<para>Returns a text summary of the contents of the geometry.</para>
+
+ <para>
+ Flags shown square brackets after the geometry type
+ have the following meaning:
+ <itemizedlist>
+ <listitem><para>M: has M ordinate</para></listitem>
+ <listitem><para>Z: has Z ordinate</para></listitem>
+ <listitem><para>B: has a cached bounding box</para></listitem>
+ <listitem><para>G: is geodetic (geography)</para></listitem>
+ </itemizedlist>
+ </para>
+
<para>&Z_support;</para>
+ <para>Availability: 1.2.2 - 2.0.0 added support for geography</para>
</refsection>
<refsection>
<title>Examples</title>
- <programlisting>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
- :
+ <programlisting>
+=# SELECT ST_Summary(ST_GeomFromText('LINESTRING(0 0, 1 1)')) as geom,
+ ST_Summary(ST_GeogFromText('POLYGON((0 0, 1 1, 1 2, 1 1, 0 0))')) geog;
+ geom | geog
+-----------------------------+--------------------------
+ LineString[B] with 2 points | Polygon[BG] with 1 rings
+ : ring 0 has 5 points
+ :
+(1 row)
---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
- :
+=# SELECT ST_Summary(ST_GeogFromText('LINESTRING(0 0 1, 1 1 1)')) As geog_line,
+ ST_Summary(ST_GeomFromText('POLYGON((0 0 1, 1 1 2, 1 2 3, 1 1 1, 0 0 1))')) As geom_poly;
+;
+ geog_line | geom_poly
+-------------------------------+--------------------------
+ LineString[ZBG] with 2 points | Polygon[ZB] with 1 rings
+ : ring 0 has 5 points
+ :
+(1 row)
</programlisting>
</refsection>
<title>See Also</title>
<para>
+<xref linkend="PostGIS_DropBBox" />,
+<xref linkend="PostGIS_AddBBox" />,
+<xref linkend="ST_Force_3DM" />,
+<xref linkend="ST_Force_3DZ" />,
+<xref linkend="ST_Force_2D" />,
+<xref linkend="geography" />
+ </para>
+
+ <para>
+<xref linkend="ST_IsValid" />,
<xref linkend="ST_IsValid" />,
<xref linkend="ST_IsValidReason" />,
<xref linkend="ST_IsValidDetail" />
-</para>
+ </para>
</refsection>
</refentry>
#include <string.h>
/* Place to hold the ZM string used in other summaries */
-static char tflags[4];
+static char tflags[5];
static char *
-lwtype_zmflags(uint8_t flags)
+lwtype_flagchars(uint8_t flags)
{
int flagno = 0;
if ( FLAGS_GET_Z(flags) ) tflags[flagno++] = 'Z';
if ( FLAGS_GET_M(flags) ) tflags[flagno++] = 'M';
if ( FLAGS_GET_BBOX(flags) ) tflags[flagno++] = 'B';
+ if ( FLAGS_GET_GEODETIC(flags) ) tflags[flagno++] = 'G';
tflags[flagno] = '\0';
LWDEBUGF(4, "Flags: %s - returning %p", flags, tflags);
{
char *result;
char *pad="";
- char *zmflags = lwtype_zmflags(point->flags);
+ char *zmflags = lwtype_flagchars(point->flags);
result = (char *)lwalloc(128+offset);
{
char *result;
char *pad="";
- char *zmflags = lwtype_zmflags(line->flags);
+ char *zmflags = lwtype_flagchars(line->flags);
result = (char *)lwalloc(128+offset);
char *tmp;
int i;
char *pad="";
- char *zmflags = lwtype_zmflags(col->flags);
+ char *zmflags = lwtype_flagchars(col->flags);
LWDEBUG(2, "lwcollection_summary called");
char *result;
int i;
char *pad="";
- char *zmflags = lwtype_zmflags(poly->flags);
+ char *zmflags = lwtype_flagchars(poly->flags);
LWDEBUG(2, "lwpoly_summary called");