Changeset 8868
- Timestamp:
- 01/18/12 06:17:11 (4 months ago)
- Location:
- trunk
- Files:
-
- 3 modified
-
doc/reference_accessor.xml (modified) (4 diffs)
-
liblwgeom/lwgeom_debug.c (modified) (6 diffs)
-
postgis/geography.sql.in.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/reference_accessor.xml
r8484 r8868 2079 2079 <refname>ST_Summary</refname> 2080 2080 2081 <refpurpose> Returns a text summary of the contents of the2082 <varname>ST_Geometry</varname>.2081 <refpurpose> 2082 Returns a text summary of the contents of the geometry. 2083 2083 </refpurpose> 2084 2084 </refnamediv> … … 2088 2088 <funcprototype> 2089 2089 <funcdef>text <function>ST_Summary</function></funcdef> 2090 2091 2090 <paramdef><type>geometry </type> <parameter>g</parameter></paramdef> 2092 2091 </funcprototype> 2092 <funcprototype> 2093 <funcdef>text <function>ST_Summary</function></funcdef> 2094 <paramdef><type>geography </type> <parameter>g</parameter></paramdef> 2095 </funcprototype> 2093 2096 </funcsynopsis> 2094 2097 </refsynopsisdiv> … … 2098 2101 2099 2102 <para>Returns a text summary of the contents of the geometry.</para> 2103 2104 <para> 2105 Flags shown square brackets after the geometry type 2106 have the following meaning: 2107 <itemizedlist> 2108 <listitem><para>M: has M ordinate</para></listitem> 2109 <listitem><para>Z: has Z ordinate</para></listitem> 2110 <listitem><para>B: has a cached bounding box</para></listitem> 2111 <listitem><para>G: is geodetic (geography)</para></listitem> 2112 </itemizedlist> 2113 </para> 2114 2100 2115 <para>&Z_support;</para> 2101 2102 </refsection> 2103 2104 <refsection> 2105 <title>Examples</title>2106 2107 <programlisting>SELECT ST_Summary(ST_GeomFromText('LINESTRING(0 0, 1 1)')) As good_line, 2108 ST_Summary(ST_GeomFromText('POLYGON((0 0, 1 1, 1 2, 1 1, 0 0))')) As bad_poly2109 --results 2110 good_line | bad_poly 2111 ----------------------+------------------------- 2112 | 2113 Line[B] with 2 points : Polygon[B] with 1 rings2114 : ring 0 has 5 points2115 :2116 2117 --3d polygon 2118 SELECT ST_Summary(ST_GeomFromEWKT('LINESTRING(0 0 1, 1 1 1)')) As good_line, 2119 ST_Summary(ST_GeomFromEWKT('POLYGON((0 0 1, 1 1 2, 1 2 3, 1 1 1, 0 0 1))')) As poly 2120 2121 --results 2122 good_line |poly2123 ---------------------- +-------------------------2124 | 2125 Line[ZB] with 2 points : Polygon[ZB] with 1 rings2126 : ring 0 has 5 points 2127 : 2116 <para>Availability: 1.2.2 - 2.0.0 added support for geography</para> 2117 2118 </refsection> 2119 2120 <refsection> 2121 <title>Examples</title> 2122 2123 <programlisting> 2124 =# SELECT ST_Summary(ST_GeomFromText('LINESTRING(0 0, 1 1)')) as geom, 2125 ST_Summary(ST_GeogFromText('POLYGON((0 0, 1 1, 1 2, 1 1, 0 0))')) geog; 2126 geom | geog 2127 -----------------------------+-------------------------- 2128 LineString[B] with 2 points | Polygon[BG] with 1 rings 2129 : ring 0 has 5 points 2130 : 2131 (1 row) 2132 2133 2134 =# SELECT ST_Summary(ST_GeogFromText('LINESTRING(0 0 1, 1 1 1)')) As geog_line, 2135 ST_Summary(ST_GeomFromText('POLYGON((0 0 1, 1 1 2, 1 2 3, 1 1 1, 0 0 1))')) As geom_poly; 2136 ; 2137 geog_line | geom_poly 2138 -------------------------------+-------------------------- 2139 LineString[ZBG] with 2 points | Polygon[ZB] with 1 rings 2140 : ring 0 has 5 points 2141 : 2142 (1 row) 2128 2143 2129 2144 </programlisting> … … 2134 2149 2135 2150 <para> 2151 <xref linkend="PostGIS_DropBBox" />, 2152 <xref linkend="PostGIS_AddBBox" />, 2153 <xref linkend="ST_Force_3DM" />, 2154 <xref linkend="ST_Force_3DZ" />, 2155 <xref linkend="ST_Force_2D" />, 2156 <xref linkend="geography" /> 2157 </para> 2158 2159 <para> 2160 <xref linkend="ST_IsValid" />, 2136 2161 <xref linkend="ST_IsValid" />, 2137 2162 <xref linkend="ST_IsValidReason" />, 2138 2163 <xref linkend="ST_IsValidDetail" /> 2139 </para>2164 </para> 2140 2165 </refsection> 2141 2166 </refentry> -
trunk/liblwgeom/lwgeom_debug.c
r8838 r8868 18 18 19 19 /* Place to hold the ZM string used in other summaries */ 20 static char tflags[ 4];20 static char tflags[5]; 21 21 22 22 static char * 23 lwtype_ zmflags(uint8_t flags)23 lwtype_flagchars(uint8_t flags) 24 24 { 25 25 int flagno = 0; … … 27 27 if ( FLAGS_GET_M(flags) ) tflags[flagno++] = 'M'; 28 28 if ( FLAGS_GET_BBOX(flags) ) tflags[flagno++] = 'B'; 29 if ( FLAGS_GET_GEODETIC(flags) ) tflags[flagno++] = 'G'; 29 30 tflags[flagno] = '\0'; 30 31 … … 42 43 char *result; 43 44 char *pad=""; 44 char *zmflags = lwtype_ zmflags(point->flags);45 char *zmflags = lwtype_flagchars(point->flags); 45 46 46 47 result = (char *)lwalloc(128+offset); … … 57 58 char *result; 58 59 char *pad=""; 59 char *zmflags = lwtype_ zmflags(line->flags);60 char *zmflags = lwtype_flagchars(line->flags); 60 61 61 62 result = (char *)lwalloc(128+offset); … … 77 78 int i; 78 79 char *pad=""; 79 char *zmflags = lwtype_ zmflags(col->flags);80 char *zmflags = lwtype_flagchars(col->flags); 80 81 81 82 LWDEBUG(2, "lwcollection_summary called"); … … 113 114 int i; 114 115 char *pad=""; 115 char *zmflags = lwtype_ zmflags(poly->flags);116 char *zmflags = lwtype_flagchars(poly->flags); 116 117 117 118 LWDEBUG(2, "lwpoly_summary called"); -
trunk/postgis/geography.sql.in.c
r8860 r8868 704 704 LANGUAGE 'C' IMMUTABLE STRICT; 705 705 706 -- Availability: 2.0.0 707 CREATE OR REPLACE FUNCTION ST_Summary(geography) 708 RETURNS text 709 AS 'MODULE_PATHNAME', 'LWGEOM_summary' 710 LANGUAGE 'C' IMMUTABLE STRICT; 711 706 712 707 713 -----------------------------------------------------------------------------
